 
$(document).ready(function() {

	$("#newsletterSendBut").click(function() {
	 
	    $("#message_log").show(500);
    	var action = $("#form1").attr('action');
		var form_data = {
			username: $("#username").val(),
			password: $("#password").val(),
			is_ajax: 1
		};
		
		$.ajax({
			type: "POST",
			url: action,
			data: form_data,
			success: function(response)
			{   
			$("#message_log").show(500); 
			 
			if(response == 'success'){
			$("#message_log").hide(500);
			$("#message3").show(500);
			 
            $("#message3").html("<p>You have logged in successfully!</p>"); 
						 var url = "kgatee/teetime_test.php";
                           $(location).attr('href',url)
					 
			
			}
			
				
				 
			if(response == 'first'){
			$("#message_log").hide(500);
			 $("#message3").show(500);
			
            $("#message3").html("<p >You have logged in successfully!</p>"); 
						 var url = "kgatee/first_login.php";
                           $(location).attr('href',url)
			 
			
			}	
					
					
			if(response == '')
			{
					
			$("#message_log").hide(500);
			$("#message3").show(500);
            $("#message3").html("<p >Invalid username and/or password.</p>");	
			$("#message3").hide(4000);
			}
			
			
			
			
			}
		});
		return false;
	});
	
});
 
