// JavaScript Document
function alerta(m){
	document.getElementById('errorm').innerHTML = m;
}

function camposLlenos(campo) {
	if(campo.value == campo.name){
		campo.value = "";
	}
}

function vaciarCampos(campo) {
	if(campo.value == ""){
		campo.value = campo.name;
	}	
}

function validar(theForm){	
		
	if(theForm.area.selectedIndex==0)//theForm.area.options[theForm.area.selectedIndex].text == 'Seleccione el Área'
	{		
		alerta("Debe elegir una opci&oacute;n");
		theForm.area.focus();
		return (false);
	}		
	
	if( (theForm.nombre.value == "") || (theForm.nombre.value == 'nombre') )	
	{
		alerta("Debe ingresar su nombre completo.");
		theForm.nombre.focus();
		return (false);
	}	
	
	if((theForm.email.value == "") || (theForm.email.value == 'email') )
	{		
		alerta("Debe ingresar su email.");
		theForm.email.focus();
		return (false);
	}	
	
	if(theForm.mensaje.value == "" || (theForm.mensaje.value == 'mensaje'))
	{
		alerta("Debe ingresar un mensaje.");
		theForm.mensaje.focus();
		return (false);
	}	
	
	/*alerta("Su mensaje fue enviado exitosamente");
	document.form1.submit();*/
}
