﻿//var EnumZonaAplicacion = { Contenido : 0, Noticia: 1, Evento: 2, Sugerencia:3}
var EnumTipoEvento = { OnClick : 0, OnMouseOver: 1 , OnMouseOut: 2 }
var InicioMaster ="MasterPagina_CPHContenido_"

/*************************************Empieza ContenidoCentral.ascx***************************************************/
var EnumFormatoTexto = {BBDDInteger:0, BBDDString:1, BBDDFecha:2,  BBDDDouble:3}

function TextBoxKeyPressIntro(objetoEdicion, DenonminacionASCX, InformacionAuxiliar, Formato, TipoCampo, TipoSubCampo, e){
   if (document.all){ //IE
        ObjetoEvento = event.keyCode
   }
   else{//Firefox
        ObjetoEvento = e.which
   }

   if(ObjetoEvento==13){
        TextBoxOnBlur(objetoEdicion, DenonminacionASCX, InformacionAuxiliar, Formato, TipoCampo, TipoSubCampo)
        return false
   }
   else{
        return true
   }
}

function TextBoxOnBlur(objetoEdicion, DenonminacionASCX, InformacionAuxiliar, Formato, TipoCampo, TipoSubCampo){

    DenInicio='MasterPagina_'

    if (TipoCampo==2){
    //textbox
        idLabel = objetoEdicion.id.replace("Txt","lbl")
        idPanel = objetoEdicion.id.replace("Txt","Pnl")
    }
    else if (TipoCampo==3){
    //seleccion
        idLabel = objetoEdicion.id.replace("Seleccion","lbl")
        idPanel = objetoEdicion.id.replace("Seleccion","Pnl")
    }

    objetoLabel = document.getElementById(idLabel)
    
    objetoPanel = document.getElementById(idPanel)
    if (objetoPanel != null)
    {
        objetoPanel.className = "PnlCampo"   
    }
    else
    {
        //Es para el caso de tabla
        idTablaColumna = objetoEdicion.id.replace("TxtCampo","TablaColumna")
        var objetoTablaColumna = document.getElementById(idTablaColumna)
        objetoTablaColumna.className = "PnlCampo"   
    }
     
    msjError=ComprobarFormatoTexto(objetoEdicion.value, Formato)
    if (msjError==''){
        //objetoEdicion.style.visibility = 'hidden'
        //objetoLinkButton.style.visibility = 'visible'
        //objetoEdicion.style.display = 'none'
        //objetoLabel.style.display = 'inline'
        
        if(objetoLabel.innerHTML=='Texto Sin Definir'){
            textoLabel = ''
        }
        else{
            if (InformacionAuxiliar!=""){
                textoLabel = objetoLabel.innerHTML.substring(0,objetoLabel.innerHTML.lastIndexOf(InformacionAuxiliar))
            }
            else{
                textoLabel = objetoLabel.innerHTML
            }
        }
        
        if (TipoCampo==2){
        //textbox
            ValorEdicion = objetoEdicion.value
        }
        else if (TipoCampo==3){
        //seleccion
            if (TipoSubCampo==1){
                //dropdown
               // ValorEdicion = '' + ObtenerRadioButtonListSel(objetoEdicion)
            }
            else if (TipoSubCampo==2){
               //radio
                ValorEdicion = '' + ObtenerRadioButtonListSel(objetoEdicion)
            }
            else if (TipoSubCampo==3){
                //check
                ValorEdicion = '' + ObtenerCheckListSel(objetoEdicion)
            }                        
        }                
        
        if (textoLabel!=ValorEdicion){
//            if(ValorEdicion == ''){
//                objetoLabel.innerHTML = IdiomaTextosJS(EnumIndicePagina.ContenidoCentral, EnumContenidoCentral.TextoSinDefinir) + InformacionAuxiliar
//            }
//            else{
//                objetoLabel.innerHTML = ValorEdicion + InformacionAuxiliar
//            }
        
            if(document.getElementById(DenonminacionASCX + '_btnGuardar')!=null){
                document.getElementById(DenonminacionASCX + '_btnGuardar').style.display = 'inline'
            }
            if(document.getElementById(DenonminacionASCX + '_btnCancelar')!=null){
                document.getElementById(DenonminacionASCX + '_btnCancelar').style.display = 'inline'
            }
            
        }        
    }
    else
    {
        //volver a poner el valor del linkbutton en el textbox
        objetoEdicion.value=objetoLabel.innerHTML
        objetoEdicion.select()
    }
    //indice=objetoEdicion.id.lastIndexOf("_")
    //DenInicioMensaje = objetoEdicion.id.substring(0,indice)
    //document.getElementById(DenInicioMensaje + '_lblMensaje').innerHTML = msjError
    
    return false
}

function ObtenerRadioButtonListSel(objetoEdicion){
    var valor = '';
    i = 0
    
    while (document.getElementById(objetoEdicion.id + "_" + i)!=null)
    {
        if (document.getElementById(objetoEdicion.id + "_" + i).checked==true){
             //valor = document.getElementById(objetoEdicion.id).cells(i).innerText
             valor = document.getElementById(objetoEdicion.id + "_" + i).nextSibling.innerHTML
        }
        i++
    }   
    return valor;
}

function ObtenerCheckListSel(objetoEdicion){
    var valor = '';
    var i = 0;    
   
    while (document.getElementById(objetoEdicion.id + "_" + i)!=null)
    {
        if (document.getElementById(objetoEdicion.id + "_" + i).checked==true){
            if (valor==''){
                //valor = objetoEdicion.cells(i).innerText
                valor = document.getElementById(objetoEdicion.id + "_" + i).nextSibling.innerHTML
            }
            else{
                //valor += ', ' + objetoEdicion.cells(i).innerText
                valor += ', ' + document.getElementById(objetoEdicion.id + "_" + i).nextSibling.innerHTML
            } 
        }
        i++
    }   
    return valor;
}

function TxtBoxOnFocus(objetoTextBox){
    objetoTextBox.select()
}

