$(document).ready(function() {
						   		   
	//Valida Login
	v = $("#form").validate({
		debug: false,
		clearForm: true,
		resetForm: true,
		highlight: function(element, errorClass) {
			$(element).fadeOut(function() {
			   $(element).fadeIn()
			})
		},
		rules: {
			login_usuario: "required",
			login_senha: "required"
		},			
		submitHandler: function() { //Validação OK
		
			//AJAX
			$.ajax({
				type: "POST",
				url: "logar.php",
				data: "usuario="+ $("#login_usuario").val() +"&senha="+ $("#login_senha").val(),
				success: function(msg){
                    if(msg == 'true') 
					{						
						window.open("logado.php","adm","width="+ screen.width +",height="+ screen.height +",top=0,left=0,status=no,resizable=no"); 
						window.open("index.php","_self");
						
					}else{
					    alert(msg);	
					}		
				}
			});
			
			
		}
	});	
	
});