var clicked = 1; /************************************************************* * * * (C) 1999-2005 innovativ partner / www.ip-team.de * * Torsten van Beeck * * * *************************************************************/ var ON_DELAY = 1250; var OFF_DELAY = 250; var HIGHLIGH_ON = "#f0f0f0"; var HIGHLIGH_OFF = "#ffffff"; var popUpCount = 0; var pageReady = false; var timeoutOn = null; var menuOnName = null; var timeout = null; var currentObjectTimeout = null; var currentVisTimeout = null; var currentObject = null; var currentObjectL = null; var currentObjectR = null; var currentObjectName = null; if (document.layers && !document.getElementById) { window.captureEvents(Event.CLICK|Event.MOUSEDOWN); window.onclick = theClick; window.onmousedown = theClick; } function theClick(e) { menuOff(); window.captureEvents(Event.CLICK|Event.MOUSEDOWN); window.onclick = theClick; window.onmousedown = theClick; } if (clicked) { timeoutOn = setTimeout("clickedOff(true)", ON_DELAY); } var hasDHTML = (document.getElementById || document.all || document.layers); function getObj(name) { if (document.getElementById) { if (document.getElementById(name)) { this.obj = document.getElementById(name); this.style = document.getElementById(name).style; } else { this.obj = null; this.style = null; } } else if (document.all) { if (document.all[name]) { this.obj = document.all[name]; this.style = document.all[name].style; } else { this.obj = null; this.style = null; } } else if (document.layers) { this.obj = document.layers[name]; this.style = document.layers[name]; } } function findPosX(obj) { var curleft = 0; if (document.getElementById || document.all) { while (obj.offsetParent) { curleft += obj.offsetLeft obj = obj.offsetParent; } } else if (document.layers) { curleft += obj.x; } return curleft; } function findPosY(obj) { var curtop = 0; if (document.getElementById || document.all) { while (obj.offsetParent) { curtop += obj.offsetTop obj = obj.offsetParent; } } else if (document.layers) { curtop += obj.y; } return curtop; } function listProps(obj) { s = ""; flag = 0; for (i in obj) { s += i + " | "; if (flag == 4) { flag = 0; s += "\n"; } else { flag++; } } alert(s); } function hOn(obj) { highlighElement(obj, true); } function hOff(obj) { highlighElement(obj, false); } function highlighElement(obj, on) { if (!hasDHTML) return; style = on ? HIGHLIGH_ON : HIGHLIGH_OFF; if (obj.parentNode) { o = obj.parentNode; } else if (obj.parentElement) { o = obj.parentElement; } else { return; } if (o.style) { o.style.backgroundColor = style; } } var ns4Obj = null; function positionMenus() { var obj; var posX; var posY; var leftOffset = -23; var topOffset = -11; if (!document.getElementById && document.layers) { posX = findPosX(ns4Obj); posY = findPosY(ns4Obj); var name = prefixPopup + globalNum; if (globalNum != "cms") { document.layers[name].left = posX + leftOffset; document.layers[name].top = posY + topOffset; } } else { if (globalNum == "cms") { obj = new getObj("cms"); } else { obj = new getObj("nav-" + globalNum); } posX = findPosX(obj.obj); posY = findPosY(obj.obj); if (globalNum == "cms") { obj = new getObj("popUp-cms"); } else { obj = new getObj(prefixPopup + globalNum); } if (globalNum != "cms") { if (!document.all) { if (!navigator.userAgent.toLowerCase().indexOf('opera') + 1) { obj.style.left = posX + leftOffset; obj.style.top = posY + topOffset; } } else { obj.style.pixelLeft = posX + leftOffset; obj.style.pixelTop = posY + topOffset; } } } return; } var globalNum = ""; function popUpOnOff(num) { name = "popUp-" + num; obj = new getObj(name); objL = new getObj(name + "l"); objR = new getObj(name + "r"); if (currentObject != null && currentObjectName != name) { currentObject.style.display = 'none'; currentObjectL.style.display = 'none'; currentObjectR.style.display = 'none'; currentObjectName = null; currentObject = null; currentObjectL = null; currentObjectR = null; } if (obj.style.display == 'none') { obj.style.display = 'block'; objL.style.display = 'block'; objR.style.display = 'block'; currentObjectName = name; currentObject = obj; currentObjectL = objL; currentObjectR = objR; } else { obj.style.display = 'none'; objL.style.display = 'none'; objR.style.display = 'none'; currentObjectName = null; currentObject = null; currentObjectL = null; currentObjectR = null; } } function popUpOn(num) { globalNum = num; menuOn("popUp-" + num); } function cmsPopUpOn() { globalNum = "cms"; menuOn("popUp-cms"); } function menuOn(name) { if (!hasDHTML) return; if (clicked != 0) { menuOnName = name; return; } if (!pageReady) return; menuOnName = null; positionMenus(); if (currentObject != null) { elementOnOff(currentObject, false, 0); } var o; o = new getObj("jsIP_callback"); if (o.obj != null) { _jsIP_obj_on(name); } o = new getObj(name); elementOnOff(o, true, 0); addEventHandler(o); } function addEventHandler(obj) { currentObject = obj; o = obj.obj; if (document.layers) { var doc = o.document; doc.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.MOUSEMOVE); doc.onmouseover = elementOverNS; doc.onmouseout = elementOutNS; } else { o.onmouseover = elementOver; o.onmouseout = elementOut; } } function menuOff() { if (currentObject != null) { elementOnOff(currentObject, false, 0); } } function elementOnOff(obj, on, delay) { if (!hasDHTML) return; if (!pageReady) return; var vis = on ? 'visible' : 'hidden'; if (timeout != null) { clearTimeout(timeout); timeout = null; } if (delay != 0) { currentObjectTimeout = obj; currentVisTimeout = vis; timeout = setTimeout("elementOnOffTime(currentObjectTimeout, currentVisTimeout)", delay); } else { var o = new getObj("jsIP_callback"); if (o.obj != null && vis == "hidden") { _jsIP_obj_off(name); } obj.style.visibility = vis; } } function elementOnOffTime(obj, vis) { var o = new getObj("jsIP_callback"); if (o.obj != null && vis == "hidden") { _jsIP_obj_off(name); } obj.style.visibility = vis; } function elementOver() { if (timeout != null) { clearTimeout(timeout); timeout = null; } } function elementOut() { elementOnOff(currentObject, false, OFF_DELAY); } function elementOverNS(event) { elementOver(); } function elementOutNS(event) { elementOut(); } function clickedOff(doOn) { clicked = 0; if (menuOnName != null && doOn == true) { menuOn(menuOnName); } menuOnName = null; }