function getElementPosition(elemID) { var offsetTrail = document.getElementById(elemID); var offsetLeft = 0; var offsetTop = 0; while (offsetTrail) { offsetLeft += offsetTrail.offsetLeft; offsetTop += offsetTrail.offsetTop; //alert (offsetTrail.offsetLeft); offsetTrail = offsetTrail.offsetParent; } if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined") { offsetLeft += document.body.leftMargin; offsetTop += document.body.topMargin; } return {left:offsetLeft, top:offsetTop}; } function SubRiallinea(avvio){ larghezza=33; agt = navigator.userAgent.toLowerCase(); is_gecko = (agt.indexOf('gecko') != -1); if (document.all || is_gecko) { oCMenu.fromTop=getElementPosition("myMenu").top; oCMenu.fromLeft = getElementPosition("myMenu").left; } else { //alert(avvio); if (avvio==1){ if (window.outerWidth>760) oCMenu.fromLeft=((window.outerWidth-760)/2)+larghezza; if (window.outerWidth<=760) oCMenu.fromLeft=larghezza; } else { document.reload; } } } function Riallinea() { SubRiallinea(0); oCMenu.isresized=1; oCMenu.construct(1); } /*** This is the menu creation code - place it right after you body tag Feel free to add this to a stand-alone js file and link it to your page. **/ if ((document.all) || (navigator.userAgent.toLowerCase().indexOf('gecko') != -1)) { //Menu object creation oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname //Menu properties oCMenu.pxBetween=0 window.onload = Riallinea; window.onresize = Riallinea; oCMenu.fromTop=getElementPosition("myMenu").top; oCMenu.fromLeft=getElementPosition("myMenu").left; oCMenu.rows=0; oCMenu.menuPlacement="left"; oCMenu.offlineRoot="/" oCMenu.onlineRoot="" oCMenu.resizeCheck=0 //1 oCMenu.wait=1000 oCMenu.fillImg="cm_fill.gif" oCMenu.zIndex=0 //Background bar properties oCMenu.useBar=0 oCMenu.barWidth="100%" oCMenu.barHeight="menu" oCMenu.barClass="clBar" oCMenu.barX=0 oCMenu.barY=0 oCMenu.barBorderX=0 oCMenu.barBorderY=0 oCMenu.barBorderClass="" //Level properties - ALL properties have to be specified in level 0 oCMenu.level[0]=new cm_makeLevel() //Add this for each new level oCMenu.level[0].height=18 oCMenu.level[0].regClass="clLevel0" oCMenu.level[0].overClass="clLevel0over" oCMenu.level[0].borderX=0 oCMenu.level[0].borderY=0 oCMenu.level[0].borderClass="clLevel0border" oCMenu.level[0].offsetX=15 oCMenu.level[0].offsetY=0 oCMenu.level[0].rows=0 oCMenu.level[0].align="right" //EXAMPLE SUB LEVEL[1] PROPERTIES - You have to specify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this oCMenu.level[1]=new cm_makeLevel() //Add this for each new level (adding one to the number) oCMenu.level[1].width=145 oCMenu.level[1].height=22 oCMenu.level[1].regClass="clLevel1" oCMenu.level[1].overClass="clLevel1over" oCMenu.level[1].borderX=1 oCMenu.level[1].borderY=1 oCMenu.level[1].align="right" oCMenu.level[1].offsetX=0 oCMenu.level[1].offsetY=0 oCMenu.level[1].borderClass="clLevel1border" //EXAMPLE SUB LEVEL[2] PROPERTIES - You have to specify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this oCMenu.level[2]=new cm_makeLevel() //Add this for each new level (adding one to the number) oCMenu.level[2].width=130 oCMenu.level[2].height=22 oCMenu.level[2].offsetX=0 oCMenu.level[2].offsetY=0 oCMenu.level[2].borderX=1 oCMenu.level[2].borderY=1 oCMenu.level[2].align="right" oCMenu.level[2].regClass="clLevel2" oCMenu.level[2].overClass="clLevel2over" oCMenu.level[2].borderClass="clLevel2border" myURL= document.location.href.substr(document.location.host.length + 8,document.location.href.length) /****************************************** Menu item creation: myCoolMenu.makeMenu(name, parent_name, text, link, target, width, height, regImage, overImage, regClass, overClass , align, rows, nolink, onclick, onmouseover, onmouseout) *************************************/ if (myURL.substr(0,12)!='/default.asp') oCMenu.makeMenu('top0','','','/default.asp','','183','24','/images/menu/menu-home_careers.gif','/images/menu/menu-home_careers_on.gif') else oCMenu.makeMenu('top0','','','','','183','24','/images/menu/menu-home_careers_on.gif') if (myURL.substr(0,10)!='storia.asp') oCMenu.makeMenu('top1','','','/storia.asp','','183','24','/images/menu/menu-storia_careers.gif','/images/menu/menu-storia_careers_on.gif') else oCMenu.makeMenu('top1','','','','','183','24','/images/menu/menu-storia_careers_on.gif') if (myURL.substr(0,8)!='servizi/') oCMenu.makeMenu('top2','','','/servizi/','','183','23','/images/menu/menu-servizi_careers.gif','/images/menu/menu-servizi_careers_on.gif') else oCMenu.makeMenu('top2','','','/servizi/','','183','23','/images/menu/menu-servizi_careers_on.gif') oCMenu.makeMenu('sub21','top2','Per chi cerca lavoro','/servizi/','',150) oCMenu.makeMenu('sub211','sub21','Colloqui di orientamento','/servizi/cerca/colloqui/default.asp?T=Orientamento','',150) oCMenu.makeMenu('sub212','sub21','Correzione CV e Lettera','/servizi/cerca/colloqui/default.asp?T=Correzione','',150) oCMenu.makeMenu('sub213','sub21','Workshop','/servizi/cerca/seminari/default.asp?T=Workshop','',150) oCMenu.makeMenu('sub214','sub21','Incontri Professionisti','/servizi/cerca/seminari/default.asp?T=IoAlLavoro','',150) oCMenu.makeMenu('sub215','sub21','Offerte Tirocinio','/servizi/cerca/offerte/default.asp?T=Tirocinio','',150) oCMenu.makeMenu('sub216','sub21','Sala Consultazione','/servizi/cerca/consultazione/','',150) oCMenu.makeMenu('sub22','top2','Per chi offre lavoro','/servizi/','',150) oCMenu.makeMenu('sub221','sub22','Collabora con Noi','/servizi/offre/introduzione/','',150) oCMenu.makeMenu('sub222','sub22','Offerte Tirocinio','/servizi/offre/offerte/default.asp?T=Tirocinio','',150) oCMenu.makeMenu('sub223','sub22','Visti per Voi','/servizi/offre/vistipervoi/','',150) oCMenu.makeMenu('sub224','sub22','Presentazioni aziendali','/servizi/offre/presentazioni/','',150) if (myURL.substr(0,12)!='missione.asp') oCMenu.makeMenu('top3','','','/missione.asp','','183','23','/images/menu/menu-missione_careers.gif','/images/menu/menu-missione_careers_on.gif') else oCMenu.makeMenu('top3','','','','','183','23','/images/menu/menu-missione_careers_on.gif') if (myURL.substr(0,10)!='valori.asp') oCMenu.makeMenu('top4','','','/valori.asp','','183','23','/images/menu/menu-valori_careers.gif','/images/menu/menu-valori_careers_on.gif') else oCMenu.makeMenu('top4','','','','','183','23','/images/menu/menu-valori_careers_on.gif') if (myURL.substr(0,11)!='partner.asp') oCMenu.makeMenu('top5','','','/partner.asp','','183','24','/images/menu/menu-partner_careers.gif','/images/menu/menu-partner_careers_on.gif') else oCMenu.makeMenu('top5','','','','','183','24','/images/menu/menu-partner_careers_on.gif') if (myURL.substr(0,13)!='dovesiamo.asp') oCMenu.makeMenu('top6','','','/dovesiamo.asp','','183','22','/images/menu/menu-info_careers.gif','/images/menu/menu-info_careers_on.gif') else oCMenu.makeMenu('top6','','','','','183','22','/images/menu/menu-info_careers_on.gif') oCMenu.makeMenu('top7','','','','','183','24','/images/menu/menu-down_careers.gif','','','','','','true') //Leave this line - it constructs the menu oCMenu.construct() } //solo explorer / gecko