function SeleccionOnFocus(objetoSeleccion){
   document.getElementById(objetoSeleccion.id + "_0").focus
}

function CalendarioOnFocus(objetoSeleccion){
   document.getElementById(objetoSeleccion.id + "_0").focus
}

function ComprobarFormatoTexto(Valor, TipoFormato){

    if (TipoFormato==EnumFormatoTexto.BBDDInteger){
    
        var ArrayNumeros = new Array('0','1','2','3','4','5','6','7','8','9');
        valorCaracter=Valor.split("")
        for(i=0;i<valorCaracter.length;i++){
            Encontrado=false
            for(j=0;j<ArrayNumeros.length;j++){
              if(valorCaracter[i]==ArrayNumeros[j]){
                Encontrado=true
              }
            }
            if (Encontrado==false){
                msjError=IdiomaTextosJS(EnumIndicePagina.ContenidoCentral, EnumContenidoCentral.Enteros)
	            return msjError
            }
        }
    }
    else if(TipoFormato==EnumFormatoTexto.BBDDString)
    {
    }
    else if(TipoFormato==EnumFormatoTexto.BBDDFecha)
    {    
        /*Comprobacion valida para fechas que vengan como dd/mm/aaaa*/
        /*OJO: mirar formatos para distintos idiomas*/
        re=/^[0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]$/
        if(Valor.length==0 || !re.exec(Valor))
        {
	        msjError=IdiomaTextosJS(EnumIndicePagina.Paginacion, EnumPaginacion.Fecha)
	        return msjError
        }
        /* comprobamos que la fecha es válida */
        var d = new Date()
        /* la función tiene como entrada: año, mes, día */
        d.setFullYear(Valor.substring(6,10), Valor.substring(3,5)-1, Valor.substring(0,2))
        if(d.getMonth() != Valor.substring(3,5)-1  || d.getDate() != Valor.substring(0,2))
        {
	        msjError=IdiomaTextosJS(EnumIndicePagina.ContenidoCentral, EnumContenidoCentral.Fecha)
	        return msjError
        }  
    }
    else if(TipoFormato==EnumFormatoTexto.BBDDDouble){
        
        var ArrayNumeros = new Array('0','1','2','3','4','5','6','7','8','9','.');
        valorCaracter=Valor.split("")
        PuntoAnterior=false
        for(i=0;i<valorCaracter.length;i++){
            Encontrado=false
            for(j=0;j<ArrayNumeros.length;j++){
              if(valorCaracter[i]==ArrayNumeros[j]){
                Encontrado=true
                if(valorCaracter[i]=='.'){
                    if (PuntoAnterior==false){
                        PuntoAnterior=true
                        Encontrado=true
                    }
                    else{
                        Encontrado=false
                    }
                }
              }
            }
            if (Encontrado==false){
                msjError=IdiomaTextosJS(EnumIndicePagina.ContenidoCentral, EnumContenidoCentral.Doble)
	            return msjError
            }
        }
    }
    msjError=''
    return msjError    
}
function CambiarSeleccionRadio(objetoEdicion, Codigo, Indice){

   var ArrayCodigoActual = new Array()
   var ArrayIndiceActual = new Array()
   var ArrayHiddenLlavesGeneral = new Array()
   var ArrayHiddenHabilitadoGeneral = new Array()
   var i=0
   
   indice = objetoEdicion.id.lastIndexOf("_")
   DenInicio = objetoEdicion.id.substring(0,indice+1)
   
   ArrayCodigoActual = Codigo.split("#")
   ArrayIndiceActual = Indice.split("#")
   ArrayHiddenLlavesGeneral = document.getElementById(DenInicio + "cHiddenListaLlave").value.split("#")
   ArrayHiddenHabilitadoGeneral = document.getElementById(DenInicio + "cHiddenListaHabilitado").value.split("#")
     
   
   if (Indice!=""){
        while (document.getElementById(objetoEdicion.id + "_" + i)!=null)
        {
            if (document.getElementById(objetoEdicion.id + "_" + i).checked==true){
               
                for(j=0;j<ArrayIndiceActual.length;j++){
                
                   if (i==ArrayIndiceActual[j]){
                        document.getElementById(DenInicio + "pnlCampo" + ArrayCodigoActual[j]).style.display='block' 
                        //para el valor del codigo en el listado de hiddens poner el nuevo estado habilitado o deshabilitado
                        for(k=0;k<ArrayHiddenLlavesGeneral.length;k++){
                            if (ArrayHiddenLlavesGeneral[k] == ArrayCodigoActual[j]){
                                ArrayHiddenHabilitadoGeneral[k] = true
                            }
                        }
                    }
                    else
                    {
                        document.getElementById(DenInicio + "pnlCampo" + ArrayCodigoActual[j]).style.display='none'
                        if(document.getElementById(DenInicio + "txtCampo" + ArrayCodigoActual[j])!=null){
                            document.getElementById(DenInicio + "txtCampo" + ArrayCodigoActual[j]).value=''
                        }
                        
                        //para el valor del codigo en el listado de hiddens poner el nuevo estado habilitado o deshabilitado
                        for(k=0;k<ArrayHiddenLlavesGeneral.length;k++){
                            if (ArrayHiddenLlavesGeneral[k] == ArrayCodigoActual[j]){
                                ArrayHiddenHabilitadoGeneral[k] = false
                            }
                        }
                    }
                }
             }
            i++
        }
   } 
   document.getElementById(DenInicio + "cHiddenListaHabilitado").value=ArrayHiddenHabilitadoGeneral.join("#")
}
/*

function MostrarFrameSubForm(XMLCargar, e)
{
       if (document.all){ //IE
            ObjetoEvento = event.srcElement
            IFrame = this.parent.frames['iframeSubFormulario']
       }
       else{//Firefox
            ObjetoEvento = e.target
            IFrame = this.parent.frames[3]
       }

    //Visualizar el PanelFrameSubForm que esta en Principal.aspx
    this.parent.document.getElementById('MasterPagina_CPHContenido_PanelFrameSubForm').style.display = 'block'
    //Visualizar el PnlFondoFrameSubForm que esta en Principal.aspx
    this.parent.document.getElementById('MasterPagina_CPHContenido_PnlFondoFrameSubForm').style.display = 'block'
    
    //iframeSubFormulario
    IFrame.window.location.href =XMLCargar
    return false
}
*/
var BtnEliminarResumen
function VisualizarBtnsEdicionSubForm(ObjetoPulsado, ListaCods)
{
    ArrayCodigoActual = ListaCods.split("#")
    for(i=0;i<ArrayCodigoActual.length;i++){
        //Buscar PnlBtnListaSubForm
        var PnlBtnListaSubForm = document.getElementById(ObjetoPulsado.id.replace('BtnEditar', 'PnlBtnLista') + i)
        //Buscar el BtnEliminarItem que el el primero de los controles del panel y visibilizarlo
        for(j=0;j<PnlBtnListaSubForm.childNodes.length;j++){
            if(PnlBtnListaSubForm.childNodes[j].id != null){
                if(PnlBtnListaSubForm.childNodes[j].id.indexOf("BtnEliminarItem")>-1){
                    PnlBtnListaSubForm.childNodes[j].style.display = 'inline'
                }
            }
        }        
        
    }
    
    ObjetoPulsado.style.display = 'none'

    //Buscar BtnNuevoSubForm
    var BtnNuevo = document.getElementById(ObjetoPulsado.id.replace('Editar', 'Nuevo'))
    BtnNuevo.style.display = 'inline'
    //Buscar BtnEliminarSubForm
    BtnEliminarResumen = document.getElementById(ObjetoPulsado.id.replace('Editar', 'EliminarResumen'))    
    BtnEliminarResumen.style.display = 'inline'
    if (ArrayBtnEliminarItemClick.length > 0)
    {
        BtnEliminarResumen.disabled = false
        BtnEliminarResumen.className = 'BtnConfirmarEliminar' 
    }
    else
    {
        BtnEliminarResumen.disabled = true
        BtnEliminarResumen.className = 'BtnConfirmarEliminarDes' 
    }
    //Buscar BtnCancelarSubForm
    var BtnCancelar = document.getElementById(ObjetoPulsado.id.replace('Editar', 'Cancelar'))    
    BtnCancelar.style.display = 'inline'
    
   
    //Se invisibiliza el boton de edición general
    document.getElementById("ContenidoCentral_btnEditar").style.display='none'
    
    return false
}


