//Moved the below methods from Logincontrol.ascx as it was breaking W3C page validations
function OnLoginClick(ctlEmailID,ctlPwd,divId)
{
FireLogin(document.getElementById(ctlEmailID).value,document.getElementById(ctlPwd).value,divId);
}
function checkEnter(e)
{ //e is event object passed from function invocation
var characterCode; //literal character code will be stored in this variable
if(e && e.which)
{ //if which property of event object is supported (NN4)
e = e;
characterCode = e.which; //character code is contained in NN4's which property
}
else{
e = event;
characterCode = e.keyCode ;//character code is contained in IE's keyCode property
}
if(characterCode == 13)
{ //if generated character code is equal to ascii 13 (if enter key)
OnLoginClick('txtEmailId','txtPassword','SuccessLogin');
return false;
}
else{
return true;
}

}
//end
function FireLogin(emailId,pwd,divId)
	{

	var hdnUserName = document.getElementById('txthdnUserName');
	var hdnPassword = document.getElementById('txthdnPassword');
	
	hdnUserName.value = emailId;
	hdnPassword.value = pwd;
	var documentForm = document.getElementById('login');
	
	documentForm.method = "post";
	documentForm.action = document.getElementById('loginControl_checkLoginURL').value;
	documentForm.submit();
	}
	
function FireLogin1(emailId,pwd,divId)
{

	var xmlHttp; 
	
	{
	
	var requestURL = document.getElementById('loginControl_checkLoginURL').value+'?LoginPanelUserEmailId='; 
	var url = requestURL + emailId; 
		url+="&LoginPanelUserPassword=" + pwd;
	
	
	
	
	var divLogin = document.getElementById('loginControl_IMG3');
	divLogin.style.cursor='wait';
	

	document.body.style.cursor='wait';
	loadXMLDoc1(url);

	}
}
var req;

	function loadXMLDoc1(url) {
	req = false;
    // branch for native XMLHttpRequest object
    
    if(window.XMLHttpRequest && !(window.ActiveXObject)) {
    	try {
    	
			req = new XMLHttpRequest();
        } catch(e) {
			req = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
       	
        	req = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		req = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		req = false;
        	}
		}
    }
	if(req) {
         	//alert('sending request');
		req.onreadystatechange = processReqChange;
		
		req.open("POST", url,true);
		req.send("");
	}
}
		function processReqChange() 
		{
			// only if req shows "loaded"
			
			if (req.readyState == 4) 
				{ 
				if (req.status == 200) 
					{
						if(req.responseText.length > 0)
						{
							//alert(req.responseText);
							if(req.responseText =='Success')
							{
								var divLogin = document.getElementById('loginControl_JSLoginDiv');
								divLogin.style.display='none';
								//alert('Enable SuccessLogin');
								var divSLogin = document.getElementById('loginControl_SuccessLoginDiv');
								divSLogin.style.display='block';
								
								
								document.getElementById('loginControl_IMG4').style.display='none';
								document.getElementById('loginControl_Img5').style.display='block';
								document.getElementById('loginControl_IMG1').style.display='none';
								document.getElementById('loginControl_IMG1').style.display='block';
		
							}
							else
							{
									var loginURL = document.getElementById('loginControl_nonJSLogin').href;
									window.open(loginURL ,'_self'); //Received error
							 }
						}
						document.body.style.cursor='default';
					} 
				else 
					{
						document.body.style.cursor='default';
						var loginURL = document.getElementById('loginControl_nonJSLogin').href;
						window.open(loginURL ,'_self'); //Received error

						//if anyother error pl. redirect it to Non Java
					}
				}
				
		}