function getOffset(el) { var _x = 0; var _y = 0; while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) { _x += el.offsetLeft - el.scrollLeft; _y += el.offsetTop - el.scrollTop; el = el.parentNode; } return { top: _y, left: _x }; } var timeoutrunning; function DoIpdCloseMenu(state) { //Set timer to close dropdown if (state == 0) { //user has moved focus from menu, close dropdown if user does not move focus to it. timeoutrunning = setTimeout("DoIpdCloseMenu(1);", 100); } else { //Close drop down menu var arrShownMenu = shownmenu.split(','); for (var i = 0; i < arrShownMenu.length; i++) { if (document.getElementById(arrShownMenu[i])) { document.getElementById(arrShownMenu[i]).style.display = 'none'; } } } } var shownmenu = ''; function DoIpdMenu(pid, id, level) { //Check submenu exists if (document.getElementById(id)) { //Set menu position var posY = getOffset(document.getElementById(pid)).top; document.getElementById(id).style.right = ((200 * level) + 4) + 'px'; //width times the level document.getElementById(id).style.top = (posY - 9) + 'px'; //minus top padding //Hide/show menus var arrshownmenu = shownmenu.split(','); shownmenu = ''; for (var n = 0; n < arrshownmenu.length; n++) { if (n < (level - 1)) { //create array of new items if (shownmenu != '') shownmenu += ','; shownmenu += arrshownmenu[n]; } else { //close menu items if (document.getElementById(arrshownmenu[n])) { document.getElementById(arrshownmenu[n]).style.display = 'none'; } } } //Add latest id if (shownmenu != '') shownmenu += ','; shownmenu += id; //Show latest menu item document.getElementById(id).style.display = 'block'; } } function DoIpdCancelTimeOut() { clearTimeout(timeoutrunning); } function StringBuffer() { this.buffer = []; } StringBuffer.prototype.append = function append(string) { this.buffer.push(string); return this; }; StringBuffer.prototype.toString = function toString() { return this.buffer.join(""); }; function DoWriteIpdMenu(){var txtIpdMenu = new StringBuffer();var iMenuItems = 0;txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("");iMenuItems += 1;txtIpdMenu.append("
");txtIpdMenu.append("
");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");txtIpdMenu.append("");document.getElementById('ipdmenuholder').innerHTML = txtIpdMenu;var iMenuheight = 100;if((iMenuItems * 16) > 100) iMenuheight = iMenuItems * 16;document.getElementById('ipdmenuholder').style.height = iMenuheight + 'px';}