// ajax_forgotpassword.js v1.0
// copyright 2008
// Easy2play BV

$(document).ready(function() {
	
	// change username
	$("#fpw_form").submit(function() {
		
		// Check for emptiness
		if ($("#fpw_email").val() == '') {
			$("#fpw_email").focus();
			return false;
		}
				
		var varPostUrl = 'inc/functions/ajax_resetpassword.php';
		var frmParams = $('#fpw_form').serialize();
		
		$.ajax({
			method: "post",url: varPostUrl,data: frmParams,   
			beforeSend: function(){$("#ajaxcontent").html('').hide("slow"); $("#ajaxwait").show('slow',function(){ if(jQuery.browser.msie) this.style.removeAttribute('filter');});},
			complete: function(){ $("#ajaxwait").hide("slow");},
			error: function(){ $("#ajaxcontent").html('error').show('slow',function(){ if(jQuery.browser.msie) this.style.removeAttribute('filter');});},
			success: function(html){ $("#ajaxcontent").html(html).show('slow',function(){ if(jQuery.browser.msie) this.style.removeAttribute('filter');}); }   
		});

		return false;	
		
	});

	
});