
$(document).ready(function(){
	//Valida Marcação de consulta
	$("#frmMarcar").submit(function(){  
		if ($("#txtmarcarnome").val() == "") {
			$(".error-label").html("Por favor, informe seu nome.");
			$(".error-label").show("slow");
			$("#txtmarcarnome").css("border","1px solid #f00");
			return false;
		} else if (!(/^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$/.test($("#txtmarcaremail").val()))) {
			$(".error-label").html("Por favor, informe um e-mail válido.");
			$(".error-label").show("slow");
			$("#txtmarcaremail").css("border","1px solid #f00");
			return false;
		} else if ($("#txtmarcartelefone").val() == "" && $("#txtmarcarcelular").val() == "") {
			$(".error-label").html("Por favor, informe um telefone.");
			$(".error-label").show("slow");
			$("#txtmarcartelefone").css("border","1px solid #f00");
			$("#txtmarcarcelular").css("border","1px solid #f00");
			return false;
		} else if ($("#txtmarcardata").val() == "" || !(/^((0?[1-9]|[12]\d)\/(0?[1-9]|1[0-2])|30\/(0?[13-9]|1[0-2])|31\/(0?[13578]|1[02]))\/(19|20)?\d{2}$/.test($("#txtmarcardata").val()))) {
			$(".error-label").html("Por favor, informe uma data válida.");
			$(".error-label").show("slow");
			$("#txtmarcardata").css("border","1px solid #f00");
			return false;
		} else {
			return true;
		}
	});

	//Valida contato
	$("#frmContato").submit(function(){  
		if ($("#txtcontatonome").val() == "") {
			$(".error-label1").html("Por favor, informe seu nome.");
			$(".error-label1").show("slow");
			$("#txtcontatonome").css("border","1px solid #f00");
			return false;
		} else if (!(/^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,4}$/.test($("#txtcontatoemail").val()))) {
			$(".error-label1").html("Por favor, informe um e-mail válido.");
			$(".error-label1").show("slow");
			$("#txtcontatoemail").css("border","1px solid #f00");
			return false;
		} else if ($("#txtcontatotelefone").val() == "" && $("#txtcontatocelular").val() == "") {
			$(".error-label1").html("Por favor, informe um telefone.");
			$(".error-label1").show("slow");
			$("#txtcontatotelefone").css("border","1px solid #f00");
			$("#txtcontatocelular").css("border","1px solid #f00");
			return false;
		} else if ($("#txtcontatomensagem").val() == "") {
			$(".error-label1").html("Por favor, digite sua mensagem.");
			$(".error-label1").show("slow");
			$("#txtcontatomensagem").css("border","1px solid #f00");
			return false;
		} else {
			return true;
		}
	});

});