$(document).ready(function()
{	
	$('#submitpassword').click(function()
	{
		
		if(!isvalidemail($('#forgotemail').val()))
		{
			$('#forgotemail').removeClass('textbox3');
			$('#forgotemail').addClass('mtsignup-validator');
			$('#forgotemail').val('');		
			$('#forgotemail').focus();
			return false;
		}
		
				
		var email=$('#forgotemail').val();

		var dataString = 'email='+ email ;
		$.ajax(
		{
				type: "POST",
				url: "http://www.markettamer.com/ajax/sendnewpass.php",
				data: dataString,
				success: function(msg) 
				{

            			$('#mainbody').html("<div id='message' style='height:230px'></div>");
						$('#message').html(msg)
						.hide()
						.fadeIn(1500, function() 
						{
						});
				}
			}
		);
  return false;
		
		//return true;
	});
	
		
});
	
function isvalidemail(value)
{
	var emailexpr=/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	return emailexpr.test(value);
}