function OAS_AD(pos) {
	if (OAS_version >= 11 && typeof(OAS_RICH)!='undefined')
		OAS_RICH(pos);
	else
		OAS_NORMAL(pos);
}

function OAS_NORMAL(pos) { 
	document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" TARGET=_top>');
	document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" BORDER=0 ALT="Click!"></A>');
}

function Start(varPosition, varQuery) { 
	//OAS_url ='http://publ.planetaads.com/RealMedia/ads/';
	OAS_url ='http://oase00094.247realmedia.com/';
	OAS_listpos = varPosition;
	OAS_query = '?';
	//OAS_sitepage = 'muchoviaje.com/vuelos/portada';
	OAS_sitepage = varQuery;
	OAS_version = 10;
	OAS_rn = '001234567890'; OAS_rns = '1234567890';
	OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);
	OAS_version = 11;

	if (navigator.userAgent.indexOf('Mozilla/3') != -1)
		OAS_version = 10;
	if (OAS_version >= 11)
		document.write('<SC'+'RIPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + OAS_query + '"><\/SCRIPT>');
}

/*
Funciones JScript en Cliente
*/

function abreVentana(mipage,mititulo,ancho,alto)
{

	aWindow= window.open(mipage,mititulo,'titlebar=no,scrollbars=yes,toolbar=no,status=no,resizable=no,width=' + ancho + ',height=' + alto);
	aWindow.focus()
	
}

function abreventana(mipage,mititulo,ancho,alto)
{aWindow= open(mipage,mititulo,'scrollbars=no,toolbar=no,status=no,resizable=no,width=' + ancho + ',height=' + alto);
}
function abreventanadebug(mipage,mititulo,ancho,alto)
{aWindow= open(mipage,mititulo,'scrollbars=yes,toolbar=yes,status=yes,resizable=yes,width=' + ancho + ',height=' + alto);
}

function abreventanascroll(mipage,mititulo,ancho,alto)
{
miresize="no"
if (navigator.appName == "Netscape"){
miresize="yes"}
aWindow= open(mipage,mititulo,'scrollbars=yes,toolbar=no,status=no,resizable=' + miresize + ',width=' + ancho + ',height=' + alto);
}

function verAvisoLegal()
{
	//Abre la ventana del aviso legal
	var nAlturaVentana
	var nAnchuraVentana
	var nPosicionIzquierda
	var nPosicionArriba
	
	nAnchuraVentana = 366
	nAlturaVentana = 470
		
	nPosicionIzquierda = (screen.width) ? (screen.width - nAnchuraVentana)/2 : 0
	nPosicionArriba = (screen.height) ? (screen.height - nAlturaVentana)/2 : 0

	ventanaAvisoLegal = window.open("/hoteles/newsletter/condiciones/default.htm","vAvisoLegal","height=" + nAlturaVentana + ",width=" + nAnchuraVentana + ",left=" + nPosicionIzquierda + ",top=" + nPosicionArriba + ",directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no")
}
function comprueba_mail(dir)
{	
	var car='';
	var encon='no';
	var longi=dir.length;
	e=0;
	for (i=0;i<longi;i++)
	{
		car=dir.charAt(i);
		if (car=='@')
		{
			encon='si';
			posarroba=i;
		} 
    } 
	if (encon=='no')	
	{
		e=1;
	}  
	else
	{
		//existe la arroba, se comprueba que haya algo antes
   
		if (posarroba==0)
		{
			e=1;
		}
		else
		{
			//existe la arroba y no esta en la primera posicion
			//se comprueba que despues de la arroba hay algo
    
		    if (posarroba==dir.length - 1)
			{
				e=1;
			}
			else
			{	//existe la arroba y no esta en la primera posicion
				// y despues hay algo, se comprueba que no sea un punto    
				car=dir.charAt(posarroba+1)
				if (car=='.')
				{
					e=1;
				}
				else
				{
					//existe la arroba y no esta en la primera posicion
					// y despues hay algo distinto de punto
					//se comprueba que lo ultimo no sea un punto
      
					car=dir.charAt(dir.length - 1);
					if (car=='.')
					{
						e=1;
					} 
					else
					{
					 //finalmente se comprueba que haya un punto despues de la arroba
					 var ar2='';
					 encon2='no'
					 for(k=posarroba;k<dir.length;k++)
					 { 
					  car2=dir.charAt(k);
					  if (car2=='.')
					   {
					     encon2='si';
					   }  
					 }
					 
					 if (encon2=='no')
					  {
						e=1;
					  } 
					}
          
				}  	
    
			} 
	
		}	
	 
	}
	
	
	
	return e;
}

function abrePublicidad()

{            //Abre la ventana de publicidad 
            var nAlturaVentana
            var nAnchuraVentana
            var nPosicionIzquierda
            var nPosicionArriba  
            nAnchuraVentana = 343
            nAlturaVentana = 596    
            nPosicionIzquierda = (screen.width) ? (screen.width - nAnchuraVentana)/2 : 0
            nPosicionArriba = (screen.height) ? (screen.height - nAlturaVentana)/2 : 0
           ventanaAyuda = window.open("http://www.mediabit.com/mb/atCliente.aspx?webMb=MV","vVentas","height=" + nAlturaVentana + ",width=" + nAnchuraVentana + ",left=" + nPosicionIzquierda + ",top=" + nPosicionArriba + ",directories=no,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,toolbar=no")
}

function abreventana2(mipage,mititulo,ancho,alto)

{aWindow= open(mipage,mititulo,'scrollbars=no,toolbar=no,status=no,resizable=no,width=' + ancho + ',height=' + alto);

}

function abreventanatop(mipage,mititulo,ancho,alto)
{aWindow= open(mipage,mititulo,'scrollbars=no,toolbar=no,status=no,resizable=no,width=' + ancho + ',height=' + alto + ',top=0,left=0');

} 

function comprueba_telefono(tt)
{
	contar=0;
	err=0;
	for(i=0;i<tt.length;i++)
	{
		if (tt.substr(i,1)==" ")
		{
			contar=contar+1;
		}
	}
	if (contar==tt.length)
	{
		err=1;
	}	
	else
	{
		if (tt.length<9)
		{
			err=2;
		}
		else
		{
			if (isNaN(tt))
			{
				err=3;
				
			}
			else
			{
				if (tt.length>9)
				{
					if ((tt.charAt(0)!="0" && tt.charAt(1)!="0") || (tt.charAt(0)!="0" && tt.charAt(1)!="7"))
					{
						err=4;
					}
				}
			}
		}	
	}	
return err;
}

function comprueba_mail(dir)
{	
	var car='';
	var encon='no';
	var longi=dir.length;
	e=0;
	for (i=0;i<longi;i++)
	{
		car=dir.charAt(i);
		if (car=='@')
		{
			encon='si';
			posarroba=i;
		} 
    } 

	if (encon=='no')	
	{
		e=1;
	}  
	else
	{
		//existe la arroba, se comprueba que haya algo antes
   
		if (posarroba==0)
		{
			e=1;
		}
		else
		{
			//existe la arroba y no esta en la primera posicion
			//se comprueba que despues de la arroba hay algo
    
		    if (posarroba==dir.length - 1)
			{
				e=1;
			}
			else
			{	//existe la arroba y no esta en la primera posicion
				// y despues hay algo, se comprueba que no sea un punto    
				car=dir.charAt(posarroba+1)
				if (car=='.')
				{
					e=1;
				}
				else
				{
					//existe la arroba y no esta en la primera posicion
					// y despues hay algo distinto de punto
					//se comprueba que lo ultimo no sea un punto
      
					car=dir.charAt(dir.length - 1);
					if (car=='.')
					{
						e=1;
					} 
					else
					{
					 //finalmente se comprueba que haya un punto despues de la arroba
					 var ar2='';
					 encon2='no'
					 for(k=posarroba;k<dir.length;k++)
					 { 
					  car2=dir.charAt(k);
					  if (car2=='.')
					   {
					     encon2='si';
					   }  
					 }
					 
					 if (encon2=='no')
					  {
						e=1;
					  } 
					}
          
				}  	
    
			} 
	
		}	
	 
	}
	
	return e;
}

