function VerificarPaxMR(elem)
{
    var DvFechas = $get(ConstruirId(elem.id, 'UpFechaNacimiento', 1));

    if (elem.checked)
    {
        DvFechas.style.display = 'block';        
    }
    else
    {
        DvFechas.style.display = 'none';
    }
    
    var indice = elem.id.split('_');
    indice = indice[indice.length - 2];
    indice = indice.substring(3,5);        
    
    var IdsDrops = ObtenerDropsPagina(indice, '', '', '');
    
    VerificarSiResidenteFamiliaNum(IdsDrops);
}

function AsignarGastosGestion(elem)
{
    if (VerificarImporte(elem)) {

        var lblGastos = $get(ConstruirId(elem.id, 'HiddenGGestion', 3));

        lblGastos.value = elem.value;
    
        var TablePrecio = elem.parentNode.parentNode.parentNode;
        
        if (TablePrecio.children.length > 2)
        {
            for (var i = 1; i < TablePrecio.children.length; i++)
            {
                if (isNaN(TablePrecio.children[i].children[6].firstChild.value))
                {
                    TablePrecio.children[i].children[6].firstChild.value = elem.value;
                }
            }
        }
    }
}

function VerificarImporte(elem)
{
    var Result = false;

    if ((elem.value == '') || (isNaN(elem.value.replace(",", "."))))
    {
        elem.style['background'] = '#FFFFCC';
    }
    else
    {
        elem.style['background'] = '#FFFFFF';
        
        Result = true;
    }
    
    return Result;
}

function VerificarGastos(elem)
{
    var Result = true;
    
    var TablePrecio = $get(ConstruirId(elem.id, 'DataGridTasas', 1));
    
    for (var i = 1; i < TablePrecio.children[0].children.length; i++)
    {
        var Importe = TablePrecio.children[0].children[i].children[6].firstChild;
        
        if (!VerificarImporte(Importe))
        {
            Result = false;
        }
    }
    
    if (!Result)
    {
        //BuscarErrorCache(event,"91000006"); //_RESERVAS_INF_GASTOSGESTION
        MostrarCapaAvisos('Importes derivados de la gestión erroneos. Por favor verificalos.');
    }
    
    return Result;
}

function VerificarGGestionPopUp(elem)
{
    var TxtImporte = $get(ConstruirId(elem.id, 'txtGastos', 1));
    
    return VerificarImporte(TxtImporte);
}

function ConfirmarDatosPax(elem)
{
    var Result = false;

    var chkelem = $get(ConstruirId(elem.id, 'UC_Datos_PaxContactoInfoAdicional1_ChkRevDatos', 1));

    if (chkelem != null)
    {
        if (chkelem.checked == true)
        {
            WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$MainContentPlaceHolder$BtnReservar", "", true, "ValidarFormato", "", false, false));
        
            GuardarFechasResumenPasajeros(chkelem.id);
            
            Result = true;
        }
        else
        {
            MostrarCapaAvisos("Debe confirmar que ha revisado los datos personales, que son correctos para poder continuar y activar el check correspondiente.");
            //BuscarErrorCache(event, "91000009");
        }
    }
    
    return Result;
}

function ValidarTarjCli()
{
    return true;
}