function InvisibilizarBtnsEdicionSubForm(ObjetoPulsado, ListaCods)
{
    ArrayCodigoActual = ListaCods.split("#")
    for(i=0;i<ArrayCodigoActual.length;i++){
        //Buscar PnlBtnListaSubForm
        var PnlBtnListaSubForm = document.getElementById(ObjetoPulsado.id.replace('BtnCancelar', 'PnlBtnLista') + i)
        //Buscar el BtnEliminarItem que el el primero de los controles del panel y invisibilizarlo
        if(PnlBtnListaSubForm.childNodes.length>0){
            if(PnlBtnListaSubForm.childNodes[0].style!=null){
                PnlBtnListaSubForm.childNodes[0].style.display = 'none'
            }
            else{
                PnlBtnListaSubForm.childNodes[1].style.display = 'none'
            }
        }
    }
        
    ObjetoPulsado.style.display = 'none'

    //Buscar BtnNuevoSubForm
    var BtnNuevo = document.getElementById(ObjetoPulsado.id.replace('Cancelar', 'Nuevo'))
    BtnNuevo.style.display = 'none'
    //Buscar BtnEliminarSubForm
    BtnEliminarResumen = document.getElementById(ObjetoPulsado.id.replace('Cancelar', 'EliminarResumen'))
    BtnEliminarResumen.style.display = 'none'
    //Buscar BtnCancelarSubForm
    var BtnEditar = document.getElementById(ObjetoPulsado.id.replace('Cancelar', 'Editar'))    
    BtnEditar.style.display = 'inline'
    
     //Se invisibiliza el boton de edición general
    document.getElementById("ContenidoCentral_btnEditar").style.display='inline'
    
    return false
}

var ArrayBtnEliminarItemClick = new Array()
function BtnEliminarItemClickSubForm(ObjetoPulsado)
{
    var Cod = ObjetoPulsado.id.substring(ObjetoPulsado.id.lastIndexOf("_")+1, ObjetoPulsado.id.length)     
    
    if (ObjetoPulsado.className == 'BtnEliminarItem')
    {
        ObjetoPulsado.className = 'BtnEliminarItemSel' 
        
        var ExisteCod = 0
        for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
            if (ArrayBtnEliminarItemClick[i] == Cod)
            {
                ExisteCod = 1
                break
            }
            else
            {
                ExisteCod = 0
            }
        }
        if (ExisteCod == 0)
        {
            ArrayBtnEliminarItemClick.push(Cod)
        }         
        
    }
    else
    {
        ObjetoPulsado.className = 'BtnEliminarItem'
        ArrayBtnEliminarItemClick.pop(Cod)
    }
    //Buscar BtnEliminarResumenSubForm
    BtnEliminarResumen.value = "eliminar (" + ArrayBtnEliminarItemClick.length + ")"
   
      
    if (ArrayBtnEliminarItemClick.length > 0)
    {
        BtnEliminarResumen.disabled = false
        BtnEliminarResumen.className = 'BtnConfirmarEliminar' 
    }
    else
    {
        BtnEliminarResumen.disabled = true
        BtnEliminarResumen.className = 'BtnConfirmarEliminarDes' 
    }
    
    i = 0
    var StringBtnEliminarItemClick = ''
    for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
        if (i+1 == ArrayBtnEliminarItemClick.length)
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i]
        }
        else
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i] + "#"
        }
    }
    //Buscar el hidden cItemsEliminarSubForm

    document.getElementById('ContenidoCentral_cItemsEliminarSubForm').value = StringBtnEliminarItemClick
       
        
    return false
}

