function textCounter(field, countfield, maxlimit) { 
	if (field.value.length > maxlimit) // if too long...trim it! 
	field.value = field.value.substring(0, maxlimit); 
	// otherwise, update 'characters left' counter 
	else 
	countfield.value = maxlimit - field.value.length; 
} 


function doBlock(srcElement) {
	  if(srcElement.bgColor == '#18299c')
	  {
	      srcElement.bgColor = '#142482';
	  }else{
	      srcElement.bgColor = '#18299c';
	  }
	}

	var sRepeat=null
	
	function popup(ImgUrl,ImgWidth,ImgHeight)
	{
		var win = window.open(ImgUrl,'','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+ImgWidth+',height='+ImgHeight);
	}
	
	function posDivs()	{

		var baby=new getObj('baby');
		var babyheight=337;
		
		if (window.innerHeight)	{// NS4
			sHeight=window.innerHeight
			sHeight=document.height
			if (baby)
				baby.style.top=(sHeight-babyheight)-44;
			}
		else
			if (document.documentElement && document.documentElement.scrollTop) {
				sHeight= document.documentElement.scrollHeight;
				}
			else
				if (document.body) {
					sHeight=document.body.scrollHeight;
					baby.style.top=(sHeight-babyheight)-44;
					}

		if (baby)
		{
			baby.style.left=794;
			baby.style.visibility="visible"
		}
	}
	

	function getObj(name)
	{
	  if (document.getElementById)
	  {
	  	this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	  }
	  else if (document.all)
	  {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	  }
	  else if (document.layers)
	  {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	  }
	}

	function ShowHideMenu(whichone) {
		for (i=0; i<1; i++) {
			 NavMenu = new getObj('Layer'+(i+1));
			 if (((i+1)==whichone) && (whichone!=0)) {
			 	NavMenu.style.visibility="visible"
				 } else {
		 		NavMenu.style.visibility="hidden"
				}
			}
	}
	
	function ShowDiv(whichone) {
		var MyDiv = new getObj(whichone)	
		MyDiv.style.visibility="visible"	
	}
	
	function HideDiv(whichone) {
		var MyDiv = new getObj(whichone)	
		MyDiv.style.visibility="hidden"	
	}
		
	
	function doMarquee(dir, src, amount) {
	 // Amount is optional - default to 10 if not specified
	 if (amount==null) amount=10
	 // For each direction, increment and check if to start over
	 switch (dir) {
	  case "up":
	    document.all[src].style.pixelTop-=amount
	    if (-document.all[src].style.pixelTop>=document.all[src].offsetHeight)
	     document.all[src].style.pixelTop=document.all[src].offsetParent.offsetHeight
	    break;
	  case "down":
	    document.all[src].style.pixelTop+=amount
	    if (document.all[src].style.pixelTop>document.all[src].offsetParent.offsetHeight)
	     document.all[src].style.pixelTop = -document.all[src].offsetHeight
	    break;
	  case "left":
	    document.all[src].style.pixelLeft-=amount
	    if (-document.all[src].style.pixelLeft>=document.all[src].offsetWidth)
	     document.all[src].style.pixelLeft=document.all[src].offsetParent.offsetWidth
	    break;
	  case "right":
	    document.all[src].style.pixelLeft+=amount
	    if (document.all[src].style.pixelLeft>document.all[src].offsetParent.offsetWidth)
	      document.all[src].style.pixelLeft = -document.all[src].offsetWidth
	    break;
	 }
	}
	
	function doLoad() {
	 posDivs()
	 //sRepeat = setInterval("doMarquee('left','s1')",200)
	 setup()
	}

	function popMe(strUrl,strName,intWidth,intHeight) {
		var win=window.open(strUrl,''+strName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+intWidth+',height='+intHeight+',top=100,left=100');
	}
	function popMeS(strUrl,strName,intWidth,intHeight) {
		var win=window.open(strUrl,''+strName,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+intWidth+',height='+intHeight+',top=100,left=100');
	}
	
	
function rot13(input) {
	var coding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMabcdefghijklmnopqrstuvwxyzabcdefghijklm';
	
	for (var text = '',i=0;i<input.length;i++) {
	character = input.charAt(i);
	position = coding.indexOf(character);
	if (position > -1) {
	character = coding.charAt(position + 13);
	}
	text += character;
	}
	
	return text;
}

function ontRot(linkje) {
	if (linkje.href.indexOf('mailto:')!=0) {
	linkje.href=rot13(linkje.href);
	}
}