function MostrarEsperaBusqueda() {

	var hasParent = parent.iBuscador != undefined;

	if (hasParent) {
		window.parent.mostrarEspera();
	} else {
		if (document.getElementById("EsperaFlash")) {
			document.getElementById("Espera").style.display="block";
			document.getElementById("EsperaFlash").style.display="block";		
			document.getElementById("Espera").style.height = document.body.scrollHeight + "px";
			document.getElementById("EsperaFlash").style.height = document.body.scrollHeight + "px";
		} else if (document.getElementById("global")) {
			document.getElementById("global").style.display = "none";
			document.getElementById("Espera").style.visibility="visible";
			document.getElementById("Espera").focus();
			document.getElementById("Contenido").style.visibility="hidden";		
		} else if (document.getElementById("Contenido")) {
			document.getElementById("Contenido").style.display = "none";
			document.getElementById("Espera").style.visibility="visible";
			document.getElementById("Espera").focus();
		}
	}
	
	//$("#EsperaFlash").slideDown("slow")
	//$("#Espera").slideDown("slow");
	//$("#EsperaFlash").slideDown("slow");
		
	//return false;
}

function MostrarEsperaReserva() {

	if (document.getElementById("EsperaFlash")) {
		document.getElementById("Espera").style.display="block";
		document.getElementById("EsperaFlash").style.display="block";
		document.getElementById("Espera").style.height = document.body.scrollHeight + "px";
		document.getElementById("EsperaFlash").style.height = document.body.scrollHeight + "px";
		document.getElementById("Espera").style.width = document.body.scrollWidth + "px";
		document.getElementById("EsperaFlash").style.width = document.body.scrollWidth + "px";
	} else if (document.getElementById("global")) {
		document.getElementById("global").style.display = "none";
		document.getElementById("Espera").style.visibility="visible";
		document.getElementById("Espera").focus();
		document.getElementById("Contenido").style.visibility="hidden";		
	} else if (document.getElementById("Contenido")) {
		document.getElementById("Contenido").style.display = "none";
		document.getElementById("Espera").style.visibility="visible";
		document.getElementById("Espera").focus();
	}
	
	//$("#EsperaFlash").slideDown("slow")
	//$("#Espera").slideDown("slow");
	//$("#EsperaFlash").slideDown("slow");
		
	//return false;
	ocultarCombos();
}

function ocultarCombos () {
	var frms = document.getElementsByTagName("form"); 
	for (var i=0; i< frms.length; i++) { 
		var sels = frms[i].getElementsByTagName("select");
		for (var j=0; j<sels.length; j++) {
			sels[j].style.visibility = 'hidden';
		}//for j
	}//for i
}//ocultarCombos

function ValidarMesTarjeta(mes)
{ 
	if (mes == "00"){ 
		return (false);
		}
	else{
		return (true);
		}
	
}

function ValidarAnioTarjeta(anio)
{
	if (anio == "00"){ 
		return (false);
		}
	else{
		return (true);
		}
}

function ValidarTipoTarjeta(e)
{
if (e.Value == "")
		e.IsValid = false
	else
		e.IsValid = true
}

function validar()
{
	if (document.getElementById("txtNombreCliente").value.length == 0) {
		alert("Escriba su nombre y apellidos.");
		document.getElementById("txtNombreCliente").focus();
		return (false);}
		
	if (document.getElementById("txtEmailCliente").value.length == 0) {
		alert("Escriba su email.");
		document.getElementById("txtEmailCliente").focus();
		return (false);}
		
	if (comprueba_mail(document.getElementById("txtEmailCliente").value) == 1){
		alert("Escriba un email correcto.");
		document.getElementById("txtEmailCliente").focus();
		return (false);}
		
	if (document.getElementById("txtNifCliente").value.length < 9) {
		alert("Escriba su Nif correctamente, 9 caracteres sin espacios.");
		document.getElementById("txtNifCliente").focus();
		return (false);}
		
	if (document.getElementById("txtNifCliente").value.length > 9) {
		alert("Escriba su Nif correctamente, 9 caracteres sin espacios.");
		document.getElementById("txtNifCliente").focus();
		return (false);}
//
	if (document.getElementById("txtTelefonoCliente").value.length == 0) {
		alert("Escriba su telefono.");
		document.getElementById("txtTelefonoCliente").focus();
		return (false);}
	if (comprueba_telefono(document.getElementById("txtTelefonoCliente").value)!= 0) {
		alert("Escriba su telefono correctamente.");
		document.getElementById("txtTelefonoCliente").focus();
		return (false);}
//
		
	if (document.getElementById("cbTipoTarjeta").value.length == 0) {
		alert("Seleccione el tipo de tarjeta de credito.");
		document.getElementById("cbTipoTarjeta").focus();
		return (false);}
		
	if (document.getElementById("txtNumTarjeta").value.length == 0) {
		alert("Introduzca el numero de tarjeta de credito.");
		document.getElementById("txtNumTarjeta").focus();
		return (false);}

	if (ValidarMesTarjeta(document.getElementById("cbMesTarjeta").value) == false){
		alert("Seleccione el mes de caducidad de la tarjeta de credito.");
		document.getElementById("cbMesTarjeta").focus();
		return (false);}

	if (ValidarAnioTarjeta(document.getElementById("cbAnioTarjeta").value) == false){
		alert("Seleccione el ano de caducidad de la tarjeta de credito.");
		document.getElementById("cbAnioTarjeta").focus();
		return (false);}
		
	if (document.getElementById("txtNombreTarjeta").value.length == 0) {
		alert("Escriba el nombre del titular de la tarjeta.");
		document.getElementById("txtNombreTarjeta").focus();
		return (false);}
	
	//if (document.getElementById("txtObservaciones").value.length > 250) {
	//	alert("El campo observaciones solo permite 250 caracteres.");
	//	document.getElementById("txtObservaciones").focus();
	//	return (false);}
		//txtTelefonoCliente'txtTelefonoCliente
	MostrarEsperaReserva()

}

