


function selectfield(mylayer) 
{
	if (document.myform.tipo_contacto.value == 0)
		{ hidediv('delegaciones_layer'); hidediv('cursos_layer'); return true; }
	else if (document.myform.tipo_contacto.value == 1)
		{ showdiv('delegaciones_layer'); hidediv('cursos_layer'); return true; }
	else if (document.myform.tipo_contacto.value == 2)
		{ showdiv('delegaciones_layer'); hidediv('cursos_layer'); return true; }
	else if (document.myform.tipo_contacto.value == 3)
		{ showdiv('cursos_layer'); hidediv('delegaciones_layer'); return true; }
}
 
function hidediv(mylayer) 
{ 
	if (document.getElementById) 
		{ document.getElementById(mylayer).style.visibility = 'hidden'; } // DOM3 = IE5, NS6 
	else 
		{ 
		if (document.layers) 
			{ document.mylayer.visibility = 'hidden'; } // Netscape 4 
		else 
			{ document.all.mylayer.style.visibility = 'hidden'; } // IE 4 
		} 
} 

function showdiv(mylayer) 
{ 
	if (document.getElementById) 
		{ document.getElementById(mylayer).style.visibility = 'visible'; } // DOM3 = IE5, NS6 
	else 
		{ 
		if (document.layers) 
			{ document.mylayer.visibility = 'visible'; } // Netscape 4
		else 
			{ document.all.mylayer.style.visibility = 'visible'; } // IE 4 
		} 
} 

function validate_contactar()
{
	if (document.myform.tipo_contacto.value == 0)
 	   {alert("Campo Obligatorio MOTIVO"); document.myform.tipo_contacto.focus(); return false;}
		
	if (document.myform.tipo_contacto.value == 1 && document.myform.delegaciones.value == 0)
 	   {alert("Debe elegir una DELEGACION"); document.myform.delegaciones.focus(); return false;}
	   
	if (document.myform.tipo_contacto.value == 2 && document.myform.delegaciones.value == 0)
 	   {alert("Debe elegir una DELEGACION"); document.myform.delegaciones.focus(); return false;}
	   
	if (document.myform.tipo_contacto.value == 3 && document.myform.cursos.value == 0)
 	   {alert("Campo Obligatorio CATALOGO DE CURSOS"); document.myform.cursos.focus(); return false;}	   
	
	if (document.myform.nombre_contacto.value == "")
 	   {alert("Campo Obligatorio NOMBRE"); document.myform.nombre_contacto.focus(); return false;}
	
	if (document.myform.apellidos_contacto.value == "")
 	   {alert("Campo Obligatorio APELLIDOS"); document.myform.apellidos_contacto.focus(); return false;}	     

	if (document.myform.telefono_contacto.value == "")
 	   {alert("Campo Obligatorio TELEFONO"); document.myform.telefono_contacto.focus(); return false;}
	   
	if (document.myform.direccion_contacto.value == "")
 	   {alert("Campo Obligatorio DIRECCION"); document.myform.direccion_contacto.focus(); return false;}
	   
	if (document.myform.poblacion_contacto.value == "")
 	   {alert("Campo Obligatorio POBLACION"); document.myform.poblacion_contacto.focus(); return false;}
	   
	if (document.myform.provincia_contacto.value == 0)
 	   {alert("Campo Obligatorio PROVINCIA"); document.myform.provincia_contacto.focus(); return false;}
	   
	if (document.myform.cp_contacto.value == "")
 	   {alert("Campo Obligatorio CODIGO POSTAL"); document.myform.cp_contacto.focus(); return false;}
	   
	if (document.myform.comentarios_contacto.value == "")
 	   {alert("Campo Obligatorio COMENTARIOS"); document.myform.comentarios_contacto.focus(); return false;}	   
	   
}

