document.write('
'); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); document.write(''); /* Script produced by Aaron Group info@aarongroup.cz, http://www.aarongroup.cz/ version 1.37 (21/05/2003) */ /////////////////////////////// public functions /////////////////////////////////// /* function mn_showMenu(number of menu); Opens top-level menu function mn_outOfMenu(); Closes all menu after timeout function mn_itemOn(name of item); Opens next level menu if any function mn_itemOff(name of item); Closes submenu if any Name of item MUST BE IN ITS STANDARD FORM e.g. "item4_5.2" where 4 is top-level menu, 5 is second-level menu and 2 is order of item in this menu. If "mn_firstMenuTimeout" variable is set than first top-level menu will be opened after specified timeout. If "mn_widthOfScreen" and/or "mn_heightOfScreen" variable is set then all menu are positioning relatively to that default value. (suitable for centered content when window resize event occures) If "mn_doNotHideFlash" is set to true and IE6 detected, Flash is not hidden if menu opens above it. If "mn_relativePositions" array is set then new opening menu is relatively positioned to element with id which consist of "mn_glue" + menu number, eg. "mn_glue3" for top-level menu number 3. Under 'x' is set movement (positive or negative) to right, under 'y' is set the same way movement down. Under 'inheritWidth' is boolean if menu should inherit width from element which is associated to. Under 'direction' is set direction where menu is open. All other functions are for privat purposes ONLY! ALERT! All OBJECT tags with FLASH must be enclosed by DIV with absolute or relative pos. */ ///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////// global variables /////////////////////////////////// var mn_menuCount = 0; //count of top-level menu var mn_is = new mn_Is(); //browser specific object var mn_menuPosition = new Array; //positions of top-level menu var mn_inSubmenu = 0; //indicates status var mn_lastItem = ""; //last active item var mn_lastItemCount = 0; //count of items in last active menu var mn_tiktak = null; //timeout for IE var mn_tiktakParam = 0; //for passing values with setTimeout function var mn_tiktak2 = null; //timeout for showing first top level menu var mn_combos = new Array; //array of ALL dangerous objects - DOM objects var mn_forbidden = new Array; //array of ALL dangerous objects - mn_DOMObject var mn_hiddenInputs = new Array; //array of combo-boxes hidden by each opened menu var mn_inTopMenu = false; //indicates if any top-level menu mn_is open var mn_widthOfScreen; //constant to which are menu positions compared to var mn_heightOfScreen; //constant to which are menu positions compared to var mn_firstMenuTimeout; //timeout for opening of first top-level menu var mn_dangerous = null; var mn_openedMenus = new Array; var mn_hiddenDangerous = new Array; var mn_newTopLevel = null; //id of new opened top level menu var mn_doNotHideFlash; //if true and IE6 detected -> Flash stay untouched var mn_relativePositions; //array('x' => 'move opening menu in X axis', 'y' => 'move in Y axis, // 'inheritWidth' => true|false, 'direction' => 'up|down|right|left') var submenuLeftOffset = -1; //-10 var submenuTopOffset = 0; //5 ///////////////////////////////////////////////////////////////////////////////////// //browser sniffer-object function mn_Is() { var agt=navigator.userAgent.toLowerCase(); var major = parseInt(navigator.appVersion); this.ie=((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1))?1:0; this.ie6 = (this.ie && (major == 4) && (agt.indexOf("msie 6.")!=-1) ) ? 1:0; this.gecko = (agt.indexOf('gecko') != -1)?1:0; this.dom=document.getElementById?1:0; this.ie4=(document.all && !this.dom)?1:0; this.ns4=(document.layers && !this.dom)?1:0; return this; } //object representing one combo, flash... function mn_DOMObject(reference) { this.el = reference; this.css = reference.style; this.topLeft = 0; this.topTop = 0; var ob = reference; if(reference.tagName == 'OBJECT' && mn_is.gecko) { ob = ob.offsetParent; } //counting position while(ob && ob.tagName != "BODY") { this.topLeft += ob.offsetLeft; this.topTop += ob.offsetTop; ob = ob.offsetParent; } this.bottomRight = this.topLeft + this.el.offsetWidth; this.bottomBottom = this.topTop + this.el.offsetHeight; return this; } //creates object representing one menu (DIV) function mn_referDIV(name, middle) { var refToDIV; if(mn_is.ns4) refToDIV = eval("document.layers['" + middle + name + "']"); else if(mn_is.dom) refToDIV = eval("document.getElementById('" + middle + name + "')"); else refToDIV = eval("document.all." + middle + name); this.el = (refToDIV) ? refToDIV : 0; if(this.el) { this.css = mn_is.ns4 ? this.el : this.el.style; this.y = this.css.top; this.x = this.css.left; this.h = mn_is.ns4 ? this.el.clip.height : this.el.offsetHeight; this.w = mn_is.ns4 ? this.el.clip.width : this.el.offsetWidth; this.id = middle+""+name; } return this; } //return browser specific available screen width function mn_screenWidth() { if (mn_is.ns4 || (mn_is.dom && !mn_is.ie)) return window.innerWidth; else return document.body.clientWidth; } //return browser specific available screen height function mn_screenHeight() { if(mn_is.ns4 || (mn_is.dom && !mn_is.ie)) return window.innerHeight; else return document.body.clientHeight; } function makeOpened(obj, visib) { this.el = obj; this.visible = visib; return this; } //switches object visibility and hides/makes visible dangerous objects(combos, flash...) function mn_visib(obj, switcher) { var par, par_ref, parInd; if(!obj.el) return; if(mn_is.dom && switcher) { var openingMenu = new mn_DOMObject(obj.el); mn_hiddenInputs[obj.id] = new Array; if(mn_dangerous.count && (mn_dangerous.screenWidth != mn_screenWidth() ) ) //only in DOM mn_dangerous = new mn_Dangerous(); } if(mn_is.dom && obj.id.substr(0,4) == 'menu') { var index = mn_openedMenus.length; for(k = 0; k < mn_openedMenus.length; k++) { if(mn_openedMenus[k].el.id == obj.id) { index = k; break; } } mn_openedMenus[index] = (switcher) ? new makeOpened(obj, 'Y') : new makeOpened(obj, 'N'); } if(mn_is.dom) mn_hideDangerous(); obj.css.visibility = (switcher) ? "visible" : "hidden"; //changing visibility of menu } function mn_hideDangerous() { var danger = null; var opMenu = null; var openedMenu = null; var tmpHidden = new Array(); var index = 0; var hiddenNow = false; if(!mn_dangerous) return; var dTags = mn_dangerous.objects; if(!mn_is.gecko) //browser specific behaviour dTags = dTags.concat(mn_dangerous.selects); /* var citac = 0; var ot = new Array; for(z = 0; z < mn_openedMenus.length; z++) if(mn_openedMenus[z].visible == 'Y') { citac++ ot.push(mn_openedMenus[z].el.id); } */ for(m = 0; m < dTags.length; m++) { danger = dTags[m]; hiddenNow = false; for(n = 0; n < mn_openedMenus.length; n++) { opMenu = mn_openedMenus[n]; if(opMenu.visible != 'Y') continue; openedMenu = new mn_DOMObject(opMenu.el.el); if( !(danger.bottomBottom < openedMenu.topTop || danger.topTop > openedMenu.bottomBottom || danger.bottomRight < openedMenu.topLeft || danger.topLeft > openedMenu.bottomRight) ) { danger.css.visibility = "hidden"; tmpHidden[index++] = danger; hiddenNow = true; } } if(!hiddenNow) { for(k = 0; k < mn_hiddenDangerous.length; k++) if(mn_hiddenDangerous[k] == danger) { danger.css.visibility = 'visible'; } } } mn_hiddenDangerous = tmpHidden; } //set the distance of DIV from the top of the available window function mn_setTop(obj, val) { if(!obj.el) return; obj.css.top = (mn_is.ns4) ? val : val+"px"; } //set the distance of DIV from the left of the available window function mn_setLeft(obj, val) { if(!obj.el) return; obj.css.left = (mn_is.ns4) ? val : val+"px"; } function mn_setWidth(obj, val) { if(!obj) return; obj.style.width = (mn_is.ns4) ? val : val+"px"; } //mn_show DIV of menuNum number function mn_show(menuNum) { var ref; clearTimeout(mn_tiktak); var aktWidthOfScreen = mn_screenWidth(); var aktHeightOfScreen = mn_screenHeight(); ref = new mn_referDIV(menuNum, 'menu'); //centring if(mn_menuPosition[menuNum]) { if(mn_widthOfScreen) { //adjust position from left var k = 0; if(aktWidthOfScreen > mn_widthOfScreen) k = parseInt((aktWidthOfScreen - mn_widthOfScreen)/2); var roz = parseInt(mn_menuPosition[menuNum][2]) + k; mn_setLeft(ref, roz); } if(mn_heightOfScreen) { //adjust position from top var m = 0; if(aktHeightOfScreen > mn_heightOfScreen) m = parseInt((aktHeightOfScreen - mn_heightOfScreen)/2); var top = parseInt(mn_menuPosition[menuNum][3]) + m; mn_setTop(ref, top); } } if(mn_is.dom) { var glue = new mn_referDIV("mn_glue" + menuNum, ''); if(glue.el) { var relative2 = new mn_DOMObject(glue.el); if(mn_is.dom && mn_relativePositions['inheritWidth']) { //adjust menu width in regard of given element var tableChilds = ref.el.getElementsByTagName('TABLE'); if(tableChilds[0]) { //first table in menu DIV mn_setWidth(tableChilds[0], glue.w); ref = new mn_referDIV(menuNum, 'menu'); //both width and height has been changed } } if(mn_relativePositions['direction'] == 'up') { mn_setTop(ref, relative2.topTop + mn_relativePositions['y'] - ref.h); mn_setLeft(ref, relative2.topLeft + mn_relativePositions['x']); } else if(mn_relativePositions['direction'] == 'left') { mn_setTop(ref, relative2.topTop + mn_relativePositions['y']); mn_setLeft(ref, relative2.topLeft + mn_relativePositions['x'] - ref.w); } else if(mn_relativePositions['direction'] == 'right') { mn_setTop(ref, relative2.topTop + mn_relativePositions['y']); mn_setLeft(ref, relative2.bottomRight + mn_relativePositions['x']); } else { //default: show menu down mn_setTop(ref, relative2.bottomBottom + mn_relativePositions['y']); mn_setLeft(ref, relative2.topLeft + mn_relativePositions['x']); } } } mn_visib(ref,1); } //returns level of item in menu hierarchy function mn_level(item) { for(var i=1, c=0; i<=item.length; i++) if(item.charAt(i) == '_') c++ ; return c; } //highlights actual selected menu item and closes some menu function mn_tabSel(itemNum) { var pol, pr, ind, menu, pom, pom2, lastI, lastM, lastN, parent; mn_inSubmenu = 1; clearTimeout(mn_tiktak); if(mn_level(itemNum) < mn_level(mn_lastItem)) { ind = mn_lastItem.lastIndexOf("."); pr = mn_lastItem.substr(0,ind); menu = new mn_referDIV(pr, 'menu'); mn_visib(menu,0); //close submenu of last active menu menu = new mn_referDIV(pr + '_' + mn_lastItem.substr(ind+1), 'menu'); mn_visib(menu,0); //close all previous menu opened before the last active lastI = mn_lastItem; while(lastI.length > 1) { pom = lastI.lastIndexOf("_"); lastM = lastI.substr(0, pom); //do not close menu which became active and its supmenu if(lastM == itemNum.substr(0,itemNum.indexOf(".")) ) break; menu = new mn_referDIV(lastM, 'menu'); mn_visib(menu, 0); lastI = lastM; } } } //disable highlighting of actual menu item function mn_tabUnSel(itemNum) { var k,menu,pol; mn_lastItem = itemNum; mn_inSubmenu = 0; mn_hideAllUnder(); } //onmousedown event-handler for non-IE browsers (designed for Netscape 6+ and other Gecko-based browsers) function mn_preHide(e) { mn_inTopMenu = false; mn_hide(e); } //if safe calls mn_hideMenu function function mn_hide(e) { var ref, obj, source; //initialise mn_menuCount in first-time calling - maximum 100 if(!mn_menuCount) { mn_init(); //identifies dangerous object (mn_combos, flash...) which could overlay menu } //do not close menu if user clicked on link endings with # (it opens submenu or is not a hyperlink) if(e) { if(mn_is.ns4) { ref = new String(e.target); if(ref.substr(-1,1) == "#") { mn_inTopMenu = true; return false; } } else { for(var el=e.target;el;el=el.parentNode) { if(el.href) { ref = new String(el.href); if(ref.substr(-1,1) == "#") { mn_inTopMenu = true; return false; } else { window.location = el.href; if(e.cancelable) e.preventDefault(); //because of Mozilla and Opera which runs javascripts URL links twice } } } //alert(show_props(e.target, 'event')); //if(e.cancelable) // e.preventDefault(); //because of Mozilla and Opera which runs javascripts URL links twice //e.stopPropagation(); } //else } else if(window.event) { if(window.event.srcElement) { a = window.event.srcElement.href; if( a && (window.event.type == 'click') && (window.event.srcElement.href) && (a.substr(a.length-1,1) == "#") ) { mn_inTopMenu = true; return false; } else if( window.event.type == 'click' ) mn_inTopMenu = false; } } mn_hideMenu(); } //close all menu in actual level function mn_hideSub(actual) { var i, menu; i = mn_lastItem.substr(mn_lastItem.lastIndexOf(".")+1); menu = new mn_referDIV(actual+'_'+i, 'menu'); mn_visib(menu, 0); } //start timeout for auto-closing of all menu function mn_hideAllUnder() { if(mn_is.ie) mn_tiktak = setTimeout("mn_hid()", 1000); } //close all supmenu, actual menu and submenu function mn_hideMenu() { var menu, i, j, lastM, lastI, pom; for(i=1; i<=mn_menuCount; i++) { if(mn_newTopLevel == i) continue; menu = new mn_referDIV(i, 'menu'); mn_visib(menu,0); } //hide submenu of the last actual pom = mn_lastItem.lastIndexOf("."); lastM = mn_lastItem.substr(0, pom); lastI = mn_lastItem.substr(pom+1); menu = new mn_referDIV(lastM+"_"+lastI, 'menu'); mn_visib(menu, 0); if(mn_newTopLevel == lastM) return; //hide last actual menu menu = new mn_referDIV(lastM, 'menu'); mn_visib(menu, 0); //hide all previous menu while(mn_lastItem.length > 1) { pom = mn_lastItem.lastIndexOf("_"); lastM = mn_lastItem.substr(0, pom); menu = new mn_referDIV(lastM, 'menu'); mn_visib(menu, 0); mn_lastItem = lastM; } } //is called when timeout under IE runs out function mn_hid() { if(!mn_inSubmenu && mn_is.ie) mn_hideMenu(); mn_inTopMenu = false; } //occures when menu item mn_is active function mn_itemOn(from) { var fromItem, pom, menuToOpen, objFrom, objToOpen, f, g, obj,c=0,cc=0; pom = from.lastIndexOf("."); var fromMenu = from.substr(4, pom-4); //4 is length of string 'item' in names of menu items fromItem = from.substr(pom+1); mn_hideSub(fromMenu); mn_tabSel(from.substr(4)); menuToOpen = fromMenu+"_"+fromItem; objFrom = new mn_referDIV(fromMenu, 'menu'); var fromTop = parseInt(objFrom.y,10); var fromLeft = parseInt(objFrom.x,10); var height = parseInt(objFrom.h,10); var width = parseInt(objFrom.w,10); //if menu changed - need to count items in new one if( mn_lastItem.substr(0,mn_lastItem.lastIndexOf(".")) != from.substr(4,from.lastIndexOf(".")-4) ) { //browser specific way to get a number of items in current menu if(mn_is.dom) for(var k=1;k<100;k++) { cc = document.getElementsByName("item"+fromMenu+"."+k); if(cc.length) c++; else break; } else if(mn_is.ie && !mn_is.dom) { //for ie4 for(var k=1;k<100;k++) { if(document.all["item"+fromMenu+"."+k]) c++; else break; } } else { var k=1; for(var ii=0;ii250) ? mn_firstMenuTimeout : 250; mn_tiktak2 = setTimeout("mn_firstMenu()", mn_firstMenuTimeout); } else { mn_newTopLevel = num; //save number of new opened menu for exception in mn_hideMenu() function var backupLastItem1 = mn_lastItem; //original lastItem mn_show(num); //change lastItem var backupLastItem2 = mn_lastItem; //id of new opened menu mn_lastItem = backupLastItem1; //id of previous lastItem - for hiding of old menu-tree mn_hide(); //hide all menu tree mn_lastItem = backupLastItem2; //restore lastItem to really last opened menu id mn_newTopLevel = null; /* mn_hide(); mn_show(num); */ } } //sets timeout to hide all menu function mn_outOfMenu() { var tmp_timeout; clearTimeout(mn_tiktak2); if(mn_is.ie) { if(!mn_firstMenuTimeout || mn_firstMenuTimeout<290) tmp_timeout = 240; else tmp_timeout = mn_firstMenuTimeout-50; mn_tiktak = setTimeout("mn_hid()", tmp_timeout); } } //definition of EVENTs for Netscape browsers if(mn_is.ns4) { window.document.captureEvents(Event.MOUSEUP); window.document.onmouseup = mn_preHide; window.captureEvents(Event.RESIZE); window.onResize = mn_hid; } else if(!mn_is.ie) { //for Gecko DOM based; //window.onmouseup = mn_hide; window.onclick = mn_hide; } else { window.document.onclick = mn_hide; //event handler for closing all menu window.onresize = mn_hid; }