function cambio_habitaciones(){

document.getElementById('lblEdadNinio1').style.display="none";
	document.getElementById('cbEdadNinio11').style.display="none";
	document.getElementById('cbEdadNinio12').style.display="none";
	document.getElementById('cbEdadNinio13').style.display="none";
	
	document.getElementById('cbEdadNinio21').style.display="none";
	document.getElementById('cbEdadNinio22').style.display="none";
	document.getElementById('cbEdadNinio23').style.display="none";

	document.getElementById('cbEdadNinio31').style.display="none";
	document.getElementById('cbEdadNinio32').style.display="none";
	document.getElementById('cbEdadNinio33').style.display="none";
	
	document.getElementById('cbEdadNinio41').style.display="none";
	document.getElementById('cbEdadNinio42').style.display="none";
	document.getElementById('cbEdadNinio43').style.display="none";
	pon_edades1();
			pon_edades2();
			pon_edades3();
			pon_edades4();	
	
	if (document.getElementById('cb_habitaciones')!=null)
			{
			
	document.getElementById('cb_ocupacion2').style.display="none";
	document.getElementById('cb_ocupacion3').style.display="none";
	document.getElementById('cb_ocupacion4').style.display="none";
	if (document.getElementById('cb_habitaciones').value=="1")
		{
		
		document.getElementById('cbEdadNinio21').style.display="none";
		document.getElementById('cbEdadNinio22').style.display="none";
		document.getElementById('cbEdadNinio23').style.display="none";
		
		document.getElementById('cbEdadNinio31').style.display="none";
		document.getElementById('cbEdadNinio32').style.display="none";
		document.getElementById('cbEdadNinio33').style.display="none";
		
		document.getElementById('cbEdadNinio41').style.display="none";
		document.getElementById('cbEdadNinio42').style.display="none";
		document.getElementById('cbEdadNinio43').style.display="none";
			}
	if (document.getElementById('cb_habitaciones').value=="2")
	{
		document.getElementById('cb_ocupacion2').style.display="inline";
		
		document.getElementById('cbEdadNinio31').style.display="none";
		document.getElementById('cbEdadNinio32').style.display="none";
		document.getElementById('cbEdadNinio33').style.display="none";
		
		document.getElementById('cbEdadNinio41').style.display="none";
		document.getElementById('cbEdadNinio42').style.display="none";
		document.getElementById('cbEdadNinio43').style.display="none";
		
	}
	if  (document.getElementById('cb_habitaciones').value=="3"){
		document.getElementById('cb_ocupacion2').style.display="inline";
		document.getElementById('cb_ocupacion3').style.display="inline";
		
		document.getElementById('cbEdadNinio41').style.display="none";
		document.getElementById('cbEdadNinio42').style.display="none";
		document.getElementById('cbEdadNinio43').style.display="none";
		}
	if  (document.getElementById('cb_habitaciones').value=="4"){
		document.getElementById('cb_ocupacion2').style.display="inline";
		document.getElementById('cb_ocupacion3').style.display="inline";
		document.getElementById('cb_ocupacion4').style.display="inline";
		}
	}
	
		
	
	
	}
	
	
	function pon_edades1()
	{
	if (document.getElementById('cb_ocupacion').value=="1" ||  document.getElementById('cb_ocupacion').value=="2" || document.getElementById('cb_ocupacion').value=="3" || document.getElementById('cb_ocupacion').value=="4")
	{
	document.getElementById('lblEdadNinio1').style.display="none";
	document.getElementById('cbEdadNinio11').style.display="none";
	document.getElementById('cbEdadNinio12').style.display="none";
	document.getElementById('cbEdadNinio13').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion').value=="1-1" ||  document.getElementById('cb_ocupacion').value=="2-1" || document.getElementById('cb_ocupacion').value=="3-1")
		{
		document.getElementById('lblEdadNinio1').style.display="inline";
			document.getElementById('cbEdadNinio11').style.display="inline";
			document.getElementById('cbEdadNinio12').style.display="none";
			document.getElementById('cbEdadNinio13').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion').value=="1-2" ||  document.getElementById('cb_ocupacion').value=="2-2")
			{
			document.getElementById('lblEdadNinio1').style.display="inline";
			document.getElementById('cbEdadNinio11').style.display="inline";
			document.getElementById('cbEdadNinio12').style.display="inline";
			document.getElementById('cbEdadNinio13').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion').value=="1-3")
					{
					document.getElementById('lblEdadNinio1').style.display="inline";
					document.getElementById('cbEdadNinio11').style.display="inline";
					document.getElementById('cbEdadNinio12').style.display="inline";
					document.getElementById('cbEdadNinio13').style.display="inline";
					} 
			  }
		}
	}
	}
	
	
	
	function pon_edades2()
	{
	if (document.getElementById('cb_ocupacion2').value=="1" ||  document.getElementById('cb_ocupacion2').value=="2" || document.getElementById('cb_ocupacion2').value=="3" || document.getElementById('cb_ocupacion2').value=="4")
	{
	
	document.getElementById('cbEdadNinio21').style.display="none";
	document.getElementById('cbEdadNinio22').style.display="none";
	document.getElementById('cbEdadNinio23').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion2').value=="1-1" ||  document.getElementById('cb_ocupacion2').value=="2-1" || document.getElementById('cb_ocupacion2').value=="3-1")
		{
		
			document.getElementById('cbEdadNinio21').style.display="inline";
			document.getElementById('cbEdadNinio22').style.display="none";
			document.getElementById('cbEdadNinio23').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion2').value=="1-2" ||  document.getElementById('cb_ocupacion2').value=="2-2")
			{
			
			document.getElementById('cbEdadNinio21').style.display="inline";
			document.getElementById('cbEdadNinio22').style.display="inline";
			document.getElementById('cbEdadNinio23').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion2').value=="1-3")
					{
					
					document.getElementById('cbEdadNinio21').style.display="inline";
					document.getElementById('cbEdadNinio22').style.display="inline";
					document.getElementById('cbEdadNinio23').style.display="inline";
					} 
			  }
		}
	}
	}
	
		function pon_edades3()
	{
	if (document.getElementById('cb_ocupacion3').value=="1" ||  document.getElementById('cb_ocupacion3').value=="2" || document.getElementById('cb_ocupacion3').value=="3" || document.getElementById('cb_ocupacion3').value=="4")
	{
	
	document.getElementById('cbEdadNinio31').style.display="none";
	document.getElementById('cbEdadNinio32').style.display="none";
	document.getElementById('cbEdadNinio33').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion3').value=="1-1" ||  document.getElementById('cb_ocupacion3').value=="2-1" || document.getElementById('cb_ocupacion3').value=="3-1")
		{
	
			document.getElementById('cbEdadNinio31').style.display="inline";
			document.getElementById('cbEdadNinio32').style.display="none";
			document.getElementById('cbEdadNinio33').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion3').value=="1-2" ||  document.getElementById('cb_ocupacion3').value=="2-2")
			{
			
			document.getElementById('cbEdadNinio31').style.display="inline";
			document.getElementById('cbEdadNinio32').style.display="inline";
			document.getElementById('cbEdadNinio33').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion3').value=="1-3")
					{
					
					document.getElementById('cbEdadNinio31').style.display="inline";
					document.getElementById('cbEdadNinio32').style.display="inline";
					document.getElementById('cbEdadNinio33').style.display="inline";
					} 
			  }
		}
	}
	}
	
	
		function pon_edades4()
	{
	if (document.getElementById('cb_ocupacion4').value=="1" ||  document.getElementById('cb_ocupacion4').value=="2" || document.getElementById('cb_ocupacion4').value=="3" || document.getElementById('cb_ocupacion4').value=="4")
	{
	
	document.getElementById('cbEdadNinio41').style.display="none";
	document.getElementById('cbEdadNinio42').style.display="none";
	document.getElementById('cbEdadNinio43').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion4').value=="1-1" ||  document.getElementById('cb_ocupacion4').value=="2-1" || document.getElementById('cb_ocupacion4').value=="3-1")
		{
		
			document.getElementById('cbEdadNinio41').style.display="inline";
			document.getElementById('cbEdadNinio42').style.display="none";
			document.getElementById('cbEdadNinio43').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion4').value=="1-2" ||  document.getElementById('cb_ocupacion4').value=="2-2")
			{
		
			document.getElementById('cbEdadNinio41').style.display="inline";
			document.getElementById('cbEdadNinio42').style.display="inline";
			document.getElementById('cbEdadNinio43').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion4').value=="1-3")
					{
				
					document.getElementById('cbEdadNinio41').style.display="inline";
					document.getElementById('cbEdadNinio42').style.display="inline";
					document.getElementById('cbEdadNinio43').style.display="inline";
					} 
			  }
		}
	}
	}
	
	
	function pon_edades_ninos_1()
	{
	if (document.getElementById('_ctl0_drop_ocupacion').value=="1" ||  document.getElementById('_ctl0_drop_ocupacion').value=="2" || document.getElementById('_ctl0_drop_ocupacion').value=="3" || document.getElementById('_ctl0_drop_ocupacion').value=="4")
	{
	if (document.getElementById('_ctl0_lblEdadNinio1')!=null)
		document.getElementById('_ctl0_lblEdadNinio1').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio11')!=null)
		document.getElementById('_ctl0_cbEdadNinio11').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio12')!=null)
		document.getElementById('_ctl0_cbEdadNinio12').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio13')!=null)
		document.getElementById('_ctl0_cbEdadNinio13').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl0_drop_ocupacion').value=="1-1" ||  document.getElementById('_ctl0_drop_ocupacion').value=="2-1" || document.getElementById('_ctl0_drop_ocupacion').value=="3-1")
		{
		if (document.getElementById('_ctl0_lblEdadNinio1')!=null)
			document.getElementById('_ctl0_lblEdadNinio1').style.display="inline";
		if (document.getElementById('_ctl0_cbEdadNinio11')!=null)
			document.getElementById('_ctl0_cbEdadNinio11').style.display="inline";
		if (document.getElementById('_ctl0_cbEdadNinio12')!=null)
			document.getElementById('_ctl0_cbEdadNinio12').style.display="none";
		if (document.getElementById('_ctl0_cbEdadNinio13')!=null)
			document.getElementById('_ctl0_cbEdadNinio13').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl0_drop_ocupacion').value=="1-2" ||  document.getElementById('_ctl0_drop_ocupacion').value=="2-2")
			{
			if (document.getElementById('_ctl0_lblEdadNinio1')!=null)
				document.getElementById('_ctl0_lblEdadNinio1').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio11')!=null)
				document.getElementById('_ctl0_cbEdadNinio11').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio12')!=null)
				document.getElementById('_ctl0_cbEdadNinio12').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio13')!=null)
				document.getElementById('_ctl0_cbEdadNinio13').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl0_drop_ocupacion').value=="1-3")
					{
					if (document.getElementById('_ctl0_lblEdadNinio1')!=null)
						document.getElementById('_ctl0_lblEdadNinio1').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio11')!=null)
						document.getElementById('_ctl0_cbEdadNinio11').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio12')!=null)
						document.getElementById('_ctl0_cbEdadNinio12').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio13')!=null)
						document.getElementById('_ctl0_cbEdadNinio13').style.display="inline";
					} 
			  }
		}
	}
	
	}
	     
	function pon_edades_ninosDest_1()
	{
	if (document.getElementById('_ctl4_drop_ocupacion').value=="1" ||  document.getElementById('_ctl4_drop_ocupacion').value=="2" || document.getElementById('_ctl4_drop_ocupacion').value=="3" || document.getElementById('_ctl4_drop_ocupacion').value=="4")
	{
	document.getElementById('_ctl4_lblEdadNinio1').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio11').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio12').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio13').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl4_drop_ocupacion').value=="1-1" ||  document.getElementById('_ctl4_drop_ocupacion').value=="2-1" || document.getElementById('_ctl4_drop_ocupacion').value=="3-1")
		{
			document.getElementById('_ctl4_lblEdadNinio1').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio11').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio12').style.display="none";
			document.getElementById('_ctl4_cbEdadNinio13').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl4_drop_ocupacion').value=="1-2" ||  document.getElementById('_ctl4_drop_ocupacion').value=="2-2")
			{
			document.getElementById('_ctl4_lblEdadNinio1').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio11').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio12').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio13').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl4_drop_ocupacion').value=="1-3")
					{
					document.getElementById('_ctl4_lblEdadNinio1').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio11').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio12').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio13').style.display="inline";
					} 
			  }
		}
	}
	
	}	
	
	function pon_edades_ninos_2()
	{
		
	
	if (document.getElementById('_ctl0_drop_ocupacion2').value=="1" ||  document.getElementById('_ctl0_drop_ocupacion2').value=="2" || document.getElementById('_ctl0_drop_ocupacion2').value=="3" || document.getElementById('_ctl0_drop_ocupacion2').value=="4")
	{
	if (document.getElementById('_ctl0_cbEdadNinio21')!=null)
		document.getElementById('_ctl0_cbEdadNinio21').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio22')!=null)
		document.getElementById('_ctl0_cbEdadNinio22').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio23')!=null)
		document.getElementById('_ctl0_cbEdadNinio23').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl0_drop_ocupacion2').value=="1-1" ||  document.getElementById('_ctl0_drop_ocupacion2').value=="2-1" || document.getElementById('_ctl0_drop_ocupacion2').value=="3-1")
		{
			if (document.getElementById('_ctl0_cbEdadNinio21')!=null)
				document.getElementById('_ctl0_cbEdadNinio21').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio22')!=null)
				document.getElementById('_ctl0_cbEdadNinio22').style.display="none";
			if (document.getElementById('_ctl0_cbEdadNinio23')!=null)
				document.getElementById('_ctl0_cbEdadNinio23').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl0_drop_ocupacion2').value=="1-2" ||  document.getElementById('_ctl0_drop_ocupacion2').value=="2-2")
			{
			if (document.getElementById('_ctl0_cbEdadNinio21')!=null)
				document.getElementById('_ctl0_cbEdadNinio21').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio22')!=null)
				document.getElementById('_ctl0_cbEdadNinio22').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio23')!=null)
				document.getElementById('_ctl0_cbEdadNinio23').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl0_drop_ocupacion2').value=="1-3")
					{
					if (document.getElementById('_ctl0_cbEdadNinio21')!=null)
						document.getElementById('_ctl0_cbEdadNinio21').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio22')!=null)
						document.getElementById('_ctl0_cbEdadNinio22').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio23')!=null)
						document.getElementById('_ctl0_cbEdadNinio23').style.display="inline";
					} 
			  }
		}
	}
	
	}
	
	function pon_edades_ninosDest_2()
	{
	if (document.getElementById('_ctl4_drop_ocupacion2').value=="1" ||  document.getElementById('_ctl4_drop_ocupacion2').value=="2" || document.getElementById('_ctl4_drop_ocupacion2').value=="3" || document.getElementById('_ctl4_drop_ocupacion2').value=="4")
	{
	document.getElementById('_ctl4_cbEdadNinio21').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio22').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio23').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl4_drop_ocupacion2').value=="1-1" ||  document.getElementById('_ctl4_drop_ocupacion2').value=="2-1" || document.getElementById('_ctl4_drop_ocupacion2').value=="3-1")
		{
			document.getElementById('_ctl4_cbEdadNinio21').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio22').style.display="none";
			document.getElementById('_ctl4_cbEdadNinio23').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl4_drop_ocupacion2').value=="1-2" ||  document.getElementById('_ctl4_drop_ocupacion2').value=="2-2")
			{
			document.getElementById('_ctl4_cbEdadNinio21').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio22').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio23').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl4_drop_ocupacion2').value=="1-3")
					{
					document.getElementById('_ctl4_cbEdadNinio21').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio22').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio23').style.display="inline";
					} 
			  }
		}
	}
	
	}
	
	
	function pon_edades_ninos_3()
	{
		
	
	if (document.getElementById('_ctl0_drop_ocupacion3').value=="1" ||  document.getElementById('_ctl0_drop_ocupacion3').value=="2" || document.getElementById('_ctl0_drop_ocupacion3').value=="3" || document.getElementById('_ctl0_drop_ocupacion3').value=="4")
	{
	if (document.getElementById('_ctl0_cbEdadNinio31')!=null)
		document.getElementById('_ctl0_cbEdadNinio31').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio32')!=null)
		document.getElementById('_ctl0_cbEdadNinio32').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio33')!=null)
		document.getElementById('_ctl0_cbEdadNinio33').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl0_drop_ocupacion3').value=="1-1" ||  document.getElementById('_ctl0_drop_ocupacion3').value=="2-1" || document.getElementById('_ctl0_drop_ocupacion3').value=="3-1")
		{
			if (document.getElementById('_ctl0_cbEdadNinio31')!=null)
				document.getElementById('_ctl0_cbEdadNinio31').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio32')!=null)
				document.getElementById('_ctl0_cbEdadNinio32').style.display="none";
			if (document.getElementById('_ctl0_cbEdadNinio33')!=null)
				document.getElementById('_ctl0_cbEdadNinio33').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl0_drop_ocupacion3').value=="1-2" ||  document.getElementById('_ctl0_drop_ocupacion3').value=="2-2")
			{
			if (document.getElementById('_ctl0_cbEdadNinio31')!=null)
				document.getElementById('_ctl0_cbEdadNinio31').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio32')!=null)
				document.getElementById('_ctl0_cbEdadNinio32').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio33')!=null)
				document.getElementById('_ctl0_cbEdadNinio33').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl0_drop_ocupacion3').value=="1-3")
					{
					if (document.getElementById('_ctl0_cbEdadNinio31')!=null)
						document.getElementById('_ctl0_cbEdadNinio31').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio32')!=null)
						document.getElementById('_ctl0_cbEdadNinio32').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio33')!=null)
						document.getElementById('_ctl0_cbEdadNinio33').style.display="inline";
					} 
			  }
		}
	}
	
	}
	

	function pon_edades_ninosDest_3()
	{
	
	if (document.getElementById('_ctl4_drop_ocupacion3').value=="1" ||  document.getElementById('_ctl4_drop_ocupacion3').value=="2" || document.getElementById('_ctl4_drop_ocupacion3').value=="3" || document.getElementById('_ctl4_drop_ocupacion3').value=="4")
	{
	document.getElementById('_ctl4_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl4_drop_ocupacion3').value=="1-1" ||  document.getElementById('_ctl4_drop_ocupacion3').value=="2-1" || document.getElementById('_ctl4_drop_ocupacion3').value=="3-1")
		{
			document.getElementById('_ctl4_cbEdadNinio31').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio32').style.display="none";
			document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl4_drop_ocupacion3').value=="1-2" ||  document.getElementById('_ctl4_drop_ocupacion3').value=="2-2")
			{
			document.getElementById('_ctl4_cbEdadNinio31').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio32').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl4_drop_ocupacion3').value=="1-3")
					{
					document.getElementById('_ctl4_cbEdadNinio31').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio32').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio33').style.display="inline";
					} 
			  }
		}
	}
	}	
	
	function pon_edades_ninos_4()
	{
	if (document.getElementById('_ctl0_drop_ocupacion4').value=="1" ||  document.getElementById('_ctl0_drop_ocupacion4').value=="2" || document.getElementById('_ctl0_drop_ocupacion4').value=="3" || document.getElementById('_ctl0_drop_ocupacion4').value=="4")
	{
	if (document.getElementById('_ctl0_lblEdadNinio4')!=null)
		document.getElementById('_ctl0_lblEdadNinio4').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio41')!=null)
		document.getElementById('_ctl0_cbEdadNinio41').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio42')!=null)
		document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio43')!=null)
		document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl0_drop_ocupacion4').value=="1-1" ||  document.getElementById('_ctl0_drop_ocupacion4').value=="2-1" || document.getElementById('_ctl0_drop_ocupacion4').value=="3-1")
		{
			if (document.getElementById('_ctl0_lblEdadNinio4')!=null)
				document.getElementById('_ctl0_lblEdadNinio4').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio41')!=null)
				document.getElementById('_ctl0_cbEdadNinio41').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio42')!=null)
				document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
			if (document.getElementById('_ctl0_cbEdadNinio43')!=null)
				document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl0_drop_ocupacion4').value=="1-2" ||  document.getElementById('_ctl0_drop_ocupacion4').value=="2-2")
			{
			if (document.getElementById('_ctl0_lblEdadNinio4')!=null)
				document.getElementById('_ctl0_lblEdadNinio4').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio41')!=null)
				document.getElementById('_ctl0_cbEdadNinio41').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio42')!=null)
				document.getElementById('_ctl0_cbEdadNinio42').style.display="inline";
			if (document.getElementById('_ctl0_cbEdadNinio43')!=null)
				document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl0_drop_ocupacion4').value=="1-3")
					{
					if (document.getElementById('_ctl0_lblEdadNinio4')!=null)
						document.getElementById('_ctl0_lblEdadNinio4').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio41')!=null)
						document.getElementById('_ctl0_cbEdadNinio41').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio42')!=null)
						document.getElementById('_ctl0_cbEdadNinio42').style.display="inline";
					if (document.getElementById('_ctl0_cbEdadNinio43')!=null)
						document.getElementById('_ctl0_cbEdadNinio43').style.display="inline";
					} 
			  }
		}
	}
	
	}
	
	function pon_edades_ninosDest_4()
	{
		
	if (document.getElementById('_ctl4_drop_ocupacion4').value=="1" ||  document.getElementById('_ctl4_drop_ocupacion4').value=="2" || document.getElementById('_ctl4_drop_ocupacion4').value=="3" || document.getElementById('_ctl4_drop_ocupacion4').value=="4")
	{
	document.getElementById('_ctl4_lblEdadNinio4').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
	}
	else
	{
		if  (document.getElementById('_ctl4_drop_ocupacion4').value=="1-1" ||  document.getElementById('_ctl4_drop_ocupacion4').value=="2-1" || document.getElementById('_ctl4_drop_ocupacion4').value=="3-1")
		{
		document.getElementById('_ctl4_lblEdadNinio4').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio41').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
			document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
		}
		else
		{
			if  (document.getElementById('_ctl4_drop_ocupacion4').value=="1-2" ||  document.getElementById('_ctl4_drop_ocupacion4').value=="2-2")
			{
			document.getElementById('_ctl4_lblEdadNinio4').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio41').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio42').style.display="inline";
			document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
			}
			else
			  {
					if  (document.getElementById('_ctl4_drop_ocupacion4').value=="1-3")
					{
					document.getElementById('_ctl4_lblEdadNinio4').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio41').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio42').style.display="inline";
					document.getElementById('_ctl4_cbEdadNinio43').style.display="inline";
					} 
			  }
		}
	}
	
	}
	
	function ValidaNinos()
	{
	if (document.getElementById('_ctl0_drop_habitaciones')!=null)
	
	{
	if (document.getElementById('_ctl0_drop_habitaciones').value=="1")
	 {
		if (document.getElementById('_ctl0_drop_ocupacion').value=="1-1" || document.getElementById('_ctl0_drop_ocupacion').value=="2-1" ||  document.getElementById('_ctl0_drop_ocupacion').value=="3-1")
		{
			if (document.getElementById('_ctl0_cbEdadNinio11').value=="")		
			 {
				alert('introduce ninos');
				return false;
			 }
		}
	 }
	
	}
	
	}
	function cambio_numero_habitaciones(){

	if (document.getElementById('_ctl0_lblEdadNinio1')!=null)
		document.getElementById('_ctl0_lblEdadNinio1').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio11')!=null)
		document.getElementById('_ctl0_cbEdadNinio11').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio12')!=null)
		document.getElementById('_ctl0_cbEdadNinio12').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio13')!=null)
		document.getElementById('_ctl0_cbEdadNinio13').style.display="none";
	
	if (document.getElementById('_ctl0_lblEdadNinio2')!=null)
		document.getElementById('_ctl0_lblEdadNinio2').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio21')!=null)
		document.getElementById('_ctl0_cbEdadNinio21').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio22')!=null)
		document.getElementById('_ctl0_cbEdadNinio22').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio23')!=null)
		document.getElementById('_ctl0_cbEdadNinio23').style.display="none";
	
	if (document.getElementById('_ctl0_lblEdadNinio3')!=null)
		document.getElementById('_ctl0_lblEdadNinio3').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio31')!=null)
		document.getElementById('_ctl0_cbEdadNinio31').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio32')!=null)
		document.getElementById('_ctl0_cbEdadNinio32').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio33')!=null)
		document.getElementById('_ctl0_cbEdadNinio33').style.display="none";
	
	if (document.getElementById('_ctl0_lblEdadNinio4')!=null)
		document.getElementById('_ctl0_lblEdadNinio4').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio41')!=null)
		document.getElementById('_ctl0_cbEdadNinio41').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio42')!=null)
		document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
	if (document.getElementById('_ctl0_cbEdadNinio43')!=null)
		document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
	
	
			pon_edades_ninos_1();
			pon_edades_ninos_2();
			pon_edades_ninos_3();
			pon_edades_ninos_4();	
			if (document.getElementById('_ctl0_drop_habitaciones')!=null)
			{
			document.getElementById('_ctl0_drop_ocupacion2').style.display="none";
			document.getElementById('_ctl0_drop_ocupacion3').style.display="none";
			document.getElementById('_ctl0_drop_ocupacion4').style.display="none";
			document.getElementById('_ctl0_cbBebes2').style.display="none";
		
			document.getElementById('_ctl0_cbBebes3').style.display="none";
			
			document.getElementById('_ctl0_cbBebes4').style.display="none";
		
			if (document.getElementById('_ctl0_drop_habitaciones').value=="1")
			{
			
	document.getElementById('_ctl0_cbEdadNinio21').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio22').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio23').style.display="none";
	
	document.getElementById('_ctl0_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio33').style.display="none";

	document.getElementById('_ctl0_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
			}
			if (document.getElementById('_ctl0_drop_habitaciones').value=="2")
			{
				document.getElementById('_ctl0_drop_ocupacion2').style.display="inline";
			
				document.getElementById('_ctl0_cbBebes2').style.display="inline";
				
	document.getElementById('_ctl0_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio33').style.display="none";

	document.getElementById('_ctl0_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
			}
			if  (document.getElementById('_ctl0_drop_habitaciones').value=="3"){
				document.getElementById('_ctl0_drop_ocupacion2').style.display="inline";
				document.getElementById('_ctl0_drop_ocupacion3').style.display="inline";
				
				document.getElementById('_ctl0_cbBebes2').style.display="inline";
				
				document.getElementById('_ctl0_cbBebes3').style.display="inline";
				
	document.getElementById('_ctl0_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl0_cbEdadNinio43').style.display="none";
			}
			if  (document.getElementById('_ctl0_drop_habitaciones').value=="4"){
				document.getElementById('_ctl0_drop_ocupacion2').style.display="inline";
				document.getElementById('_ctl0_drop_ocupacion3').style.display="inline";
				document.getElementById('_ctl0_drop_ocupacion4').style.display="inline";
				
				document.getElementById('_ctl0_cbBebes2').style.display="inline";
			
				document.getElementById('_ctl0_cbBebes3').style.display="inline";
				
				document.getElementById('_ctl0_cbBebes4').style.display="inline";
			}	
			}
	
		
	}
	function cambio_numero_habitacionesDestacados(){
	document.getElementById('_ctl4_lblEdadNinio1').style.display="none";

	document.getElementById('_ctl4_cbEdadNinio11').style.display="none";

	document.getElementById('_ctl4_cbEdadNinio12').style.display="none";

	document.getElementById('_ctl4_cbEdadNinio13').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio21').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio22').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio23').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
			pon_edades_ninosDest_1();
			pon_edades_ninosDest_2();
			pon_edades_ninosDest_3();
			pon_edades_ninosDest_4();	
			if (document.getElementById('_ctl4_drop_habitaciones')!=null)
			{
			document.getElementById('_ctl4_drop_ocupacion2').style.display="none";
			document.getElementById('_ctl4_drop_ocupacion3').style.display="none";
			document.getElementById('_ctl4_drop_ocupacion4').style.display="none";
			
			document.getElementById('_ctl4_cbBebes2').style.display="none";
			
			document.getElementById('_ctl4_cbBebes3').style.display="none";
			
			document.getElementById('_ctl4_cbBebes4').style.display="none";
			if (document.getElementById('_ctl4_drop_habitaciones').value=="1")
			{
			
	document.getElementById('_ctl4_cbEdadNinio21').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio22').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio23').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
			}
			if (document.getElementById('_ctl4_drop_habitaciones').value=="2")
			{
				document.getElementById('_ctl4_drop_ocupacion2').style.display="inline";
			
				document.getElementById('_ctl4_cbBebes2').style.display="inline";
			
	document.getElementById('_ctl4_cbEdadNinio31').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio32').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio33').style.display="none";
	
	document.getElementById('_ctl4_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
			}
			if  (document.getElementById('_ctl4_drop_habitaciones').value=="3"){
				document.getElementById('_ctl4_drop_ocupacion2').style.display="inline";
				document.getElementById('_ctl4_drop_ocupacion3').style.display="inline";
				
				document.getElementById('_ctl4_cbBebes2').style.display="inline";
				
				document.getElementById('_ctl4_cbBebes3').style.display="inline";
				
	document.getElementById('_ctl4_cbEdadNinio41').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio42').style.display="none";
	document.getElementById('_ctl4_cbEdadNinio43').style.display="none";
			}
			if  (document.getElementById('_ctl4_drop_habitaciones').value=="4"){
				document.getElementById('_ctl4_drop_ocupacion2').style.display="inline";
				document.getElementById('_ctl4_drop_ocupacion3').style.display="inline";
				document.getElementById('_ctl4_drop_ocupacion4').style.display="inline";
			
				document.getElementById('_ctl4_cbBebes2').style.display="inline";
				
				document.getElementById('_ctl4_cbBebes3').style.display="inline";
				
				document.getElementById('_ctl4_cbBebes4').style.display="inline";
			}	
			}
	
		
	}
	
	
	
	function cambio_numero_habitaciones_ficha(){
			
			pon_edades_ninos_ficha_1();
			pon_edades_ninos_ficha_2();
			pon_edades_ninos_ficha_3();
			pon_edades_ninos_ficha_4();	

			if (document.getElementById('cb_habitaciones')!=null)
			{
			document.getElementById('cb_ocupacion2').style.display="none";
			document.getElementById('cb_ocupacion3').style.display="none";
			document.getElementById('cb_ocupacion4').style.display="none";
			if (document.getElementById('cb_habitaciones').value=="1")
			{
				document.getElementById('cb_ocupacion2').style.display="none";
				document.getElementById('cb_ocupacion3').style.display="none";
				document.getElementById('cb_ocupacion4').style.display="none";
				document.getElementById('trEdadNinios2').style.display="none";
				document.getElementById('trEdadNinios3').style.display="none";
				document.getElementById('trEdadNinios4').style.display="none";
			}
			if (document.getElementById('cb_habitaciones').value=="2")
			{
				document.getElementById('cb_ocupacion2').style.display="inline";
				document.getElementById('cb_ocupacion3').style.display="none";
				document.getElementById('cb_ocupacion4').style.display="none";
				document.getElementById('trEdadNinios3').style.display="none";
				document.getElementById('trEdadNinios4').style.display="none";
			}
			if  (document.getElementById('cb_habitaciones').value=="3"){
				document.getElementById('cb_ocupacion2').style.display="inline";
				document.getElementById('cb_ocupacion3').style.display="inline";
				document.getElementById('cb_ocupacion4').style.display="none";
				document.getElementById('trEdadNinios4').style.display="none";

			}
			if  (document.getElementById('cb_habitaciones').value=="4"){
				document.getElementById('cb_ocupacion2').style.display="inline";
				document.getElementById('cb_ocupacion3').style.display="inline";
				document.getElementById('cb_ocupacion4').style.display="inline";
			}	
			}
	}
	
	function pon_edades_ninos_ficha_1()
	{
	if (document.getElementById('cb_ocupacion').value=="1" ||  document.getElementById('cb_ocupacion').value=="2" || document.getElementById('cb_ocupacion').value=="3" || document.getElementById('cb_ocupacion').value=="4")
	{
		document.getElementById('trEdadNinios1').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion').value=="1-1" ||  document.getElementById('cb_ocupacion').value=="2-1" || document.getElementById('cb_ocupacion').value=="3-1")
		{
			document.getElementById('trEdadNinios1').style.display="inline";
			document.getElementById('lblEdadNinio1').style.display="inline";
			document.getElementById('cbEdadNinio11').style.display="inline";
			document.getElementById('cbEdadNinio12').style.display="none";
			document.getElementById('cbEdadNinio13').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion').value=="1-2" ||  document.getElementById('cb_ocupacion').value=="2-2")
			{
			document.getElementById('trEdadNinios1').style.display="inline";
			document.getElementById('lblEdadNinio1').style.display="inline";
			document.getElementById('cbEdadNinio11').style.display="inline";
			document.getElementById('cbEdadNinio12').style.display="inline";
			document.getElementById('cbEdadNinio13').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion').value=="1-3")
					{
					document.getElementById('trEdadNinios1').style.display="inline";
					document.getElementById('lblEdadNinio1').style.display="inline";
					document.getElementById('cbEdadNinio11').style.display="inline";
					document.getElementById('cbEdadNinio12').style.display="inline";
					document.getElementById('cbEdadNinio13').style.display="inline";
					} 
			  }
		}
	}
	}
	
	function pon_edades_ninos_ficha_2()
	{
	if (document.getElementById('cb_ocupacion2').value=="1" ||  document.getElementById('cb_ocupacion2').value=="2" || document.getElementById('cb_ocupacion2').value=="3" || document.getElementById('cb_ocupacion2').value=="4")
	{
		document.getElementById('trEdadNinios2').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion').value=="1-1" ||  document.getElementById('cb_ocupacion2').value=="2-1" || document.getElementById('cb_ocupacion2').value=="3-1")
		{
			document.getElementById('trEdadNinios2').style.display="inline";
			document.getElementById('lblEdadNinio2').style.display="inline";
			document.getElementById('cbEdadNinio21').style.display="inline";
			document.getElementById('cbEdadNinio22').style.display="none";
			document.getElementById('cbEdadNinio23').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion2').value=="1-2" ||  document.getElementById('cb_ocupacion2').value=="2-2")
			{
			document.getElementById('trEdadNinios2').style.display="inline";
			document.getElementById('lblEdadNinio2').style.display="inline";
			document.getElementById('cbEdadNinio21').style.display="inline";
			document.getElementById('cbEdadNinio22').style.display="inline";
			document.getElementById('cbEdadNinio23').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion2').value=="1-3")
					{
					document.getElementById('trEdadNinios2').style.display="inline";
					document.getElementById('lblEdadNinio2').style.display="inline";
					document.getElementById('cbEdadNinio21').style.display="inline";
					document.getElementById('cbEdadNinio22').style.display="inline";
					document.getElementById('cbEdadNinio23').style.display="inline";
					} 
			  }
		}
	}
	}
	
	function pon_edades_ninos_ficha_3()
	{
	if (document.getElementById('cb_ocupacion3').value=="1" ||  document.getElementById('cb_ocupacion3').value=="2" || document.getElementById('cb_ocupacion3').value=="3" || document.getElementById('cb_ocupacion3').value=="4")
	{
		document.getElementById('trEdadNinios3').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion3').value=="1-1" ||  document.getElementById('cb_ocupacion3').value=="2-1" || document.getElementById('cb_ocupacion3').value=="3-1")
		{
			document.getElementById('trEdadNinios3').style.display="inline";
			document.getElementById('lblEdadNinio3').style.display="inline";
			document.getElementById('cbEdadNinio31').style.display="inline";
			document.getElementById('cbEdadNinio32').style.display="none";
			document.getElementById('cbEdadNinio33').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion3').value=="1-2" ||  document.getElementById('cb_ocupacion3').value=="2-2")
			{
			document.getElementById('trEdadNinios3').style.display="inline";
			document.getElementById('lblEdadNinio3').style.display="inline";
			document.getElementById('cbEdadNinio31').style.display="inline";
			document.getElementById('cbEdadNinio32').style.display="inline";
			document.getElementById('cbEdadNinio33').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion3').value=="1-3")
					{
					document.getElementById('trEdadNinios3').style.display="inline";
					document.getElementById('lblEdadNinio3').style.display="inline";
					document.getElementById('cbEdadNinio31').style.display="inline";
					document.getElementById('cbEdadNinio32').style.display="inline";
					document.getElementById('cbEdadNinio33').style.display="inline";
					} 
			  }
		}
	}
	}

	function pon_edades_ninos_ficha_4()
	{
	if (document.getElementById('cb_ocupacion4').value=="1" ||  document.getElementById('cb_ocupacion4').value=="2" || document.getElementById('cb_ocupacion4').value=="3" || document.getElementById('cb_ocupacion4').value=="4")
	{
		document.getElementById('trEdadNinios3').style.display="none";
	}
	else
	{
		if  (document.getElementById('cb_ocupacion4').value=="1-1" ||  document.getElementById('cb_ocupacion4').value=="2-1" || document.getElementById('cb_ocupacion4').value=="3-1")
		{
			document.getElementById('trEdadNinios4').style.display="inline";
			document.getElementById('lblEdadNinio4').style.display="inline";
			document.getElementById('cbEdadNinio41').style.display="inline";
			document.getElementById('cbEdadNinio42').style.display="none";
			document.getElementById('cbEdadNinio43').style.display="none";
		}
		else
		{
			if  (document.getElementById('cb_ocupacion4').value=="1-2" ||  document.getElementById('cb_ocupacion4').value=="2-2")
			{
			document.getElementById('trEdadNinios4').style.display="inline";
			document.getElementById('lblEdadNinio4').style.display="inline";
			document.getElementById('cbEdadNinio41').style.display="inline";
			document.getElementById('cbEdadNinio42').style.display="inline";
			document.getElementById('cbEdadNinio43').style.display="none";
			}
			else
			  {
					if  (document.getElementById('cb_ocupacion4').value=="1-3")
					{
					document.getElementById('trEdadNinios4').style.display="inline";
					document.getElementById('lblEdadNinio4').style.display="inline";
					document.getElementById('cbEdadNinio41').style.display="inline";
					document.getElementById('cbEdadNinio42').style.display="inline";
					document.getElementById('cbEdadNinio43').style.display="inline";
					} 
			  }
		}
	}
	}

	function ocultar(){
  		
		var iframe2 = document.getElementById? document.getElementById("iframe2"): document.all? document.all["iframe2"]: null;
		if(iframe2.style.display=="inline") iframe2.style.display = "none"

	}
	
	function mostrar(id){
		ocultar()
		var destinos = document.getElementById? document.getElementById(id): document.all? document.all[id]: null;
		if (destinos) destinos.style.display="inline";
	}
	
	function ocultarCalendario(){
		
		var iframeCal2 = document.getElementById? document.getElementById("iframe_cal2"): document.all? document.all["iframe_cal2"]: null;
		if(iframeCal2.style.display=="inline") iframeCal2.style.display = "none"
	}
	
	function mostrarCalendario(id){
		
		ocultarCalendario()
		
		
			var dia = document.getElementById("_ctl0_drop_dia")[document.getElementById("_ctl0_drop_dia").selectedIndex].value;
			var mes = document.getElementById("_ctl0_drop_mes")[document.getElementById("_ctl0_drop_mes").selectedIndex].value;
	
		
		var fecha = mes + dia;
		
		var iframeCal = document.getElementById(id)
		iframeCal.src = "/Vuelos-Hoteles/controles/calendario.aspx?fecha=" + fecha
		iframeCal.style.display = "inline"
		
	}
	
	function ocultarMapa(id){
		
		var iframeMapa = document.getElementById? document.getElementById(id): document.all? document.all[id]: null;
		if(iframeMapa.style.display=="inline") iframeMapa.style.display = "none"
	}
	
	function ocultarMapaPadre(id){
		var iframeMapa = parent.document.getElementById? parent.document.getElementById(id): parent.document.all? parent.document.all[id]: null;
		if(iframeMapa.style.display=="inline") iframeMapa.style.display = "none"
	}
	function mostrarMapa(id){
		
		ocultarMapa(id)
		
		var iframeMapa = document.getElementById(id)
		iframeMapa.src = "/hoteles/Buscador/Ficha/MapaXY.aspx"
		iframeMapa.style.display = "inline"
		
	}

	function mostrarMapa2(id,cod){
		
		ocultarMapa(id)
		
		var iframeMapa = document.getElementById(id)
		iframeMapa.src = "/hoteles/Buscador/Ficha/MapaXY.aspx?cod=" + cod
		iframeMapa.style.display = "inline"
		
	}
	
	function calcular_fecha_regreso(){
	var dia = document.getElementById("_ctl0_drop_dia")[document.getElementById("_ctl0_drop_dia").selectedIndex].value;
	var mes = document.getElementById("_ctl0_drop_mes")[document.getElementById("_ctl0_drop_mes").selectedIndex].value;
	var noches = document.getElementById("_ctl0_drop_noches")[document.getElementById("_ctl0_drop_noches").selectedIndex].value;
	var fecha = new Date()
	fecha.setFullYear(fecha.getFullYear(),mes -1,dia)
	
	var regreso=addDays(fecha,noches);

    document.getElementById('_ctl0_lbRegreso').innerHTML=regreso.toLocaleDateString();
    
    var daysofweek = new makeArray('Domingo',
                               'Lunes',
                               'Martes',
                               'Miercoles',
                               'Jueves',
                               'Viernes',
                               'Sabado');
                               
    document.getElementById('_ctl0_lbDiaSalida').innerHTML=daysofweek[DayOfWeek(dia,mes,fecha.getYear())];
	}
	
	function DayOfWeek(day,month,year) {
    var a = Math.floor((14 - parseInt(month))/12);
    var y = parseInt(year) - a;
    var m = parseInt(month) + 12*a - 2;
    var d = (parseInt(day) + y + Math.floor(y/4) - Math.floor(y/100) +
             Math.floor(y/400) + Math.floor((31*m)/12)) % 7;
    return d + 1;
	}

	
	function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
	}
	
	function makeArray()    {
    this[0] = makeArray.arguments.length;
    for (i = 0; i<makeArray.arguments.length; i++)
        this[i+1] = makeArray.arguments[i];
	}

	

