$().ready(function() {
		$('#submitforgotpassword').click(function(){
			postajax('forgotpassword','forgotmsg');
		});
		function postajax(formid,msgclass)
		{
			var url = $('#'+formid).attr('action');
			$.ajax({
				type: "POST",
				url: url,
				data: $('#'+formid).serialize(),
				dataType: "json",
				success: function(msg){
					if(parseInt(msg.status)==1)
					{
						if(typeof msg.url == 'undefined')
						$('.'+msgclass).html(msg.txt);
						else
						window.location=msg.txt;
					}
					else if(parseInt(msg.status)==0)
					{
						$('.'+msgclass).html(msg.txt);
					}
				}
			});
		}
});