function ConfEliminarResumenSubForm(){
    ArrayBtnEliminarItemClick   =  new Array()
}
function BtnNuevoResumenSubForm(){
    ArrayBtnEliminarItemClick   =  new Array()
}
/*
function BtnEliminarItemDocumentos(ObjetoPulsado)
{
   var Cod = ObjetoPulsado.id.substring(ObjetoPulsado.id.lastIndexOf("_")+1, ObjetoPulsado.id.length)     
    
    if (ObjetoPulsado.className == 'BtnEliminarItem')
    {
        ObjetoPulsado.className = 'BtnEliminarItemSel' 
        
        var ExisteCod = 0
        for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
            if (ArrayBtnEliminarItemClick[i] == Cod)
            {
                ExisteCod = 1
                break
            }
            else
            {
                ExisteCod = 0
            }
        }
        if (ExisteCod == 0)
        {
            ArrayBtnEliminarItemClick.push(Cod)
        }         
        
    }
    else
    {
        ObjetoPulsado.className = 'BtnEliminarItem'
        ArrayBtnEliminarItemClick.pop(Cod)
    }
    //Buscar BtnEliminarResumenSubForm
    BtnEliminarResumen = document.getElementById("Documentos_BtnEliminarResumen")
    BtnEliminarResumen.value = "eliminar (" + ArrayBtnEliminarItemClick.length + ")"
   
      
    if (ArrayBtnEliminarItemClick.length > 0)
    {
        BtnEliminarResumen.disabled = false
        BtnEliminarResumen.className = 'BtnConfirmarEliminar' 
    }
    else
    {
        BtnEliminarResumen.disabled = true
        BtnEliminarResumen.className = 'BtnConfirmarEliminarDes' 
    }
    
    i = 0
    var StringBtnEliminarItemClick = ''
    for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
        if (i+1 == ArrayBtnEliminarItemClick.length)
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i]
        }
        else
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i] + "#"
        }
    }
    //Buscar el hidden cItemsEliminarSubForm
    document.getElementById('Documentos_cItemsEliminarDocumentos').value = StringBtnEliminarItemClick
    return false

}
function MostrarDocumentos(){

    ArrayBtnEliminarItemClick = new Array()
    return true

}
function MostrarFormulario(){
    CapaDocumentos.style.display='none'
    CapaContenidoInterior.style.display ='inline'
    document.getElementById("btnMostrarFormulario").style.display='none'  
    document.getElementById("btnMostrarDocumento").style.display='inline'
    return false
}
*/
function AbrirVentana(Ruta)
{
    var NuevaVentana
    var URL = Ruta
    if (Ruta.lastIndexOf("/")>-1){
        StartIndex = Ruta.lastIndexOf("/") + 1
    }
    else{
        StartIndex = 0
    }
        var NombreVentana = Ruta.substring(StartIndex,Ruta.indexOf(".")) //'Informe'
        
    //la barra toolbar se muestra cuando no se trata de la ventana de subida de ficheros
    if (Ruta.indexOf("SubidaFicheros")>-1){
        var Parametros = 'toolbar=0, location=0, directories=0, status=0, menubar=0,scrollbars=1, resizable=1, width=640'
    }
    else{
        var Parametros = 'toolbar=1, location=0, directories=0, status=0, menubar=0,scrollbars=1, resizable=1, width=640'
    }
    NuevaVentana=window.open(URL, NombreVentana, Parametros);  
    return false
}
/*
function MostrarArchivo(Ruta){
    var NuevaVentana
    var NombreVentana = 'Informe'
    var Parametros = 'toolbar=0, location=0, directories=0, status=0, menubar=0,scrollbars=1, resizable=1, width=0, height=0'
    NuevaVentana=window.open("MostrarArchivo.aspx?Ruta=" + Ruta.replace(/#/gi,"/"), NombreVentana, Parametros);  
    return false
}
*/
function AbrirFormPrincipalRedireccion(CodFormulario, Iframe, TipoRedireccion){

    indiceStart = location.href.lastIndexOf("/")
    if(location.href.lastIndexOf("?")>-1){
        indiceStop = location.href.lastIndexOf("?")
    }
    else{
        indiceStop = location.href.length
    }
    NombrePagina = location.href.substring(indiceStart + 1, indiceStop)

    if(TipoRedireccion==0){
        //Iframe
       //this.parent.document.getElementById('iframeFormularioPrincipal').src = "FormularioPrincipal.aspx?CodFormulario=" + CodFormulario     
        this.parent.document.getElementById(Iframe).src=NombrePagina + "?CodFormulario=" + CodFormulario     
    }  
    else if(TipoRedireccion==1){
        //Pagina Aspx
        location.href = NombrePagina + "?CodFormulario=" + CodFormulario
    }
       

    return false
}

function VisibilizarControlFicheros()
{    
    //Visualizar el PnlFrameSubidaFicheros que esta en Principal.aspx
    this.parent.document.getElementById('MasterPagina_CPHContenido_PnlFrameSubidaFicheros').style.display = 'block'
    this.parent.document.getElementById('MasterPagina_CPHContenido_PnlFrameSubidaFicheros').style.visibility = 'visible'
    //Visualizar el PnlFondoFrameSubForm que esta en Principal.aspx
    this.parent.document.getElementById('MasterPagina_CPHContenido_PnlFondoFrameSubidaFicheros').style.display = 'block'
    
    return true
}

