
	// initial position 
	var dn_startpos=120; 			
	// end position
	var dn_endpos=-200; 			
	// Speed of scroller higher number = slower scroller 
	var dn_speed=70;				

	// class to add when JS is available
	var dn_classAdd='hasJS';		

	function submitTo(pURL)
	{
	  if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
    	  xmlhttp=new XMLHttpRequest();
	      xmlhttp.onreadystatechange=showResponse;    	  
	      xmlhttp.open("GET", pURL, true);
    	  xmlhttp.send(null);
	   } else if (window.ActiveXObject) { //IE
    	  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
	      if (xmlhttp) {
	         xmlhttp.onreadystatechange=showResponse;	      
    	     xmlhttp.open('GET', pURL, false);
        	 xmlhttp.send();
	      }
	   }
	}
	
	// function to handle asynchronous call
	function showResponse() {
	   if (xmlhttp.readyState==4) { 
	      if (xmlhttp.status==200) { 
	         alert("'"+xmlhttp.responseText.substring(126,162)+"'");
	      }
	   }
	}

	function submitAndPost(pURL)
	{
	  if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc
    	  xmlhttp=new XMLHttpRequest();
	      xmlhttp.onreadystatechange=showResponse;    	  
	      xmlhttp.open("GET", pURL, true);
    	  xmlhttp.send(null);
	   } else if (window.ActiveXObject) { //IE
    	  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
	      if (xmlhttp) {
	         xmlhttp.onreadystatechange=postResponse;	      
    	     xmlhttp.open('GET', pURL, false);
        	 xmlhttp.send();
	      }
	   }
	}
	
	// function to handle asynchronous call
	function postResponse() {
	   if (xmlhttp.readyState==4) { 
	      if (xmlhttp.status==200) { 
	 			if(xmlhttp.responseText.length>10)
			         postIt(xmlhttp.responseText);
	      }
	   }
	}			

	function postIt(msg)
	{
		if(msg!=null&&msg!="")
		document.getElementById("MESSAGE_BANNAER").innerHTML +="- "+msg+"<br/>";
	}
	function clearPost()
	{
		document.getElementById("MESSAGE_BANNAER").innerHTML ="";
		return true;
	}
	function endPost()
	{
		return document.getElementById("MESSAGE_BANNAER").innerHTML=="";
	}		
	
	function checkMandatoryList(list,captions)
	{
		var error="";
		for(i=0;i<list.length;i++)					
			if(list[i].value==null||list[i].value=="")
			{
				error+="\n  -"+captions[i];				
				var star=document.getElementById(list[i].name+"_STAR");
				star.style.color="red";
			}
			else 
			{
				var star=document.getElementById(list[i].name+"_STAR");
				if(star!=null)
					star.style.color="blue";
			}
		
		if(error=="")
			return true;
		else
			{
				alert("The following fields are missing:"+error);
				return false;
			}
	}	
	function checkMandatoryList2(list,captions)
	{
		for(i=0;i<list.length;i++)					
			if(list[i].value==null||list[i].value=="")
			{			
				postIt("'"+captions[i]+"' is missing");
				var star=document.getElementById(list[i].name+"_STAR");
				star.style.color="red";
				star.parentNode.style.color="red";
			}
			else 
			{
				var star=document.getElementById(list[i].name+"_STAR");
				if(star!=null)
				{
					star.style.color="blue";
					star.parentNode.style.color="blue";
				}
			}
		return true;
	}
	function checkMail(x)
	{
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!filter.test(x)) 
			postIt('Invalid E-mail address');
		return true;
	}
	function showDropDownMenu(menuName,n)
	{
	//	alert("to show");
		var menuDiv=document.getElementById(menuName);
		menuDiv.style.display = "block";
		menuDiv.style.position = "absolute";
		menuDiv.style.left=(28+(n*125))+"px";
		menuDiv.style.top = "133px";
		menuDiv.style.visibility="visible";
	}
	function hideDropDownMenu(menuName)
	{
	//	alert("to hide");
		document.getElementById(menuName).style.visibility="hidden";
	}
		
	function ismaxlength(obj)
	{
		var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
		if (obj.getAttribute && obj.value.length>mlength)
		{
			if((obj.value.length-mlength)>2)
				alert("The given string is trimed due to content overflow");
			obj.value=obj.value.substring(0,mlength);			
		}			
		document.getElementById(obj.name+"_STATUS").innerHTML=(mlength-obj.value.length)+" characters left";
	}
	
	function removeItem(theSel)
	{
	  var selIndex = theSel.selectedIndex;
	  if (selIndex != -1) {
	    for(i=theSel.length-1; i>=0; i--)
	    {
	      if(theSel.options[i].selected)
	      {
	        theSel.options[i] = null;
	      }
	    }
	    if (theSel.length > 0) {
	      theSel.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
	    }
	  }
	}

	function insertItem(theSel, newText, newValue)
	{
		theSel.options[theSel.options.length]=new Option(newText, newValue);
		theSel.selectedIndex=theSel.options.length-1;
	}