	function GoAction(theform,Actionx,eventTarget, eventArgument) {
		//var theform = thisform;//document.Form1;
		
		if (Actionx=="NEW")
		  doyou=true;
		else  
		  doyou = confirm("Do you want to " + Actionx + " this record? (OK = Yes   Cancel = No)"); //Your question.
        
        if (doyou == true)
        {
        	theform.__CUSTOMACTION.value = eventTarget;
		    theform.submit();
		}    
		
	}
    function validateLength512(oSrc, args){
      args.IsValid = (args.Value.length <=512);
    }
function popWindow(theURL,width,height) {
   window.open(theURL,'_new','toolbar=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,location=no,width='+width+',height='+height);
   return false;
}

function MenuList(ID,SHOW) {
//  alert("Your text in the alert function.");
var block = document.getElementById(ID);
//var block1 = document.getElementById(ID+"1");
//var i=int(block1.style.top);
//block.style.top=i+20 ;
//block.style.left=block1.style.left;

if (SHOW==true) 
   block.style.display ="";
else
   block.style.display ="none";
  return true;
}

function rs(n,u,w,h,x)
{
				args="width="+w+",height="+h+",resizable=yes,scrollbars=yes,status=yes,dependent=yes";
				//args="width="+w+",height="+h+",resizable=yes,scrollbars=yes";
				remote=window.open(u,n,args);
				remote.focus();
				if(remote != null && remote.opener == null) remote.opener = self;
				if(x == 1) return remote;
}
function PrintDoc(n,u,w,h,x)
{
				args="width="+w+",height="+h+",toolbar=yes, menubar=yes,resizable=yes,scrollbars=yes,status=yes,dependent=yes";
				//args="width="+w+",height="+h+",resizable=yes,scrollbars=yes";
				remote=window.open(u,n,args);
				remote.focus();
				if(remote != null && remote.opener == null) remote.opener = self;
				if(x == 1) return remote;
}
function ErrMsgBox (txt) {

if (txt!='') alert(txt);

 }
 
 function jampto(hfto)
{
   var s = document.getElementById(hfto).value;
   if (s!='') {
				//args="width="+w+",height="+h+",toolbar=yes, menubar=yes,resizable=yes,scrollbars=yes,status=yes,dependent=yes";
				//args="width="+w+",height="+h+",toolbar=yes, menubar=yes,resizable=yes,scrollbars=yes,status=yes,dependent=yes";
				//args="width="+w+",height="+h+",resizable=yes,scrollbars=yes";
				remote=window.open("#"+s,"_self","");
				remote.focus();
				if(remote != null && remote.opener == null) remote.opener = self;
		document.getElementById(hfto).value="";		
				}
}
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 ""
}

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 checkCookie()
{
username=getCookie('username')
if (username!=null && username!="")
  {alert('Welcome again '+username+'!')}
else 
  {
  username=prompt('Please enter your name:',"")
  if (username!=null && username!="")
    {
    setCookie('username',username,365)
    }
  }
}

 

 function findPosTop(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop
		}
	}
	return curtop;
}

 function findPosLeft(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
		}
	}
	return curleft;
}
