/***********************************************
* AnyLink Drop Down Menu- Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menus
/* Dynamic Dropdowns...keep for future development
    <c:forEach items="${headerChildren}" var="currentMenuItem" varStatus="stats">
        var menu<c:out value="${currentMenuItem.key}" />=new Array()
<c:forEach items="${currentMenuItem.value}" var="item" varStatus="stats2">
    <c:if test="${item.navType != 'vb' && item.depth == 2}">
menu<c:out value="${currentMenuItem.key}" />[<c:out value="${stats2.index}" />]='<a href="<c:out value="${item.uri}" />" class="mainNavDropdown"><c:out value="${item.label}" /> </a>'
    </c:if>
</c:forEach>
    </c:forEach>
*/

// Quienes Somos
var menu3=new Array()
var ssLink="//Quienes Somos// Que Ofrecemos";
var smtLink="//Quienes Somos//Misión y Visión ";
var bodLink="//Quienes Somos//Nuestros Servicios";
var jobsLink="//Quienes Somos//Nuestros Clientes";

menu3[0]='<a href="presentacion.php?id=ES" onclick="_hbLink(ssLink);" class="mainNavDropdown" title="Presentacion">Presentacion</a>'
menu3[1]='<a href="vision.php?id=ES" onclick="_hbLink(smtLink);" class="mainNavDropdown" title="Vision y Mision">Vision y Mision</a>'
menu3[2]='<a href="filosofia.php?id=ES" onclick="_hbLink(bodLink);" class="mainNavDropdown" title="Filosofia del Grupo">Filosofia del Grupo</a>'
menu3[3]='<a href="logotipo.php?id=ES" onclick="_hbLink(jobsLink);" class="mainNavDropdown" title="Logotipo">Logotipo</a>'
menu3[4]='<a href="organigrama.php?id=ES" onclick="_hbLink(jobsLink);" class="mainNavDropdown" title="Estructura Corporativa">Estructura Corporativa</a>'
menu3[5]='<a href="politica_corp.php?id=ES" onclick="_hbLink(jobsLink);" class="mainNavDropdown" title="Politica Corporativa">Politica Corporativa</a>'
menu3[6]='<a href="preguntas.php?id=ES" onclick="_hbLink(jobsLink);" class="mainNavDropdown" title="Preguntas Frecuentes">Preguntas Frecuentes</a></a>'
menu3[7]='<a href="imagenes.php?id=ES" onclick="_hbLink(jobsLink);" class="mainNavDropdown" title="Galeria de Imagenes">Galeria de Imagenes</a>'


// Empresas del Grupo
var menu4=new Array()
var adLink="//Empresas del Grupo//Solmar Security";
var bcLink="//Empresas del Grupo//Solmar Training";
var diLink="//Empresas del Grupo//Solmar Fishing";
var dwLink="//Empresas del Grupo//Solmar Consulting";
var dwLink="//Empresas del Grupo//Solmar Suply";

menu4[0]='<a href="security.php?id=ES" onclick="_hbLink(dmLink);" class="mainNavDropdown" title="Solmar Security">Solmar Security</a>'
menu4[1]='<a href="training.php?id=ES" onclick="_hbLink(bcLink);" class="mainNavDropdown" title="Solmar Training">Solmar Training</a>'
menu4[2]='<a href="fishing.php?id=ES" onclick="_hbLink(diLink);" class="mainNavDropdown" title="Solmar Fishing">Solmar Fishing</a>'
menu4[3]='<a href="consulting.php?id=ES" onclick="_hbLink(anLink);" class="mainNavDropdown" title="Solmar Consulting">Solmar Consulting</a>'
menu4[4]='<a href="suply.php?id=ES" onclick="_hbLink(anLink);" class="mainNavDropdown" title="Solmar Suply">Solmar Supply</a>'


// Herramientas
var menu113017=new Array()
var osLink="//Empresas del Grupo//Solmar Security";
var bcsLink="//Empresas del Grupo//Solmar Trining";
var esLink="//Empresas del Grupo//Solmar Fishing";
var msLink="//Empresas del Grupo//Solmar Consulting";
var msLink="//Empresas del Grupo//Solmar Suply";

