//
// Menú Desplegable
//
function menu_init(){
	document.getElementById("tblTecnicas").style.display = "none";
	document.getElementById("tblTerapias").style.display = "none";
	document.getElementById("tblTalleres").style.display = "none";
}
function desplegar(strTabla){
	document.getElementById(strTabla).style.display = "block";
	document.getElementById("img" + strTabla).src = "imagenes/signo_menos.gif";
	document.getElementById("href" + strTabla).href = "javascript:plegar('" + strTabla + "');";
}
function plegar(strTabla){
	document.getElementById(strTabla).style.display = "none";
	document.getElementById("img" + strTabla).src = "imagenes/signo_mas.gif";
	document.getElementById("href" + strTabla).href = "javascript:desplegar('" + strTabla + "');";
}


function menuOver(strID){
	document.getElementById("img" + strID).src = 'imagenes/flecha-on.gif';
	document.getElementById("fila" + strID + "a").style.backgroundImage = "url(imagenes/bg-opcion-resaltada.gif)";
	document.getElementById("fila" + strID + "b").style.backgroundImage = "url(imagenes/bg-opcion-resaltada.gif)";
}
function menuOut(strID){
	document.getElementById("img" + strID).src = 'imagenes/flecha-off.gif';	
	document.getElementById("fila" + strID + "a").style.backgroundImage = "url(imagenes/spacer.gif)";
	document.getElementById("fila" + strID + "b").style.backgroundImage = "url(imagenes/spacer.gif)";
}
function clearText(thefield) {
  if (thefield.defaultValue==thefield.value) { thefield.value = "" }
} 
function replaceText(thefield) {
  if (thefield.value=="") { thefield.value = thefield.defaultValue }
}
function Validar () {	

	if ((document.frmForm.txtNombre.value == "* nombre")||(document.frmForm.txtNombre.value == "")) {
	    alert("El campo Nombre es obligatorio.");
	   	document.frmForm.txtNombre.focus();
		return;
	}
	if ((document.frmForm.txtTelefono.value == "* teléfono")||(document.frmForm.txtTelefono.value == "")) {
	    alert("El campo Teléfono es obligatorio.");
	   	document.frmForm.txtTelefono.focus();
		return;
	}
	if ((document.frmForm.txtCorreo.value == "* correo electrónico")||(document.frmForm.txtCorreo.value == "")) {
	    alert("El campo Correo Electrónico es obligatorio.");
	   	document.frmForm.txtCorreo.focus();
		return;
	}
	correcto = esCorreo(document.frmForm.txtCorreo.value,"Correo electrónico")
	if (!correcto) {document.frmForm.txtCorreo.focus();return;}
	if ((document.frmForm.lstCentros.value == "* seleccione centro...")||(document.frmForm.lstCentros.value == "")) {
	    alert("El campo Centro es obligatorio.");
	   	document.frmForm.lstCentros.focus();
		return;
	}
	if ((document.frmForm.txaMensaje.value == "* mensaje")||(document.frmForm.txaMensaje.value == "")) {
	    alert("El campo Mensaje es obligatorio.");
	   	document.frmForm.txaMensaje.focus();
		return;
	}
	if (correcto) {
		enviar.innerHTML = "Espere mientras se envían sus datos al servidor...";
		document.frmForm.submit();
		}
}
