function validateusercredentials()
{
	if(document.getElementById("txtLogin").value == "")
	{
		alert("User ID is required.");
		document.getElementById("txtLogin").focus();
		return false;
	}

	if(document.getElementById("txtPwd").value == "")
	{
		alert("Password is required.");
		document.getElementById("txtPwd").focus();
		return false;
	}

	return true;
}

function OnRecoveryCompleted()
{
	displayMessageDOM('modalMessageForgotIDSuccess',500,150);
}

function OnRecoveryCompletedUserBlocked()
{
	displayMessageDOM('modalMessageForgotIDUserBlocked',500,120);
}

function OnRecoveryInComplete()
{
	displayMessageDOM('modalMessageForgotIDFail',500,200);
}

function ResetPassword()
{
    document.getElementById("hdWhichSubmitButtonClicked").value = 'PASSWORDSUBMITCLICKED';
	var sEmail = document.getElementById("txtEmail").value; //document.frmPwdRecovery.txtEmail.value;
	if (sEmail==""){
		alert("Please Enter Login Email Id");
		return false;
	}
	if (!isEmail(sEmail)){
	alert("Please Enter Valid Email Id");
	document.getElementById("txtEmail").focus();
	return false;
	}	

	document.forms["frmPasswordRecovery"].action = document.getElementById("hdSiteMainDirectoryURL").value + "layouts/password_recovery.asp";
}

function isEmail(str) {
	var supported = 0;
	if (window.RegExp) {
		var tempStr = "a";
	    var tempReg = new RegExp(tempStr);
	    if (tempReg.test(tempStr)) supported = 1;
	}
	if (!supported) 
	  return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	return (!r1.test(str) && r2.test(str));
}	

function ResetLogin(){
	window.open('Password_Recovery.asp?hdResetPwdORLogin=ResetLogin&cmdUserAction=12','NewCreateLoginWindow', 'status=yes,height=450,width=985,toolbar=no,menubar=no,location=no,top=100,left=10')				
}