function VisualizarBtnsEdicionRepetitiva(ObjetoPulsado, ListaCods)
{
    ArrayCodigoActual = ListaCods.split("#")
    for(i=0;i<ArrayCodigoActual.length;i++){
        if(ArrayCodigoActual[i]!=""){
            //Buscar PnlBtnListaSubForm
            var BtnEliminarItem = document.getElementById(ObjetoPulsado.id.replace('BtnEditar', 'BtnEliminarItem') + i)
            BtnEliminarItem.style.display = 'inline'
        }
    }
    ArrayHiddenNombresBtnEditar=document.getElementById("ContenidoCentral_cConjuntoBtnEditar").value.split("#")
    for(i=0;i<ArrayHiddenNombresBtnEditar.length;i++){
        objeto=document.getElementById("ContenidoCentral_" + ArrayHiddenNombresBtnEditar[i])
        objeto.style.display='none'
    }
    
    
    //ObjetoPulsado.style.display = 'none'

    //Buscar BtnNuevoSubForm
    var BtnNuevo = document.getElementById(ObjetoPulsado.id.replace('Editar', 'Nuevo'))
    BtnNuevo.style.display = 'inline'
    //Buscar BtnEliminarSubForm
    BtnEliminarResumen = document.getElementById(ObjetoPulsado.id.replace('Editar', 'EliminarResumen'))    
    BtnEliminarResumen.style.display = 'inline'
    if (ArrayBtnEliminarItemClick.length > 0)
    {
        BtnEliminarResumen.disabled = false
        BtnEliminarResumen.className = 'BtnConfirmarEliminar' 
    }
    else
    {
        BtnEliminarResumen.disabled = true
        BtnEliminarResumen.className = 'BtnConfirmarEliminarDes' 
    }
    //Buscar BtnCancelarSubForm
    var BtnCancelar = document.getElementById(ObjetoPulsado.id.replace('Editar', 'Cancelar'))    
    BtnCancelar.style.display = 'inline'
    
   
    //Se invisibiliza el boton de edición general
    document.getElementById("ContenidoCentral_btnEditar").style.display='none'
    
    return false
}

function InvisibilizarBtnsEdicionRepetitiva(ObjetoPulsado, ListaCods)
{
    ArrayCodigoActual = ListaCods.split("#")
    for(i=0;i<ArrayCodigoActual.length;i++){
        //Buscar PnlBtnListaSubForm
        var BtnEliminarItem = document.getElementById(ObjetoPulsado.id.replace('BtnCancelar', 'BtnEliminarItem') + i)
        BtnEliminarItem.style.display = 'none'
    }
    
         
    ObjetoPulsado.style.display = 'none'

    //Buscar BtnNuevoSubForm
    var BtnNuevo = document.getElementById(ObjetoPulsado.id.replace('Cancelar', 'Nuevo'))
    BtnNuevo.style.display = 'none'
    //Buscar BtnEliminarSubForm
    BtnEliminarResumen = document.getElementById(ObjetoPulsado.id.replace('Cancelar', 'EliminarResumen'))
    BtnEliminarResumen.style.display = 'none'

    //Se visibilizan todos los botones de editar
    ArrayHiddenNombresBtnEditar=document.getElementById("ContenidoCentral_cConjuntoBtnEditar").value.split("#")
    for(i=0;i<ArrayHiddenNombresBtnEditar.length;i++){
        objeto=document.getElementById("ContenidoCentral_" + ArrayHiddenNombresBtnEditar[i])
        objeto.style.display='inline'
    }
    
     //Se visibiliza el boton de edición general
    document.getElementById("ContenidoCentral_btnEditar").style.display='inline'
    
    return false
}
var ArrayBtnEliminarItemClick = new Array()
function BtnEliminarItemClickRepetitiva(ObjetoPulsado,Cod)
{
    
    if (ObjetoPulsado.className == 'BtnEliminarItem')
    {
        ObjetoPulsado.className = 'BtnEliminarItemSel' 
        
        var ExisteCod = 0
        for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
            if (ArrayBtnEliminarItemClick[i] == Cod)
            {
                ExisteCod = 1
                break
            }
            else
            {
                ExisteCod = 0
            }
        }
        if (ExisteCod == 0)
        {
            ArrayBtnEliminarItemClick.push(Cod)
        }         
        
    }
    else
    {
        ObjetoPulsado.className = 'BtnEliminarItem'
        ArrayBtnEliminarItemClick.pop(Cod)
    }
    //Buscar BtnEliminarResumenSubForm  
    BtnEliminarResumen.value = "eliminar (" + ArrayBtnEliminarItemClick.length + ")"
    if (ArrayBtnEliminarItemClick.length > 0)
    {
        BtnEliminarResumen.disabled = false
        BtnEliminarResumen.className = 'BtnConfirmarEliminar' 
    }
    else
    {
        BtnEliminarResumen.disabled = true
        BtnEliminarResumen.className = 'BtnConfirmarEliminarDes' 
    }
    
    i = 0
    var StringBtnEliminarItemClick = ''
    for(i=0;i<ArrayBtnEliminarItemClick.length;i++){
        if (i+1 == ArrayBtnEliminarItemClick.length)
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i]
        }
        else
        {
            StringBtnEliminarItemClick += ArrayBtnEliminarItemClick[i] + "#"
        }
    }
    //Buscar el hidden cItemsEliminarSubForm
    document.getElementById('ContenidoCentral_cItemsEliminarRepetitiva').value = StringBtnEliminarItemClick
    
    return false
}
function ConfEliminarResumenRepetitiva(){
    ArrayBtnEliminarItemClick   =  new Array()
}
function BtnNuevoResumenRepetitiva(){
    ArrayBtnEliminarItemClick   =  new Array()
}

