var email=false;
function forgotpwd()
{
  var new_email = (document.getElementById('l_email') &&  document.getElementById('l_email').value) || document.getElementById('l_email_top').value;
	
	if(new_email == '')
	{
		alert('Please enter your email address into the \'Email\' field and click this link again.');
	}
        else if (! could_be_an_email(new_email))
        {
                alert(new_email+' does not look like a valid email address');
        }
	else if (email==new_email)
        {
                alert("An email has already been sent to "+email+" it may take up to 30 minutes to arrive");
        }
        else
	{
                if(confirm('Click Ok to send instructions for resetting your password to '+new_email)){
		    email=new_email;
		    parmstring = "email=" + new_email;
		    makePOSTRequest('/ajax/forgotpwd.php',parmstring);
                }
	}
}
function recieve_forgot_msg(val,id)
{
   if(id=='msg' && val!='')
    alert(val);
}
