function valida_contacto(){
	
	if (document.getElementById('asunto').value.length==0){
		alert('Debe ingresar un asunto');
		document.getElementById('asunto').focus()
		return false; 
	} 
	if (document.getElementById('para').value=='---'){
		alert('Debe seleccionar con quien desee hacer el contacto');
		document.getElementById('para').focus()
		return false; 
	} 
	if (document.getElementById('contenido').value.length==0){
		alert('Debe ingresar el contenido del contacto');
		document.getElementById('contenido').focus()
		return false; 
	} 
	if (document.getElementById('nombres').value.length==0){
		alert('Debe ingresar su(s) nombre(s)');
		document.getElementById('nombres').focus()
		return false; 
	} 
	if (document.getElementById('apellidos').value.length==0){
		alert('Debe ingresar su(s) apellido(s)');
		document.getElementById('apellidos').focus()
		return false; 
	} 
	//if (document.getElementById('email').value.length==0){
	if (!validarEmail('email')){
		return false; 
	}
	
	//el formulario se envia
	document.getElementById('formcontacto').submit()
}
	
/*Ajax del combo estado*/
$(document).ready(function(){
	$("#estado").change(function(){
		valor = $(this).val();
		if(valor==0){
			$("#ciudad").html('<option value="" selected="selected">---</option>');
			$("#localidad").html('<option value="" selected="selected">---</option>');
		}else{
			$("#ciudad").html('<option selected="selected" value="">Cargando...</option>');
			$("#localidad").html('<option selected="selected" value="">Cargando...</option>');
			if(valor!=""){
				$.post("prg/cargarCombos.php",{
					combo:$(this).attr("id"),
					id:$(this).val(),
					destino:"ciudad"
				},function(data){
					$("#ciudad").html(data);
				})
			}
		}		
	})
});