function ValidacionGuardarFormulario(ObjetoPulsado, FormPublico){

    Indice = ObjetoPulsado.id.lastIndexOf("_")
    Inicio = ObjetoPulsado.id.substring(0,Indice+1)
    PanelMensajeValidaciones = document.getElementById(Inicio + 'PanelMensajeValidaciones')
    PanelMensajeValidaciones.innerHTML = ""
    ul=document.createElement("UL")
    PanelMensajeValidaciones.appendChild(ul)
    
    var ArrayCampoVacio= new Array()
    var Valido = true
    for (i=0;i<ArrayCodigo.length;i++){
        LblCampoEnunciado = document.getElementById(Inicio + 'LblCampoEnunciado' + ArrayCodigo[i])
        if (LblCampoEnunciado != null){ 
            LblCampoEnunciado.style.color = ""
            Obligatorio = ArrayObligatorio[i]
            FormatoVal = ArrayFormatoVal[i]
        
            //si es obligatorio y no esta rellenado se marca en un color
            switch (FormatoVal)
            {
                case 'Texto':
                { //texto normal en txtbox
                    valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                    if((Obligatorio==1)&&(valor=='')){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                            //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                    }
                    break
                }                
                
                case 'Numero':
                {//formato de numerico
                    valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                    if((Obligatorio==1)&&(valor=='')){
                         //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                            //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                    }
                    else if(isNaN(valor)&&(valor!='')){
                        LblCampoEnunciado.style.color = "#ff0000"
                        li=document.createElement("LI")
                        li.innerHTML = LblCampoEnunciado.innerText + ": formato incorrecto numerico" 
                        ul.appendChild(li)
                        Valido = false
                    }
                    break
                
                }
                case 'Email':
                {//formato de email cadena@cadena.cadena[.cadena]
                    valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                    if((Obligatorio==1)&&(valor=='')){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                             //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                    }
                    else if(!EmailValido(valor)){
                        LblCampoEnunciado.style.color = "#ff0000"
                        li=document.createElement("LI")
                        li.innerHTML = LblCampoEnunciado.innerText + ": formato incorrecto email" 
                        ul.appendChild(li)
                        Valido = false
                    }
                    break
                }
                case 'Fecha':
                {//formato de fecha dd/mm/aaaa
                    valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                    if((Obligatorio==1)&&(valor=='')){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                             //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                    }
                    else if(!FechaValida(valor)){
                        //no se permite guardar por no tener formato correcto
                        LblCampoEnunciado.style.color = "#ff0000"
                        li=document.createElement("LI")
                        li.innerHTML = LblCampoEnunciado.innerText + ": formato incorrecto fecha" 
                        ul.appendChild(li)
                        Valido = false
                    }
                    break
                }
                case 'Hora':
                {//formato de hora hh:mm
                    valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                    if((Obligatorio==1)&&(valor=='')){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                             //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                    }
                    else if(!HoraValida(valor)){
                        //no se permite guardar por no tener formato correcto
                        LblCampoEnunciado.style.color = "#ff0000"
                        li=document.createElement("LI")
                        li.innerHTML = LblCampoEnunciado.innerText + ": formato incorrecto hora" 
                        ul.appendChild(li)
                        Valido = false 
                    }
                    break
                
                }
                case 'Radio':
                {//Validacion para un radio
                     Objeto = document.getElementById(Inicio + 'SeleccionCampo' + ArrayCodigo[i])
                     var vacio = true
                     var j=0
                     while((document.getElementById(Objeto.id + "_" + j)!=null) && (vacio==true))
                     {
                        if (document.getElementById(Objeto.id + "_" + j).checked==true){
                            vacio=false
                        }
                        j++
                     }
                     if((Obligatorio==1)&&(vacio==true)){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                             //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                     }
                     break
                }
                case 'Check':
                {//Validacion para un check
                     Objeto = document.getElementById(Inicio + 'SeleccionCampo' + ArrayCodigo[i])
                     var vacio = true
                     var j=0
                     while((document.getElementById(Objeto.id + "_" + j)!=null) && (vacio==true))
                     {
                        if (document.getElementById(Objeto.id + "_" + j).checked==true){
                            vacio=false
                        }
                        j++
                     }
                     if((Obligatorio==1)&&(vacio==true)){
                        //obligatorio y vacio
                        if(FormPublico==1){
                            LblCampoEnunciado.style.color = "#ff0000"
                            li=document.createElement("LI")
                            li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                            ul.appendChild(li)
                            Valido = false
                        }
                        else{//el gestor
                             //se permite guardar aunque este vacio
                            ArrayCampoVacio.push(ArrayCodigo[i])
                        }
                     }
                     break
                }
                default:
                { //texto normal en txtbox
                    if (document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i])!= null){
                        valor=Trim(document.getElementById(Inicio + 'TxtCampo' + ArrayCodigo[i]).value)
                        if((Obligatorio==1)&&(valor=='')){
                            //obligatorio y vacio
                            if(FormPublico==1){
                                LblCampoEnunciado.style.color = "#ff0000"
                                li=document.createElement("LI")
                                li.innerHTML = LblCampoEnunciado.innerText + ": campo vacio" 
                                ul.appendChild(li)
                                Valido = false
                            }
                            else{//el gestor
                                 //se permite guardar aunque este vacio
                                ArrayCampoVacio.push(ArrayCodigo[i])
                            }
                        }
                    }
                    break
                }
            }
        }
    }
    
    if (Valido){
        //se pasa a la parte vb el mensaje de advertencia de validacion a mostrar 
        document.getElementById(Inicio + 'cHiddenMensajeValidacionVacios').value = ArrayCampoVacio 
        return true
    }
    else{
        for(i=0;i<ArrayCampoVacio.length;i++){
             LblCampoEnunciado = document.getElementById(Inicio + 'LblCampoEnunciado' + ArrayCampoVacio[i])
             LblCampoEnunciado.style.color = "#ff0000"
             li=document.createElement("LI")
             li.innerHTML = LblCampoEnunciado.innerText + ": campo vacío" 
             ul.appendChild(li)
        }
        document.getElementById(Inicio + 'PanelValidaciones').style.display="block"
        return false
    }
       
    
}




function Trim(cadena)
{
	for(k=0; k<cadena.length; )
	{
		if(cadena.charAt(k)==" ")
			cadena=cadena.substring(k+1, cadena.length);
		else
			break;
	}

	for(k=cadena.length-1; k>=0; k=cadena.length-1)
	{
		if(cadena.charAt(k)==" ")
			cadena=cadena.substring(0,k);
		else
			break;
	}
	
	return cadena
}

function anyoBisiesto(anyo)
{
    // si el año introducido es de dos cifras lo pasamos al periodo de 1900. Ejemplo: 25 > 1925
    
    if (anyo < 100)
        var fin = anyo + 1900;
    else
        var fin = anyo ;
    // primera condicion: si el resto de dividir el año entre 4 no es cero > el año no es bisiesto
    // es decir, obtenemos año modulo 4, teniendo que cumplirse anyo mod(4)=0 para bisiesto
    if (fin % 4 != 0)
        return false;
    else
    {
        if (fin % 100 == 0)
        {
            // si el año es divisible por 4 y por 100 y divisible por 400 > es bisiesto
            if (fin % 400 == 0)
            {
                return true;
            }
            // si es divisible por 4 y por 100 pero no lo es por 400 > no es bisiesto
            else
            {
                return false;
            }
        }
       
        // si es divisible por 4 y no es divisible por 100 > el año es bisiesto
        else
        {
            return true;
        }
    }
}

function FechaValida(valor)
{
    var a, mes, dia, anyo, febrero;
    // obtenemos la fecha introducida y la separamos en dia, mes y año
    dia=valor.split("/")[0];
    mes=valor.split("/")[1];
    anyo=valor.split("/")[2];
    
    if ((dia.length != 2) || (mes.length != 2) || (anyo.length != 4)) {
        return false
    }
    
    if((isNaN(dia)==true) || (isNaN(mes)==true) || (isNaN(anyo)==true))
    {
        return false;
    }
    if(anyoBisiesto(anyo))
        febrero=29;
    else
        febrero=28;

    // si el mes introducido es negativo, 0 o mayor que 12 > alertamos y detenemos ejecucion
    if ((mes<1) || (mes>12))
    {
    //alert("El mes introducido no es valido. Por favor, introduzca un mes correcto");
        return false;
    }
    
    // si el mes introducido es febrero y el dia es mayor que el correspondiente 
    // al año introducido > alertamos y detenemos ejecucion
    if ((mes==2) && ((dia<1) || (dia>febrero)))
    {
       return false;
    }

    // si el mes introducido es de 31 dias y el dia introducido es mayor de 31 > alertamos y detenemos ejecucion
    if (((mes==1) || (mes==3) || (mes==5) || (mes==7) || (mes==8) || (mes==10) || (mes==12)) && ((dia<1) || (dia>31)))
    {
       return false;
    }

    //si el mes introducido es de 30 dias y el dia introducido es mayor de 301 > alertamos y detenemos ejecucion
    if (((mes==4) || (mes==6) || (mes==9) || (mes==11)) && ((dia<1) || (dia>30)))
    {
       return false;
    }
   
    //si el mes año introducido es menor que 1900 o mayor que 3010 > alertamos y detenemos ejecucion
    //NOTA: estos valores son a eleccion vuestra, y no constituyen por si solos fecha erronea
    if ((anyo<1900) || (anyo>3010))
    {
       return false
    } 

return true
} 

function EmailValido(valor){

     var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/
     return b.test(valor) 
}
function HoraValida(valor){
     var b = /^(0[0-9]|1[0-9]|2[0-3])\:([0-5]0|[0-5][1-9])/
     return b.test(valor)
}
 

/*************************************Finaliza ContenidoCentral.ascx***************************************************/

/*************************************empiezan Javascript para ListadoPaginado.ascx***********************************/

  function MostrarCalendarioPaginacion(txtboxID,textbox)
    {
        var DenInicio = textbox.id.substring(0, textbox.id.lastIndexOf("_")+1)
        
        XCalendario = event.clientX - event.offsetX
        YCalendario = event.clientY - event.offsetY + textbox.offsetHeight
      
        document.getElementById(DenInicio + "pnlCalendarioBuscador").style.left = XCalendario
        document.getElementById(DenInicio + "pnlCalendarioBuscador").style.top = YCalendario
        document.getElementById(DenInicio + "pnlCalendarioBuscador").style.position ='absolute'
        
        calendario = document.getElementById(DenInicio + "pnlCalendarioBuscador")
       
        if ((calendario.style.display=='none')||(txtboxID!=txtboxAnterior)) 
        {
            calendario.style.display ='block'
        }
        else if (calendario.style.display=='block')
        {
            calendario.style.display ='none'
        }
        txtboxAnterior=txtboxID
        document.getElementById(DenInicio + "cTxtCalendario").value=txtboxID
        document.getElementById(DenInicio + "cPosicionAbsolutaCalendario").value = XCalendario + "#" + YCalendario
        
        return false
    }


function ItemAccion(Objeto, Accion, Cod, ASPXRedireccion, e, ParImpar, FrameSuperior)
{
    switch (Accion)
    {
        case EnumTipoEvento.OnClick:
        //click
        {
            if (document.all){ //IE
               ObjetoEvento = event.srcElement
            }
            else{//Firefox
               ObjetoEvento = e.target
            }
            //Objeto.style.backgroundColor = "#0073FF"
            //Objeto.style.color = "#ffffff"
            Objeto.className = 'PnlItemListPagOnClick' + ParImpar
            
            //Cargar el ASPX adecuado, utilizando la funcion LocalizacionASPX
            //que se le pasa como parametro el NivelItem.
            if ((ObjetoEvento.id.lastIndexOf("Eliminar")==-1) && (ObjetoEvento.id.lastIndexOf("NivelInferior")==-1) && (ObjetoEvento.id.lastIndexOf("TextoEnlace")==-1)){
           
                if(FrameSuperior!=''){
                    if (this.parent.document.getElementById(FrameSuperior)== null){
                        //no se encuetra el frame y se redirige a nivel de aspx 
                        this.parent.location.href(ASPXRedireccion + Cod)
                    }
                    else{
                        // se redirige al frame indicado
                        this.parent.document.getElementById(FrameSuperior).src = ASPXRedireccion + Cod 
                    }
                    return false
                }
                else{
                    location.href(LocalizacionASPX(ASPXRedireccion, Cod))
                }
                                
            } 
            else
            {
                if (ObjetoEvento.id.lastIndexOf("ConfirmarEliminar")>-1){return true}
                else if(ObjetoEvento.id.lastIndexOf("NivelInferior")>-1){
                    MostrarNivelInferior(Cod)
                    return false
                }
                else{return false}
            }
                           
        }
        case EnumTipoEvento.OnMouseOver:
        //onmouseover
        {       

            Objeto.className = 'PnlItemListPagOnMouseOver' + ParImpar
        }
        case EnumTipoEvento.OnMouseOut:
        //onmouseout
        {            
            Objeto.className = 'PnlItemListPag' + ParImpar
            break
        }
    }
    
    return false
}

function ItemAccionMiniatura(Objeto, Accion, Cod, ASPXRedireccion, e){
    switch (Accion)
    {
        case EnumTipoEvento.OnClick:
        //click
        {
            if (document.all){ //IE
               ObjetoEvento = event.srcElement
            }
            else{//Firefox
               ObjetoEvento = e.target
            }
            //Objeto.style.backgroundColor = "#0073FF"
            //Objeto.style.color = "#ffffff"
            Objeto.className = 'PnlItemListPagMiniaturaOnClick' 
            
            //Cargar el ASPX adecuado, utilizando la funcion LocalizacionASPX
            //que se le pasa como parametro el NivelItem.
            if ((ObjetoEvento.id.lastIndexOf("Eliminar")==-1) && (ObjetoEvento.id.lastIndexOf("NivelInferior")==-1)){
                location.href(LocalizacionASPX(ASPXRedireccion, Cod))
            } 
            else
            {
                if (ObjetoEvento.id.lastIndexOf("ConfirmarEliminar")>-1){return true}
                else if(ObjetoEvento.id.lastIndexOf("NivelInferior")>-1){
                    MostrarNivelInferior(Cod)
                    return false
                }
                else{return false}
            }
                           
        }
        case EnumTipoEvento.OnMouseOver:
        //onmouseover
        {             
            //Objeto.style.backgroundColor = "#004EDD"
            //Objeto.style.color = "#ffffff"
            Objeto.className = 'PnlItemListPagMiniaturaOnMouseOver' 
            break
        }
        case EnumTipoEvento.OnMouseOut:
        //onmouseout
        {            
            //Objeto.style.backgroundColor = ""
            //Objeto.style.color = ""
            Objeto.className = 'PnlItemListPagMiniatura'
            break
        }
    }
    
    return false
}


function LocalizacionASPX(ASPXRedireccion, Cod){

        // se redirige al nivel que estamos
        RutaASPX = ASPXRedireccion + Cod 
        return RutaASPX
   
}

function BtnMasItemListadoPag(Objeto, Accion)
{
    switch (Accion)
    {
        case EnumTipoEvento.OnClick:
        //click
        { 
            Objeto.className = 'BtnXItemMasSel'
            break
        }
         case EnumTipoEvento.OnMouseOver:
        //onmouseover
        {   
            Objeto.className = 'BtnXItemMasSel'
            break
        }
        case EnumTipoEvento.OnMouseOut:
        //onmouseout
        {       
            Objeto.className = 'BtnXItemMas'
            break
        }
    }
    //return false
}

function MostrarNivelInferior(Cod){   
     /*switch (ZonaAplicacionGlobal)
    {
       case EnumZonaAplicacion.Escenario:
            location.href('PlantasEscenarios.aspx?CodPlanta=' + Cod)
        break
        case EnumZonaAplicacion.Control: 
            location.href('ControlPlantas.aspx?CodPlanta=' + Cod)
        break
        case EnumZonaAplicacion.Profesional: */
            location.href('GestorMenus.aspx?CodNivelCero=' + Cod)
        /*break
    }*/
    
    return false
}

function MostrarBotonConfirmarEliminar(Objeto){

    document.getElementById(Objeto.id.replace("BtnEliminar", "PnlItem")).onclick=''
    document.getElementById(Objeto.id.replace("BtnEliminar", "CeldaTablaTexto")).onclick=''
    
    btnConfirmarEliminar = Objeto.id.replace("BtnEliminar", "BtnConfirmarEliminar")
    
    if(document.getElementById(btnConfirmarEliminar).style.display=='none'){
        document.getElementById(btnConfirmarEliminar).style.display='inline'
    }
    else if(document.getElementById(btnConfirmarEliminar).style.display=='inline'){
        document.getElementById(btnConfirmarEliminar).style.display='none'
    }
      
    return false
}
function PulsarBotonConfirmarEliminar(Objeto){
    document.getElementById(Objeto.id.replace("BtnConfirmarEliminar", "PnlItem")).onclick=''
    document.getElementById(Objeto.id.replace("BtnConfirmarEliminar", "CeldaTablaTexto")).onclick=''
    return true
}
function MostrarConfiguracionPaginacion(objeto){

    DenInicio = objeto.id.substring(0,objeto.id.lastIndexOf("_")+1)

    if (objeto.value.indexOf('mostrar')>-1){
        document.getElementById(DenInicio + 'PanelNumeroItemsPorPagina').style.display='block'
        objeto.value = 'ocultar configuración'
    }
    else{
        document.getElementById(DenInicio + 'PanelNumeroItemsPorPagina').style.display='none'
        objeto.value = 'mostrar configuración'
    }
    return false
}
function MostrarArchivo(Ruta){
    var NuevaVentana
    var NombreVentana = 'Informe'
    var Parametros = 'toolbar=0, location=0, directories=0, status=0, menubar=0,scrollbars=1, resizable=1, width=0, height=0'
    NuevaVentana=window.open("../../MostrarArchivo.aspx?Ruta=" + "../" + Ruta.replace(/#/gi,"/"), NombreVentana, Parametros);  
    return false

}
//////////////////finalizan Javascript para ListadoPaginado.ascx//////////////////////////////////

