﻿    document.write("<style>");
    document.write("#contenedor #menuOHL li ul{display:none}");
    document.write("#menuOHL li span{color:#102245;text-decoration: none;font-family:Tahoma;font-size:.83em}");
    document.write("</style>");

window.onload = function () 
{ 
  if (window.document.location.href.indexOf('Default') == -1)
  {
    // preimero comprobamos la queryString
    if (document.getElementById('ControlMenu_IdmHidden').value != '')
    {
      // cazamos la queryString
      MenuSeleccionado = 'li' + document.getElementById('ControlMenu_IdmHidden').value;
      enciendeMenu('li' + document.getElementById('ControlMenu_IdmHidden').value, document.getElementById('ControlMenu_NvlHidden').value, true);
    }
    else
    {
     // si no buscamos la cookie 
     //recuperamos la cookie
      var cookie = leerCookie('menuEstadoIngesan'); 
      if (cookie != '~' && cookie != '' && cookie != null)
      {
        MenuSeleccionado = cookie.split('~')[0];
        enciendeMenu(cookie.split('~')[0], cookie.split('~')[1], true);
      }
    }
  }
}

function IluminaImagen(imagen, ruta)
{
  window.document.getElementById(imagen).src = ruta;
  return false;
}

function abrir(direccion,sWith,sHeigth)
    { 
     var opciones = "fullscreen=0" + 
                 ",toolbar=0" + 
                 ",location=1" + 
                 ",status=1" + 
                 ",menubar=0" + 
                 ",scrollbars=1" + 
                 ",resizable=0" + 
                 ",width=" + sWith +
                 ",height=" + sHeigth +
                 ",left=100" +  
                 ",top=100"; 
                 
                 //650, 400
     var ventana = window.open(direccion,"venta",opciones,1); 
     return false;
     }

function abrirVentana(url, width, height)
{    
  var condiciones = "scrollbars=yes,width=" + width + ",height=" + height + ",resizable=no";
  window.open(url,"", condiciones);
  return false;
}

function abreweb()
  {
  
    var indice = window.document.getElementById("selectwebs").selectedIndex 
    if (indice != 0)
    {
        var valor = "http://" + window.document.getElementById("selectwebs").options[indice].value;
        //var condiciones = "scrollbars=yes,width=800,height=600,resizable=yes";
        window.open(valor,"");
    }
  }
  
function BloqueaCombo(combo,valor)
{
 window.document.getElementById(combo).disabled = valor;
}

function BloqueaComboPosicion(combo)
{
  window.document.getElementById(combo).selectedIndex = 0;
  window.document.getElementById(combo).disabled = true;
}

function VaciaCampoDDL(campo)
{
  window.document.getElementById(campo).selectedIndex = 0;  
}

function VaciaCampoTxt(campo)
{
  window.document.getElementById(campo).value = "";
}

function visibilidadTabla(campo,valor)
{
  window.document.getElementById(campo).visible = valor;
}
