/* CSS Document
 * @Revision $Revision: 587 $
 * @Author $Author: manjesh $
 * @Date $Date: 2009-02-20 16:47:04 +0530 (Fri, 20 Feb 2009) $
*/
function getXhr()
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
return xmlHttp;
  }






function hidediv(id1,id2){
if(id1 != ''){
document.getElementById(id1).style.display = 'none';
}
if(id2 != ''){
document.getElementById(id2).style.display = 'block';

}
}



function login_validate(frm){
	var mail=echeck(frm.email.value);
	if(mail== false){
		frm.email.value='';
		frm.email.focus();
		return false;
		}
	var pass= trim(frm.password.value);
	if(pass == '')
	{
		alert('Enter a password');
		frm.password.value='';
		frm.password.focus();
	return false;
		}
	frm.submit();
}

function echeck(email){
	if(email==""){alert('Please enter email -id');return false;}
	else{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) {
      alert('Invalid email address');
      return false;
   }
	}
}






function showupdatediv(errorcode){


if(errorcode==110)
{
document.getElementById('newmahi').style.display='block';
document.getElementById('newmahi2').style.display='block';
settimeout('waitlogin()',5000);
}//settimeout(5000);
}
 /**
  *
  * @access public
  * @return void
  **/
 function waitlogin(){
 document.getElementById('newmahi').style.display='none';
 document.getElementById('newmahi2').style.display='none';
 }

