/**
 * Checks to see if the entered email address has already been taken.
 **/

 var xmlSection = jsXML.createDOMDocument("", "ValidEmail");
function checkEmailAddress(mytxt)
{
 //var xmlSection = jsXML.createDOMDocument("<bean:message key=\"sitename\" />", "ValidEmail");


 xmlSection.load("/registration/CheckEmailAction.do?email=" + mytxt);

 setTimeout("checkValid()", 2000);
}

function checkValid()
{
 var xmlDoc = xmlSection.xml;
 //alert (xmlDoc);
//alert("Root Node:" + xmlSection.documentElement.nodeName );
 var tmp = xmlSection.getElementsByTagName('CheckEmailAction');
 //alert( tmp[0].firstChild.firstChild.nodeValue );
 //alert(tmp.length);
 if((tmp.length > 0) && (tmp[0].firstChild.firstChild.nodeValue == 'true') )
 {
 	alert("We're sorry but the username that you have entered is already in our system.  If you think you might have already registered.  Please try using the Signin or Forgot my password links.");
 }
 else
 {
 	;//Do nothing this is not in the database.
 }
}


