$(document).ready(function(){
$("#lost_password").submit(function(){
$("#lostbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);
$.post("index.php?a=ajax&ajax=lost_password",{email:$('#email').val(),rand:Math.random() },function(data){
if(data=='yes'){//if correct detail
$("#lostbox").fadeTo(200,0.1,function(){//start fading the messagebox
$(this).html('Your username and details about how to reset your password have been sent to your email address.').addClass('messageboxok').fadeTo(900,1);
});
}else{//if correct not valid detail
$("#lostbox").fadeTo(200,0.1,function(){//start fading the messagebox
$(this).html('Please enter valid email!').addClass('messageboxerror').fadeTo(900,1);
});
}
});
return false; //not to post the form physically
});
//now call the ajax also focus move from 
$("#email").blur(function(){
$("#lost_password").trigger('lostsubmit');
});
});
