<!-- start
// (c) 2000-2006 ricocheting <ricocheting@hotmail.com>

// 2010-02-09: v1.2: made it work with doctype XHTML 1.0 Transitional

//################################
// funtion: generate()
// decs: creates the source depending out textboxes
function generate(){
link1='';
link2='';
link3='';
mytext='';
js='';
mystyle='';
f=document.myForm;

imgHeight=30;
imgWidth=120;


if(f.position.selectedIndex==0){
	if (f.mytype[1].checked) {
		imgWidth=f.imgWidth.value;}
	topIE='document.body.scrollTop+10';
	leftIE='10';
	topNS='window.pageYOffset+10';
	leftNS='10';
	textalign='align="left"';
}

if(f.position.selectedIndex==1){
	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){
	if (f.mytype[1].checked) {
		imgHeight=parseInt(f.imgHeight.value)+5;
		imgWidth=f.imgWidth.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){
	if (f.mytype[1].checked) {
		imgHeight=parseInt(f.imgHeight.value)+5;
		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"';
}

if(f.position.selectedIndex==4){
	if (f.mytype[1].checked) {
		imgHeight=parseInt(f.imgHeight.value)+5;
		imgWidth=f.imgWidth.value;}
	topIE='document.body.scrollTop+document.body.clientHeight-'+imgHeight;
	leftIE='document.body.clientWidth/2-'+(imgWidth/2);
	topNS='window.pageYOffset+window.innerHeight-'+imgHeight;
	leftNS='window.innerWidth/2-'+(imgWidth/2);
	textalign='align="center"';
}

//main javascript for watermark
js='<script language="javascript">\n'+
'function SetStatic(){\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("SetStatic()",10);\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+'px; height:'+f.imgHeight.value+'px;"';
	}
	else if(f.imagefilter.selectedIndex==2){
		var mystyle=' style="filter: alpha(style=2, opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'px; height:'+f.imgHeight.value+'px;"';
	}
	else if(f.imagefilter.selectedIndex==3){
		var mystyle=' style="filter: alpha(style=3, opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'px; height:'+f.imgHeight.value+'px;"';
	}
	else if(f.imagefilter.selectedIndex==4){
		var mystyle=' style="filter: alpha(opacity='+f.totalper.value+'); width:'+f.imgWidth.value+'px; height:'+f.imgHeight.value+'px;"';
	}

	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 the URL to your image');f.myimage.focus();f.myimage.select();
	}
}//end if type=images


// if type=text
else{
	if(f.textfilter.selectedIndex==0){
		var mystyle='';
	}
	else if(f.textfilter.selectedIndex==1){
		var mystyle='filter: shadow(color='+f.filtercolor.value+',direction=45);';
	}
	else if(f.textfilter.selectedIndex==2){
		var mystyle='filter: glow(color='+f.filtercolor.value+',strength=2);';
	}

	mytype='<span style="font-family:\''+f.textface.value+'\'; font-size:'+f.textsize.value+'pt;color:'+f.textcolor.value+';'+mystyle+' width:120px;padding:3px">'+f.mytext.value+'</span>';
}//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;width:'+imgWidth+'px;">\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(){

	if(document.myForm.output.value != 'no code available. "Generate" source code first'){
		msg=open("","DisplayWindow","menubar=1,scrollbars=1,resizable=1,width=400,height=200");
		worker = 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();
	}
}//view()


//################################
// funtion: ToggleType()
// decs: turns the options for the different types on/off
function ToggleType(){
	f=document.myForm;

	if(f.mytype[0].checked){
		f.myimage.disabled=true;
		f.alt.disabled=true;
		f.imgWidth.disabled=true;
		f.imgHeight.disabled=true;
		f.imagefilter.disabled=true;
		f.totalper.disabled=true;

		f.mytext.disabled=false;
		f.textface.disabled=false;
		f.textsize.disabled=false;
		f.textcolor.disabled=false;
		f.textfilter.disabled=false;
		//check to see if it's suppose to be enabled
		if(f.textfilter.selectedIndex!=0){f.filtercolor.disabled=false;}
	}
	else{
		f.myimage.disabled=false;
		f.alt.disabled=false;
		f.imgWidth.disabled=false;
		f.imgHeight.disabled=false;
		f.imagefilter.disabled=false;
		//check to see if it's suppose to be enabled
		if(f.imagefilter.selectedIndex!=0){f.totalper.disabled=false;}


		f.mytext.disabled=true;
		f.textface.disabled=true;
		f.textsize.disabled=true;
		f.textcolor.disabled=true;
		f.textfilter.disabled=true;
		f.filtercolor.disabled=true;
	}

}//ToggleType()
window.onload=function(){ToggleType();}

//-->