// JavaScript Document
// JavaScript Document
function openwindow(name,url,width,height)
{
	
var win=window.open(url,name,"width="+width+",height="+height+",status=no,toolbar=no,menubar=no,location=no");
win.moveTo(100,100);
win.focus();
}

function showhide(elementId)
{
	if(document.getElementById(elementId).style.display=="none")
	{ 
	 document.getElementById(elementId).style.display="";
	 }else{
	 document.getElementById(elementId).style.display="none";
	 } 
}

function CountLeft(field, count, max)
 { // if the length of the string in the input field is greater than the max value, trim it  
	 if (field.value.length > max) 
	 field.value = field.value.substring(0, max);
	  else 
	  // calculate the remaining characters  
	   count.value = max - field.value.length;
 }

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}


