// ActionScript Document
$(document).ready( function(){
							$('.error').hide();
$('#enviarforma').click(function(){
				$('.error').hide();
				var nombre0 = $("#nombre").val();
				var correo0 = $("#correo").val();
				var mensaje0 = $("#mensaje").val();
				var pattern = /^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/;
				var a = pattern.test(correo0);
				var error=0;
				
				if (nombre0 == "") {
      				$("#nombreerror").show();
      				$("#nombre").focus();
    			}
				else if(correo0 == "") {
      				$("#correoerror").show();
      				$("#correo").focus();
    			}
				else if(!a){
					$("#correoerror").show();
      				$("#correo").focus();
				}
				else if(mensaje0 == "") {
      				$("#mensajeerror").show();
      				$("#mensaje").focus();
    			}
				else{
					$.get("contactof.php", { nombre: nombre0, correo: correo0, mensaje: mensaje0 },
						function(){
    						$('#informacion').load('gracias.html', null, function(){
								$('#informacion').hide();
								$('#informacion').fadeIn('slow');
							});	
  						});
				}
});
});