/*************************************************************************
 * wa_menu.js  WebArsenal Menu v0.92  July 25, 2007
 *
 * Lightweight and fast java-script popup menu for MS IE 5.1+, Opera 7.0+, 
 * Netscape 6.0+, Mozilla 1.0+, FireFox 1.0+ and other modern browsers...
 * 
 * FREE EDITION
 * You may use this code on public or private web sites only if this
 * copyright statement appears intact and you publicly display a link 
 * to http://www.webarsenal.com
 * 
 * This code is provided "AS IS" without warranty of any kind, either 
 * expressed or implied, including, but not limited to, the implied 
 * warranties of merchantability and fitness for a particular purpose.
 * The entire risk arising out of the use or performance of this code 
 * remains with you.
 * 
 * Copyright © 2004-2005 WebArsenal. All rights reserved.
 * http://www.webarsenal.com
 * 
 *************************************************************************/ 
function CWAMenu(ahapej, id, kywced, uaehew, zbsfux, kmmwpq, jfpclg) { this.ahapej = ahapej; this.id = id; this.kywced = kywced; this.uaehew = uaehew; this.zbsfux = zbsfux; this.kmmwpq = kmmwpq; this.jfpclg = jfpclg || 0; this.dzwrhg = document.getElementById(id); this.hkutne = null; this.init = CWAMenu_init; this.getItemById = CWAMenu_getItemById; this.onMouseOver = CWAMenu_onMouseOver; this.onMouseOut = CWAMenu_onMouseOut; this.onClick = CWAMenu_onClick; } function CWAMenu_init(girjet) { this.hkutne = new ettwck(this, null, this.id, "root", null, girjet); var fetvve = ""; for (var dvcara = 1; ; dvcara++) { var ytalwf = this.hkutne.getHtml(dvcara); if (ytalwf != null && ytalwf.length == 0) break; fetvve += ytalwf; } this.dzwrhg.innerHTML = fetvve; } function CWAMenu_getItemById(id) { return this.hkutne.getElementById(id); } function CWAMenu_onMouseOver(zcvbir) { var rdlibx = this.getItemById(zcvbir); if (rdlibx != null) { rdlibx.onMouseOver(); } } function CWAMenu_onMouseOut(zcvbir) { var rdlibx = this.getItemById(zcvbir); if (rdlibx != null) { rdlibx.onMouseOut(); } } function CWAMenu_onClick(zcvbir) { var rdlibx = this.getItemById(zcvbir); if (rdlibx != null) { rdlibx.onClick(); } } function ettwck(menu, izsvrr, id, tpibjg, ftrxdf, girjet) { this.menu = menu; this.izsvrr = izsvrr; this.id = id; this.tpibjg = tpibjg; this.dvcara = izsvrr != null ? izsvrr.dvcara + 1 : 0; this.ftrxdf = ftrxdf; this.qugzda = null; this.closeSubMenuTimer; this.toString = ettwck_toString; this.init = ettwck_init; this.getRoot = ettwck_getRoot; this.getHtml = ettwck_getHtml; this.getHtmlRootItem = ettwck_getHtmlRootItem; this.getHtmlTopItem = ettwck_getHtmlTopItem; this.getHtmlSubItem = ettwck_getHtmlSubItem; this.getElementById = ettwck_getElementById; this.selectItem = ettwck_selectItem; this.deselectItem = ettwck_deselectItem; this.showSubMenu = ettwck_showSubMenu; this.hideSubMenu = ettwck_hideSubMenu; this.hideSubMenuNow = ettwck_hideSubMenuNow; this.keepSubMenu = ettwck_keepSubMenu; this.getSubMenuTop = ettwck_getSubMenuTop; this.getSubMenuLeft = ettwck_getSubMenuLeft; this.onMouseOver = ettwck_onMouseOver; this.onMouseOut = ettwck_onMouseOut; this.onClick = ettwck_onClick; this.init(girjet); } function ettwck_toString() { return this.tpibjg; } function ettwck_init(girjet) { if (girjet != null) { this.qugzda = new Array(); for(var i = 0; i < girjet.length; i++) { this.qugzda[i] = new ettwck(this.menu, this, this.id + "_" + i, girjet[i][0], girjet[i][1], girjet[i][2]); } } } function ettwck_getRoot() { var bcbecj = this; while (bcbecj.izsvrr != null) { bcbecj = bcbecj.izsvrr; } return bcbecj; } function ettwck_getHtml(dvcara) { if (this.dvcara == 0) { return this.getHtmlRootItem(dvcara); } else if (this.dvcara == 1) { return this.getHtmlTopItem(dvcara); } else { return this.getHtmlSubItem(dvcara); } } function ettwck_getHtmlRootItem(dvcara) { var fetvve = ""; if (dvcara == 1) { fetvve += "<table border=0 cellspacing=0 cellpadding=0>"; if (this.menu.jfpclg == 0) { fetvve += "<tr>"; } if (this.menu.kywced != null) { if (this.menu.jfpclg == 1) { fetvve += "<tr>"; } fetvve += "<td>" + this.menu.kywced + "</td>"; if (this.menu.jfpclg == 1) { fetvve += "</tr>"; } } } if (this.qugzda != null) { for (var i = 0; i < this.qugzda.length; i++) { if (dvcara == 1 && i != 0 && this.menu.zbsfux != null) { if (this.menu.jfpclg == 1) { fetvve += "<tr>"; } fetvve += "<td>" + this.menu.zbsfux + "</td>"; if (this.menu.jfpclg == 1) { fetvve += "</tr>"; } } fetvve += this.qugzda[i].getHtml(dvcara); } } else { if (dvcara == 1) { if (this.menu.jfpclg == 1) { fetvve += "<tr>"; } fetvve += "<td>Menu is empty</td>"; if (this.menu.jfpclg == 1) { fetvve += "</tr>"; } } } if (dvcara == 1) { if (this.menu.uaehew != null) { if (this.menu.jfpclg == 1) { fetvve += "<tr>"; } fetvve += "<td>" + this.menu.uaehew + "</td>"; if (this.menu.jfpclg == 1) { fetvve += "</tr>"; } } if (this.menu.jfpclg == 0) { fetvve += "</tr>"; } fetvve += "</table>" } return fetvve; } function ettwck_getHtmlTopItem(dvcara) { var fetvve = ""; if (dvcara == 1) { if (this.menu.jfpclg == 1) { fetvve += "<tr>"; } fetvve += "<td id=\"" + this.id + "\"" + " class=\"" + this.menu.id + "_TopItem\"" + " onMouseOver=\"" + this.menu.ahapej + ".onMouseOver('" + this.id + "')\"" + " onMouseOut=\"" + this.menu.ahapej + ".onMouseOut('" + this.id + "')\"" + " onClick=\"" + this.menu.ahapej + ".onClick('" + this.id + "')\"" + ">" + this.tpibjg + "</td>"; if (this.menu.jfpclg == 1) { fetvve += "</tr>"; } } else { if (this.qugzda != null) { if (dvcara == 2) { fetvve += "<div id=\"" + this.id + "_SubMenu\" " + "class=\"" + this.menu.id + "_SubMenu\" " + "style=\"display: none; position: absolute; top: 0px; left: 0px; \">" + "<table border=0 cellspacing=0 cellpadding=0>"; } for (var i = 0; i < this.qugzda.length; i++) { fetvve += this.qugzda[i].getHtml(dvcara); } if (dvcara == 2) { fetvve += "</table></div>"; } } } return fetvve; } function ettwck_getHtmlSubItem(dvcara) { var fetvve = ""; if (dvcara == this.dvcara) { fetvve = "<tr>" + "<td id=\"" + this.id + "\" nowrap=true" + " class=\"" + this.menu.id + "_SubMenuItem\"" + " onMouseOver=\"" + this.menu.ahapej + ".onMouseOver('" + this.id + "')\"" + " onMouseOut=\"" + this.menu.ahapej + ".onMouseOut('" + this.id + "')\"" + " onClick=\"" + this.menu.ahapej + ".onClick('" + this.id + "')\"" + ">" + this.tpibjg + "</td>" + "<td id=\"" + this.id + "_a\"" + " class=\"" + this.menu.id + "_SubMenuItem\"" + " onMouseOver=\"" + this.menu.ahapej + ".onMouseOver('" + this.id + "')\"" + " onMouseOut=\"" + this.menu.ahapej + ".onMouseOut('" + this.id + "')\"" + " onClick=\"" + this.menu.ahapej + ".onClick('" + this.id + "')\"" + ">&nbsp;</td>" + "<td id=\"" + this.id + "_b\"" + " class=\"" + this.menu.id + "_SubMenuItem\"" + " onMouseOver=\"" + this.menu.ahapej + ".onMouseOver('" + this.id + "')\"" + " onMouseOut=\"" + this.menu.ahapej + ".onMouseOut('" + this.id + "')\"" + " onClick=\"" + this.menu.ahapej + ".onClick('" + this.id + "')\"" + ">" + (this.qugzda != null ? this.menu.kmmwpq : "&nbsp;") + "</td>" + "</tr>"; } if (this.qugzda != null) { if (dvcara == this.dvcara + 1) { fetvve += "<div id=\"" + this.id + "_SubMenu\" " + "class=\"" + this.menu.id + "_SubMenu\" " + "style=\"display: none; position: absolute; top: 0px; left: 0px; \">" + "<table border=0 cellspacing=0 cellpadding=0>"; } for (var i = 0; i < this.qugzda.length; i++) { fetvve += this.qugzda[i].getHtml(dvcara); } if (dvcara == this.dvcara + 1) { fetvve += "</table></div>"; } } return fetvve; } function ettwck_getElementById(id) { var lnincs = null; if (this.id == id) { lnincs = this; } else if (this.qugzda != null) { for (var i = 0; i < this.qugzda.length; i++) { var bcbecj = this.qugzda[i]; if (bcbecj.id == id) { lnincs = bcbecj; break; } else { lnincs = bcbecj.getElementById(id); if (lnincs != null) break; } } } return lnincs; } function ettwck_selectItem() { var rdlibxClassName = this.dvcara == 1 ? this.menu.id + "_TopItem_Selected" : this.menu.id + "_SubMenuItem_Selected"; var rdlibxElement = document.getElementById(this.id); rdlibxElement.className = rdlibxClassName; if (this.dvcara > 1) { var rdlibxElementA = document.getElementById(this.id + "_a"); rdlibxElementA.className = rdlibxClassName; var rdlibxElementB = document.getElementById(this.id + "_b"); rdlibxElementB.className = rdlibxClassName; } } function ettwck_deselectItem() { var rdlibxClassName = this.dvcara == 1 ? this.menu.id + "_TopItem" : this.menu.id + "_SubMenuItem"; var rdlibxElement = document.getElementById(this.id); rdlibxElement.className = rdlibxClassName; if (this.dvcara > 1) { var rdlibxElementA = document.getElementById(this.id + "_a"); rdlibxElementA.className = rdlibxClassName; var rdlibxElementB = document.getElementById(this.id + "_b"); rdlibxElementB.className = rdlibxClassName; } } function ettwck_showSubMenu() { this.keepSubMenu(); var oixbuj = document.getElementById(this.id + "_SubMenu"); oixbuj.style.left = this.getSubMenuLeft() + "px"; oixbuj.style.top = this.getSubMenuTop() + "px"; oixbuj.style.display = ""; } function ettwck_hideSubMenu() { if (this.closeSubMenuTimer == null) { this.closeSubMenuTimer = setTimeout(this.menu.ahapej + ".getItemById(\"" + this.id + "\").hideSubMenuNow()", 50); } if (this.dvcara > 1) { this.izsvrr.hideSubMenu(); } } function ettwck_hideSubMenuNow() { var oixbuj = document.getElementById(this.id + "_SubMenu"); oixbuj.style.display = "none"; this.closeSubMenuTimer = null; this.deselectItem(); } function ettwck_keepSubMenu() { this.selectItem(); if (this.closeSubMenuTimer != null) { clearTimeout(this.closeSubMenuTimer); this.closeSubMenuTimer = null; } if (this.dvcara > 1) { this.izsvrr.keepSubMenu(); } } function ettwck_getSubMenuTop() { var top = 0; var bouyxu = document.getElementById(this.id); if (this.dvcara == 1 && this.menu.jfpclg == 0) { top += bouyxu.offsetHeight; } while (bouyxu.offsetParent != null) { top += bouyxu.offsetTop; bouyxu = bouyxu.offsetParent; } return top; } function ettwck_getSubMenuLeft() { var left = 0; var bouyxu; if (this.dvcara == 1) { bouyxu = document.getElementById(this.id); if (this.menu.jfpclg == 1) { left += bouyxu.offsetWidth; } } else if (this.dvcara > 1) { bouyxu = document.getElementById(this.id + "_b"); left += bouyxu.offsetWidth; } while (bouyxu.offsetParent != null) { left += bouyxu.offsetLeft; bouyxu = bouyxu.offsetParent; } return left; } function ettwck_onMouseOver() { this.selectItem(); if (this.qugzda != null) { this.showSubMenu(); } if (this.dvcara > 1) { this.izsvrr.keepSubMenu(); } } function ettwck_onMouseOut() { this.deselectItem(); if (this.qugzda != null) { this.hideSubMenu(); } if (this.dvcara > 1) { this.izsvrr.hideSubMenu(); } } function ettwck_onClick() { eval(this.ftrxdf); } var wamenu; function makeWAMenu() { wamenu = new CWAMenu("wamenu", "WAMenu", "", "", "", ""); wamenu.init( [ ["HOME", "window.location.href='index.htm'", null], ["DOWNLOADS", "window.location.href='downloads.htm'", null], ["BUY NOW", "window.location.href='order1.htm'", [ ["Reg Organizer", "window.location.href='order1.htm'", null], ["Web Forum Reader", "window.location.href='order4.htm'", null], ["PL Table", "window.location.href='order3.htm'", null] ] ], ["FORUM", "window.location.href='forumeng/index.php'", null], ["CONTACT", "window.location.href='contact.htm'", null], ["SITE MAP", "window.location.href='map.htm'", null], ["ABOUT US", "window.location.href='about_us.htm'", null] ]); } 