menu113017[0]='<a href="diccionario.php?id=ES" onclick="_hbLink(osLink);" class="mainNavDropdown" title="Diccionarios Nauticos">Diccionarios Náuticos</a>'
menu113017[1]='<a href="tupac.php?id=ES" onclick="_hbLink(bcsLink);" class="mainNavDropdown" title="Tupa">Tupa</a>'
menu113017[2]='<a href="mapsitie.php?id=ES" onclick="_hbLink(esLink);" class="mainNavDropdown" title="Mapa del Sitio">Mapa del Sitio</a>'
menu113017[3]='<a href="enlaces.php?id=ES" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Enlaces">Enlaces</a>'
menu113017[4]='<a href="http://200.110.29.117/" onclick="_hbLink(msLink);" class="mainNavDropdown" title="EXTRANET">EXTRANET</a>'
menu113017[5]='<a href="http://200.110.29.117/Monitor_Consultas/" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Monitor">MONITOR</a>'
menu113017[6]='<a href="http://200.110.29.117/sip/" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Monitor">Sistema de Informacion Personal (SIP)</a>'



//Noticias
var menu26=new Array()
/*var csLink="//noticias";
var msLink="//noticias";
var esLink="//noticias";*/
menu26[0]='<a href="Noticias.php?id=ES" onclick="_hbLink(csLink);" class="mainNavDropdown" title="Noticias">Noticias SOLMAR</a>'
menu26[1]='<a href="empresa_basc2008.php?id=ES" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Empresa del Año">Empresa del Año</a>'
menu26[2]='<a href="multimedia.php?id=ES" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Especial Multimedia">Especial Multimedia</a>'
menu26[3]='<a href="publicidad.php?id=ES" onclick="_hbLink(csLink);" class="mainNavDropdown" title="Publicidad">Publicidad</a>'

//target="_blank"

//Mapa del sitio
var menu6=new Array()
var asLink="//Mapa del sitio";
var tdLink="//Mapa del sitio";
var pmLink="//Mapa del sitio";


// contactenos
var menu9=new Array()
var eplLink="//Contacto//Contactos";
var etb2Link="//Escribanos//Escribanos";
menu9[0]='<a href="mapasitio.php?id=ES" onclick="_hbLink(csLink);" class="mainNavDropdown" title="Contactos">Ubicanos</a>'
menu9[1]='<a href="mailto:webmaster@gruposolmar.com.pe" onclick="_hbLink(csLink);" class="mainNavDropdown" title="Contactos">Contactos</a>'
menu9[2]='<a href="sugerencias.php?id=ES" onclick="_hbLink(msLink);" class="mainNavDropdown" title="Sugerencias">Sugerencias</a>'

// Placeholder menu for MySybase
var menu2=new Array()

var menuwidth='180px' //default menu width
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

var xOffset = -18; // number of pixels to offset menu right or left
var yOffset = 8; // number of pixels to offset menu up or down

/////No further editting needed
var ie4=document.all
var ie5_5=typeof dropmenuiframe=='undefined'? 0 : 1
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="z-index:100;visibility:hidden;width:'+menuwidth+';" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
    if (ie4||ns6)
    dropmenuobj.style.left=dropmenuobj.style.top='-500px'
    dropmenuobj.widthobj=dropmenuobj.style
    //dropmenuobj.widthobj.width=menuwidth
    if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
        obj.visibility=visible;
        unhideIframe();
    } else if (e.type=="click") {
        setTimeout("hideIframe();",0);
        obj.visibility=hidden
    }
}


function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
    if (ie4||ns6)
        dropmenuobj.innerHTML=what.join("")
    }

function dropdownmenu(obj, e, menucontents, menuwidth){
if (menucontents.length > 0) {
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left") + xOffset;
dropmenuobj.y=getposOffset(obj, "top") + yOffset;
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
unhideIframe()
}

return clickreturnvalue()
}
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
hideIframe()
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes") {
document.onclick=delayhidemenu
}

// Hide IFrame
function hideIframe() {
if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
theIframe.style.display = "none";
}
}

// Unhide IFrame
function unhideIframe() {
if (ie5_5){
var theIframe = document.getElementById("dropmenuiframe")
var theDiv = document.getElementById("dropmenudiv");
theIframe.style.width = theDiv.offsetWidth+'px';
theIframe.style.height = theDiv.offsetHeight+'px';
theIframe.style.top = theDiv.offsetTop+'px';
theIframe.style.left = theDiv.offsetLeft+'px';
theIframe.style.display = "block";
}
}

