<!-- start
function generate(){
link1='';
link2='';
link3='';
mytext='';
js='';
mystyle='';
f=document.myForm;

if(f.position.selectedIndex==0){
	topIE='document.body.scrollTop+10';
	leftIE='10';
	topNS='window.pageYOffset+10';
	leftNS='10';
	textalign="align=left";
}

if(f.position.selectedIndex==1){
	imgWidth=130;
	if (f.mytype[1].checked) {
		imgWidth=f.imgWidth.value}
	topIE='document.body.scrollTop+10';
	leftIE='document.body.clientWidth-20-'+imgWidth;
	topNS='window.pageYOffset+10';
	leftNS='window.innerWidth-25-'+imgWidth;
	textalign="align=right";
}

if(f.position.selectedIndex==2){
	imgHeight=30;
	if (f.mytype[1].checked) {
		imgHeight=f.imgHeight.value;}
	topIE='document.body.scrollTop+document.body.clientHeight-'+imgHeight;
	leftIE='10';
	topNS='window.pageYOffset+window.innerHeight-'+imgHeight;
	leftNS='10';
	textalign="align=left";
}

if(f.position.selectedIndex==3){
	imgHeight=30;
	imgWidth=130;
	if (f.mytype[1].checked) {
		imgHeight=f.imgHeight.value;
		imgWidth=f.imgWidth.value;}
	topIE='document.body.scrollTop+document.body.clientHeight-'+imgHeight;
	leftIE='document.body.clientWidth-20-'+imgWidth;
	topNS='window.pageYOffset+window.innerHeight-'+imgHeight;
	leftNS='window.innerWidth-25-'+imgWidth;
	textalign="align=right";
}

//main javascript for watermark
js='<script language="javascript">\n'+
'function makeStatic(){\n'+
'if(document.all){watermark.style.pixelTop='+topIE+';}\n'+
'else if(document.layers){eval(document.watermark.top=eval('+topNS+'));}\n'+
'else if(document.getElementById && !document.all){document.getElementById("watermark").style.top='+topNS+';}\n'+
'}\n'+
'\n'+
'setInterval("makeStatic()",1);\n'+
'\n'+
'function position() {\n'+
'if(document.all){\n'+
'watermark.style.pixelLeft = '+leftIE+';\n'+
'setTimeout(\'watermark.style.visibility = "visible"\', 50);}\n'+
'else if(document.layers){\n'+
'document.watermark.left+='+leftNS+';\n'+
'setTimeout(\'document.watermark.visibility = "visible"\', 50);}\n'+
'else if(document.getElementById && !document.all){\n'+
'document.getElementById("watermark").style.left='+leftNS+';\n'+
'setTimeout(\'document.getElementById("watermark").style.visibility = "visible"\', 50);}\n'+
'}//end function\n'+
'\n'+
'position();\n'+
'</script>\n';


// if type=images
if(f.mytype[1].checked){
	if(f.imagefilter.selectedIndex==1){
	var mystyle=' STYLE="filter: alpha(style=1, opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'; height:'+f.imgHeight.value+';"';
	}
	else if(f.imagefilter.selectedIndex==2){
	var mystyle=' STYLE="filter: alpha(style=2, opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'; height:'+f.imgHeight.value+';"';
	}
	else if(f.imagefilter.selectedIndex==3){
	var mystyle=' STYLE="filter: alpha(style=3, opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'; height:'+f.imgHeight.value+';"';
	}
	else if(f.imagefilter.selectedIndex==4){
	var mystyle=' STYLE="filter: alpha(opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'; height:'+f.imgHeight.value+';"';
	}
	mytype='<img src="'+f.myimage.value+'" width="'+f.imgWidth.value+'" height="'+f.imgHeight.value+'" border=0 alt="'+f.alt.value+'"'+mystyle+'>';
	if((f.myimage.value == 'http://')||(f.myimage.value=='')){alert('Please enter a URL for your image');}
}//end if type=images


// if type=text
else{
	if(f.textfilter.selectedIndex==0){
	var mystyle=' style="width:120; color:#000000;padding:3px"';
	}
	else if(f.textfilter.selectedIndex==1){
	var mystyle=' style="filter: shadow(color='+f.filtercolor.value+',direction=45); width:120; color:#000000;padding:3px"';
	}
	else if(f.textfilter.selectedIndex==2){
	var mystyle=' style="filter: glow(color='+f.filtercolor.value+',strength=2); width: 120;padding:3px";';
	}

	mytype='<font face="'+f.textface.value+'" size="'+f.textsize.value+'" color="'+f.textcolor.value+'"'+mystyle+'>'+f.mytext.value+'</font>';
}//end if type=text

//if watermark is link
if((f.mylink.value != '') && (f.mylink.value != '-- no link --')){
	link1='<a href="'+f.mylink.value+'" style="text-decoration:none;cursor:hand;">';
	link2="</a>";
}

//tag for watermark
var div='<div '+textalign+' id="watermark" style="position: absolute; left:0px; top:0px; z-index:20; visibility:hidden">\n'+link1+mytype+link2+'</div>\n\n';

f.output.value= div+js;
}//end fuction generate()
//var worker=''+location.hostname+'';
//if((worker.indexOf('ri'+'coche'+'ting.c'+'om') == -1)&&(location.hostname!='')&&(location.hostname!='localhost')){
//document.write('or'+'igi'+'nal jav'+'ascr'+'ipt fr'+'om <a href="ht'+'tp://w'+'ww.ri'+
//'coche'+'ting.c'+'om/j'+'s/">ri'+'coche'+'ting.c'+'om</a>');}


//################################
// funtion: view()
// decs: displays a preview of the script
function view(){
var worker='';
if(document.myForm.output.value != 'no code available. "Generate" source code first'){
msg=open("","DisplayWindow","menubar=1,scrollbars=1,resizable=1,width=33,height=200");
msg.document.write(document.myForm.output.value+"\n\nScroll Page to see watermark in action.");

for(i=0; i<=150; i++){
	if(i%10==0 && i!=0){worker+=i+'\n<br>';}
	else{worker+='<br>';}
}

msg.document.write(worker);
}
else{
generate();
view();}
}

//-->
