function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } function BuildMenu() { //detect menu span and position var PositionSpan=document.getElementById('MenuPositionSpan') var left_pos=findPosX(PositionSpan); var top_pos=findPosY(PositionSpan); // MM modification ----------- var rightFactor = 0; var topFactor = 0; // --------------------------- //detect browser type //bwExplorer = (navigator.appName == 'Microsoft Internet Explorer') ? "True" : "False"; bwNetscape = (navigator.appName == 'Netscape') ? "True" : "False"; agent = navigator.userAgent; if (((agent.toLowerCase().indexOf('opera 7')>-1) || (agent.toLowerCase().indexOf('opera/7')>-1))) {bwOpera = "True";} else {bwOpera = "False";} //defining styles for different browsers var TOP_STYLE_ON = "TopOn"; // MM ------------------------------------ var TOP_STYLE_ON_RED = "TopOnRed"; //---------------------------------------- var TOP_STYLE_OVER = "TopOver"; var SUB_STYLE_ON = "SubOn"; var SUB_STYLE_OVER = "SubOver"; var SUB_STYLE_ON_BOTTOM = "SubOnBottom"; var SUB_STYLE_OVER_BOTTOM = "SubOverBottom"; opera_pos = 1; level_off = 16; if (bwNetscape == "True") { opera_pos = 1; level_off = 16; TOP_STYLE_ON = "TopOn"; TOP_STYLE_OVER = "NetscapeTopOver"; SUB_STYLE_ON = "SubOn"; SUB_STYLE_OVER = "NetscapeSubOver"; SUB_STYLE_ON_BOTTOM = "SubOnBottom"; SUB_STYLE_OVER_BOTTOM = "SubOverBottom"; } if (bwOpera == "True") { opera_pos = 4; level_off = 18; TOP_STYLE_ON = "OperaTopOn"; TOP_STYLE_OVER = "OperaTopOver"; SUB_STYLE_ON = "SubOn"; SUB_STYLE_OVER = "SubOver"; SUB_STYLE_ON_BOTTOM = "SubOnBottom"; SUB_STYLE_OVER_BOTTOM = "SubOverBottom"; } // początek menu //Definition of menu items //Item attributes : itemName, itemPosition[left,top], itemSize[height,width], itemOff[left,top], // itemLevelOff[left,top], itemUrl, itemStyle[styleOn, styleOff], itemDescription var defLeft = rightFactor + left_pos + opera_pos; var defTop = topFactor + top_pos + opera_pos; var skodaTopMenuItems = [ // default value for first level - position, size, item off, style nad url {"itemPosition": [defLeft, defTop], "itemSize": [12,90], "itemOff": [90,0], "itemStyle": [TOP_STYLE_ON, TOP_STYLE_OVER], "itemUrl": "none"}, {"itemName": "", "itemSize": [16, 0], "itemOff": [0 ,0], "itemUrl": "main.php?fid=116&pg=4", "itemDescription": "","itemSubMenu": [ {"itemSize": [24, 140], "itemOff": [0,24], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"}, {"itemName": "", "itemUrl": "none", "itemDescription": "", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]} ]}]; SkodaMenu(skodaTopMenuItems); menuBuilded=true; } var menuBuilded=false; function onResizeRebuildMenu() { if (!menuBuilded) return; try { if (document.getElementById('MainMenuSpan') != null) {document.body.removeChild(document.getElementById('MainMenuSpan'));} }catch(e){} BuildMenu(); }