var opt;
function expand(opt)
{
//alert(opt);


    if(opt=='2')
	{
		var strUrl = "sign_in.php";
	}
    if(opt=='3')
	{
		var strUrl = "forgot.php";
	}
	
	if(opt=='4')
	{
		var strUrl = "forgot.php";
	}

	xmlhttpPost(strUrl);
}
function frmClose()
{
	document.getElementById('detail').innerHTML = "<div id='detail'></div>";
}
function fnBegin_bda()
{

    var getURL="bda/index.php";
    window.location.href=getURL;
}
function fnInvalid_bda(opt)
{

    var getURL="bda/invalid_login_mail.php?bda_id=" + opt;
	//alert(getURL);
    window.location.href=getURL;
}
function fnInvalid_user(opt)
{
   
    var getURL="user/invalid_login_mail.php?user_id=" + opt;
	//alert(getURL);
    window.location.href=getURL;
}
function fnBegin_user()
{
    var getURL="user_index.php";
    window.location.href=getURL;
}

function doSignin()
{
	//document.login_frm.sub1.value='Processing';			
	//document.login_frm.sub1.disabled=true;			
   val1 = document.getElementById("user_email").value;
  	

    if(val1==0)
    {
      alert("Enter the User Email");
	  document.getElementById("user_email").focus();
      return false;
    }
	
   qstr = document.getElementById("user_email").value;
   qstr1 = document.getElementById("chk_news").value;
   if(document.getElementById("chk_news").checked==true)
   {
	   var chk=1;
   }
   else
   {
	   var chk=0;
   }
   var strUrl = "reg.php?user_email="+qstr+"&chk_news="+chk;
   //alert("test");
  // alert(strUrl);
   window.location.href=strUrl;
   //xmlhttpPost(strUrl);
}

function doForgot()
{
   val1 = document.getElementById("f_user_email").value;
   val2 = document.getElementById("employee_module").value;
//alert(val2);
//alert(val1);
   var filter=/^.+@.+\..{2,3}$/
    if(val1==0)
    {
      alert("Please Enter the Email ID");
    	return false;
    }
	else if (!(filter.test(val1)))
	{
			alert("Enter correct Email id");
    	return false;
	}
    if(val2==0)
    {
      alert("Please Select modules");
    	return false;
    }
   qstr = "u_mail=" + document.getElementById("f_user_email").value;
   qstr += "&employee_module=" + document.getElementById("employee_module").value;
   var strUrl = "forgot_acknowledge.php?" + qstr;
	//alert(strUrl);
	xmlhttpPost(strUrl);
}
function doForgot1()
{
   val1 = document.getElementById("f1_user_email").value;
   val2 = document.getElementById("employee_module1").value;
alert(val1);
alert(val2);

   var filter=/^.+@.+\..{2,3}$/
    if(val1==0)
    {
      alert("Please Enter the Email ID");
    	return false;
    }
	else if (!(filter.test(val1)))
	{
			alert("Enter correct Email id");
    	return false;
	}
    if(val2==0)
    {
      alert("Please Select modules");
    	return false;
    }
   qstr = "u_mail1=" + document.getElementById("f1_user_email").value;
   qstr += "&employee_module1=" + document.getElementById("employee_module1").value;
   var strUrl = "forgot_acknowledge1.php?" + qstr;
	//alert(strUrl);
	xmlhttpPost(strUrl);
}


  function xmlhttpPost(strURL) {
	 
    var xmlHttpReq = false;
    var self = this;
	var browserName=navigator.appName; 
	var browserVer=parseInt(navigator.appVersion);
	//alert(browserName);
	//alert(browserVer);
	if ((browserName=="Netscape" && browserVer==5))
	{
		window.location="newsletter.php";
	} 
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
	strURL = strURL;
	//alert(strURL);
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.onreadystatechange = function() 
	{
	    if (self.xmlHttpReq.readyState == 4) 
		{
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(getquerystring());

}

function getquerystring() {
   	var qstr="";
    return qstr;
}

function updatepage(str){
//alert(str);

	document.getElementById("detail").innerHTML = str;
//	document.getElementById('detail').style.display =''; 
}
