﻿    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('menuEstado'); 
      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 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;
}

function validaBusqueda(source, arguments){
    arguments.IsValid = (document.getElementById("ControlCabecera_BuscadorTb").value.Trim().length > 2);
    if (!arguments.IsValid)alert(document.getElementById("ControlCabecera_MenjaseHd").value);
    
}
String.prototype.Trim = function(){return this.replace(/(^\s*)|(\s*$)/g, "");}
String.prototype.LTrim = function(){return this.replace(/(^\s*)/g, "");}
String.prototype.RTrim = function(){return this.replace(/(\s*$)/g, "");}



    



