function showmenu(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "visible";
}

function hidemenu(id) {
  var lyr = getElemRefs(id);
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}

function getElemRefs(id) {
	var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? document.layers[id]: null;
	if (el) el.css = (el.style)? el.style: el;
	return el;
}

	
	function getDim2(el){
	for (var lx=0,ly=0;el!=null;
		ly+=el.offsetTop,lx+=el.offsetLeft,el=el.offsetParent);
	return {y:ly}
}
    function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx}
}


function popUp(PopInfo,wid,hei)
{
var desktop=window.open(PopInfo,"_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=" + wid + ",height=" + hei + "");
}

function Linkop(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 					
	}
	
function chkdata2(form) {
	var emailID=document.subs.subscribe;
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	else
return true;
}

function chkdataLogin(form) {
	var emailID2=document.loginform.sEmail;
	if (echeck(emailID2.value)==false){
		emailID2.value=""
		emailID2.focus()
		return false
	}
	
	if (document.loginform.sPassword.value == "") {
		alert("Please enter your password.");
		document.loginform.sPassword.focus();
		return false; }
	else
return true;
}

  
	
	