$(document).ready( function() {
	
	$('.resulta').hide();

	$('.log_button').click( function() {
	
	var password = $('#password').val();
	var username = $('#username').val();
	
		$.ajax({
		type: "POST",
		data: ({username: username, password: password}),
		url:"administrator/login.php",
		success: function(response) {
		 
			if(response == 1){			$(".resulta").fadeOut();
			document.location.href= 'administrator/';			$(".resulta").removeClass('error_login')
			}else{
			$(".resulta").fadeIn(500).html("<strong>!</strong> wrong password or username"); 			$(".resulta").addClass('error_login')
			}
		
		}
		})		
			
	});
	
	
});