var xmlHttp;
function checkEmailId()
{
var _userName=trim(document.getElementById("txtPrimaryEmail").value);
if(_userName!="")
{
xmlHttp=null;
xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request.");
return;
}
var url="../checkEmail.aspx";
url=url+"?varUserName="+_userName;
xmlHttp.onreadystatechange=stateChangedCheckEmail;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
}
function stateChangedCheckEmail()
{
var loadstatustext=" This email address already exists.";
if(xmlHttp.readyState==4)
{
if((xmlHttp.responseText).search(/exists/i)>0)
{
var emailDiv=document.getElementById("WarningMsgs_RegistrationErrors");
emailDiv.style.display="block";
document.getElementById("WarningMsgs_divWarningInfo").style.display="block";
emailDiv.innerHTML=loadstatustext;
var emailIdObj=document.getElementById("txtPrimaryEmail");
if(emailIdObj!=null&&emailIdObj!="")
{
emailIdObj.value="";
emailIdObj.focus();
}
return false;
}
else
{
var emailDiv=document.getElementById("WarningMsgs_RegistrationErrors");
if((emailDiv.innerHTML).search(/already/i)>0)
{
emailDiv.style.display="none";
document.getElementById("WarningMsgs_divWarningInfo").style.display="none";
emailDiv.innerHTML="";
}
return true;
}
}
}
function checkDisplayName()
{
var _DisplayName=trim(document.getElementById("txtDisplayName").value);
if(_DisplayName!="")
{
xmlHttp=null;
xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request.");
return;
}
var url="../checkDisplayName.aspx";
url=url+"?varDisplayName="+_DisplayName;
xmlHttp.onreadystatechange=stateChangedCheckDisplayName;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
}
function stateChangedCheckDisplayName()
{
var loadstatustext=" This display name already exists.";
if(xmlHttp.readyState==4)
{
if((xmlHttp.responseText).search(/exists/i)>0)
{
var displaynameDiv=document.getElementById("WarningMsgs_RegistrationErrors");
displaynameDiv.style.display="block";
document.getElementById("WarningMsgs_divWarningInfo").style.display="block";
displaynameDiv.innerHTML=loadstatustext;
var emailIdObj=document.getElementById("txtDisplayName");
if(emailIdObj!=null&&emailIdObj!="")
{
emailIdObj.value="";
emailIdObj.focus();
}
return false;
}
else
{
var displaynameDiv=document.getElementById("WarningMsgs_RegistrationErrors");
if((displaynameDiv.innerHTML).search(/already/i)>0)
{
displaynameDiv.style.display="none";
document.getElementById("WarningMsgs_divWarningInfo").style.display="none";
displaynameDiv.innerHTML="";
}
return true;
}
}
}
function recoverPassword()
{
var _userName=document.getElementById("txtEmailId").value;
xmlHttp=null;
xmlHttp=GetXmlHttpObject();
if(xmlHttp==null)
{
alert("Browser does not support HTTP Request.");
return false;
}
var url="../recoverPasswordTemp.aspx";
url=url+"?varUserName="+_userName;
xmlHttp.onreadystatechange=stateChangedRecoverPassword
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
return false;
}
function stateChangedRecoverPassword()
{
if(xmlHttp.readyState==4)
{
if((xmlHttp.responseText).search(/Invalid/i)>0)
{
var divStatus=document.getElementById("divStatus");
var divOriginal=document.getElementById("divPasswordRecovery");
divStatus.style.display='block';
alert(xmlHttp.responseText);
divStatus.innerHTML=xmlHttp.responseText;
}
else
{
var divStatus=document.getElementById("divStatus");
var divOriginal=document.getElementById("divPasswordRecovery");
divStatus.style.display='block';
divStatus.innerHTML=xmlHttp.responseText;
}
}
}
function GetXmlHttpObject()
{
var objXMLHttp=null;
if(window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
//---------------------------------------------------------------------