function calcular_costes_emision_web(costesweb,tramos_ida,tramos_vuelta,costesemision)
     {
		 var tramos_ida=(tramos_ida=="")?0:tramos_ida
         var tramos_vuelta=(tramos_vuelta=="")?0:tramos_vuelta
         var costesemision=(costesemision=="")?0:costesemision
       
         if (costesweb=='Y')
         {
         document.write(Math.round((parseFloat(costesemision)+2*(parseFloat(tramos_ida)+parseFloat(tramos_vuelta)))*100)/100);
         }
         else
         {
         document.write(costesemision);
         }
     }
     
 function calcular_total_web(costesweb,tramos_ida,tramos_vuelta,costesemision,total,num_pasajeros)
     {
		var tramos_ida=(tramos_ida=="")?0:tramos_ida
         var tramos_vuelta=(tramos_vuelta=="")?0:tramos_vuelta
         var costesemision=(costesemision=="")?0:costesemision
        
         if (costesweb=='Y')
         {
         document.write(Math.round((parseFloat(total)+parseFloat(costesemision)+2*(parseFloat(tramos_ida)+parseFloat(tramos_vuelta)))*100*num_pasajeros)/100);
         }
         else
         {
         document.write(Math.round((parseFloat(total)+parseFloat(costesemision))*parseFloat(num_pasajeros)*100)/100);
         }
     }
  function popup(path, alto, ancho){
	var parametros = "scrollbars = yes, toolbar=no, width = " + ancho + ", height = " + alto;
	window.open(path, '', parametros);
 }
 
 function mostrarMapa2(id,cod){
		
		ocultarMapa(id)
		
		var iframeMapa = document.getElementById(id)
		iframeMapa.src = "/hoteles/Buscador/Ficha/MapaXY.aspx?cod=" + cod
		iframeMapa.style.display = "inline"
		
	}

function ocultarMapa(id){
		
		var iframeMapa = document.getElementById? document.getElementById(id): document.all? document.all[id]: null;
		if(iframeMapa.style.display=="inline") iframeMapa.style.display = "none"
	}
	
 
function ocultarMapa(id){
		
		var iframeMapa = document.getElementById? document.getElementById(id): document.all? document.all[id]: null;
		if(iframeMapa.style.display=="inline") iframeMapa.style.display = "none"
	}
	
	function ocultarMapaPadre(id){
		var iframeMapa = parent.document.getElementById? parent.document.getElementById(id): parent.document.all? parent.document.all[id]: null;
		if(iframeMapa.style.display=="inline") iframeMapa.style.display = "none"
	}
	function mostrarMapa(id){
		
		ocultarMapa(id)
		
		var iframeMapa = document.getElementById(id)
		iframeMapa.src = "/hoteles/Buscador/Ficha/MapaXY.aspx"
		iframeMapa.style.display = "inline"
		
	}

	function mostrarMapa2(id,cod){
		
		ocultarMapa(id)
		
		var iframeMapa = document.getElementById(id)
		iframeMapa.src = "/Vuelos-Hoteles/aspx/MapaXY.aspx?cod=" + cod
		iframeMapa.style.display = "inline"
		
	}

/*PATRICK - CECILIA, NOS LLEVAMOS LA FUNCION PANEL TRASLADOS AL CONTROL LINEATRASLADOS PORQUE 
SI NO, NO COGE CORRECTAMENTE EL NOMBRE DEL CHECK PARA CASOS CON BEBES Y NIŅOS*/








//----------------------------------------------//
function slideSearch () {
    $("#cambiarFechas").click(function () {
      $("#buscadorResultados").slideToggle("slow");
    });
}//slideSearch

