Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] MENUBAR (2 of 2)



The first files is a javascript..., But since Minivend do some problems with
it... it should be named with a HTML
extension...., and should be called:

<script language="JavaScript" lang="he" src="[area menus/toolbar]"></script>
<script language="JavaScript" land="he" src="[area
menus/mainmenu]"></script>

(Menu engine = toolbar)
(Menu source = Mainmenu)

If anyone have problems with the RTF/LTR thing, e-mail me, i will be glad to
help or mybe making a LTR version,
also this one is ment for frames, first test it on normal page with no
frames to see how it works, since it needs
fine tuning in frames (positions & etc)...

NOTE: This code is for free for everyone out side of israel, pepole from
israel who would like to use this code,
Please e-mail me to get my approve for use it...


Hope i helped (and not spend your bandwidth...)
Eran Binyamin Zeitoun.
var ToolBar_Supported = false; var Frame_Supported = false; var DoInstrumentation = false; if (navigator.userAgent.indexOf("MSIE") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.appVersion.substring(0,1) > 3) { ToolBar_Supported = true; } if (ToolBar_Supported) {var newLineChar = String.fromCharCode(10); var char34 = String.fromCharCode(34); var LastMSMenu = ""; var LastICPMenu= ""; var CurICPMenu = ""; var IsMSMenu = false; var IsMenuDropDown = true; var HTMLStr; var TBLStr; var x = 0; var y = 0; var x2 = 0; var y2 = 0; var x3 = 0; var MSMenuWidth; var ToolbarMinWidth; var ToolbarMenu; var ToolbarBGColor; var ToolbarLoaded = false; var aDefMSColor = new Array(3); var aDefICPColor = new Array(3); var aCurMSColor = new Array(3); var aCurICPColor = new Array(3); var ICPFont; var MaxMenu = 30; var TotalMenu = 0; var arrMenuInfo = new Array(30); document.write(""); var isRTL = false; var isIE5 = navigator.appVersion.indexOf("MSIE 4") == -1; if (isIE5) {if (document.body.dir == 'rtl' || document.dir == 'rtl') isRTL = true;} else {var ht = document.body.outerHTML; ht = ht.substring(1, ht.indexOf(">")).toLowerCase(); if ((ht.indexOf("iedir=rtl") > -1) || (ht.indexOf("dir=rtl") > -1)) isRTL = true;} TBLStr = "
"; HTMLStr = "
" + "
" + "
 
" + "
" + "
" + "
" + "
" + "
" + "" + "" + "" + "" + "
"; ICPFont = "11 px Arial"; aDefMSColor[0] = aCurMSColor[0] = "white"; aDefMSColor[1] = aCurMSColor[1] = "white"; aDefMSColor[2] = aCurMSColor[2] = "red"; aDefICPColor[0] = aCurICPColor[0] = "#6699CC"; aDefICPColor[1] = aCurICPColor[1] = "white"; aDefICPColor[2] = aCurICPColor[2] = "red";} function drawToolbar() {HTMLStr += "
"; document.write(HTMLStr); ToolbarLoaded = true; MSMenuWidth = Math.max(idMSMenuPane.offsetWidth, (200+112)); ToolbarMinWidth = (250+18) + MSMenuWidth; idToolbar.style.backgroundColor = ToolbarBGColor; idICPMenuPane.style.backgroundColor = aDefICPColor[0]; idICPMenuPane.style.color = aDefICPColor[1]; resizeToolbar(); for (i = 0; i < TotalMenu; i++) {thisMenu = document.all(arrMenuInfo[i].IDStr); if (thisMenu != null) {if (arrMenuInfo[i].IDStr == arrMenuInfo[i].type == "R") {arrMenuInfo[i].type = "A"; arrMenuInfo[i].unit = 200;} if (arrMenuInfo[i].type == "A") thisMenu.style.width = arrMenuInfo[i].unit; else thisMenu.style.width = Math.round(arrMenuInfo[i].width * arrMenuInfo[i].unit) + 'em';}}} function resizeToolbar() {if (ToolBar_Supported == false) return; w = Math.max(ToolbarMinWidth, document.body.clientWidth) - ToolbarMinWidth; idICPMenuPane.style.width = ToolbarMinWidth + w;} function setToolbarBGColor(color) {ToolbarBGColor = color; if (ToolbarLoaded == true) idToolbar.style.backgroundColor = ToolbarBGColor;} function setICPMenuFont(sFont) {ICPFont = sFont;} function setDefaultICPMenuColor(bgColor, fontColor, mouseoverColor) {if (bgColor != "") aDefICPColor[0] = bgColor; if (fontColor != "") aDefICPColor[1] = fontColor; if (mouseoverColor != "") aDefICPColor[2] = mouseoverColor;} function setICPMenuColor(MenuIDStr, bgColor, fontColor, mouseoverColor) {if (ToolbarLoaded == false) return; if (CurICPMenu != "") {PrevID = CurICPMenu.substring(4); CurICPMenu = ""; setICPMenuColor(PrevID, aDefICPColor[0], aDefICPColor[1], aDefICPColor[2]);} var id = "AM_" + "ICP_" + MenuIDStr; var thisMenu = document.all(id); if (thisMenu != null) {CurICPMenu = "ICP_" + MenuIDStr; aCurICPColor[0] = bgColor; aCurICPColor[1] = fontColor; aCurICPColor[2] = mouseoverColor; if (bgColor != "") thisMenu.style.backgroundColor = bgColor; if (fontColor != "") thisMenu.style.color = fontColor; id = "ICP_" + MenuIDStr; thisMenu = document.all(id); if (thisMenu != null) { if (bgColor != "") thisMenu.style.backgroundColor = bgColor; if (fontColor != "") { i = 0; id = "AS_" + "ICP_" + MenuIDStr; thisMenu = document.all.item(id,i); while (thisMenu != null) { thisMenu.style.color = fontColor; i += 1; thisMenu = document.all.item(id,i);}}}}} function setICPSubMenuWidth(MenuIDStr, WidthType, WidthUnit) {tempID = "ICP_" + MenuIDStr; setSubMenuWidth(tempID, WidthType, WidthUnit);} function setSubMenuWidth(MenuIDStr, WidthType, WidthUnit) {var fFound = false; if (TotalMenu == MaxMenu) { alert("Unable to process menu. Maximum of " + MaxMenu + " reached."); return;} for (i = 0; i < TotalMenu; i++) if (arrMenuInfo[i].IDStr == MenuIDStr) {fFound = true; break;} if (!fFound) { arrMenuInfo[i] = new menuInfo(MenuIDStr); TotalMenu += 1;} if (!fFound && WidthType.toUpperCase().indexOf("DEFAULT") != -1) {arrMenuInfo[i].type = "A"; arrMenuInfo[i].unit = 160;} else { arrMenuInfo[i].type = (WidthType.toUpperCase().indexOf("ABSOLUTE") != -1)? "A" : "R"; arrMenuInfo[i].unit = WidthUnit;}} function menuInfo(MenuIDStr) {this.IDStr = MenuIDStr; this.type = ""; this.unit = 0; this.width = 0; this.count = 0;} function updateSubMenuWidth(MenuIDStr) {for (i = 0; i < TotalMenu; i++) if (arrMenuInfo[i].IDStr == MenuIDStr) {if (arrMenuInfo[i].width < MenuIDStr.length) arrMenuInfo[i].width = MenuIDStr.length; arrMenuInfo[i].count = arrMenuInfo[i].count + 1; break;}} function addICPMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr) {if (LastICPMenu == "") HTMLStr = HTMLStr.replace("", TBLStr); if (addICPMenu.arguments.length > 4) TargetStr = addICPMenu.arguments[4]; else TargetStr = "estore_main"; tempID = "ICP_" + MenuIDStr; addMenu(tempID, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, true); LastICPMenu = tempID;} function addMenu(MenuIDStr, MenuDisplayStr, MenuHelpStr, MenuURLStr, TargetStr, bICPMenu) {cFont = ICPFont; cColor0 = aDefICPColor[0]; cColor1 = aDefICPColor[1]; cColor2 = aDefICPColor[2]; cStyle = "font:" + cFont + ";background-color:" + cColor0 + ";color:" + cColor1 + ";"; tagStr = ""; if (MenuHelpStr == "") MenuHelpStr = MenuDisplayStr; MenuStr = newLineChar; if (bICPMenu) MenuStr += ""; else {MenuStr += ""; MenuStr += ""; MenuStr += " ";} MenuStr += "" + " " + MenuDisplayStr + " "; if (bICPMenu) MenuStr += " |"; else MenuStr += ""; MenuStr += tagStr; HTMLStr = HTMLStr.replace(tagStr, MenuStr); setSubMenuWidth(MenuIDStr,"default",0);} function addICPSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr) {if (addICPSubMenu.arguments.length > 3) TargetStr = addICPSubMenu.arguments[3]; else TargetStr = "estore_main"; tempID = "ICP_" + MenuIDStr; addSubMenu(tempID,SubMenuStr,SubMenuURLStr,TargetStr,true);} function addSubMenu(MenuIDStr, SubMenuStr, SubMenuURLStr, TargetStr, bICPMenu) {cFont = ICPFont; cColor0 = bICPMenu? aDefICPColor[0] : aDefMSColor[0]; cColor1 = bICPMenu? aDefICPColor[1] : aDefMSColor[1]; cColor2 = bICPMenu? aDefICPColor[2] : aDefMSColor[2]; var MenuPos = MenuIDStr.toUpperCase().indexOf("MENU"); if (MenuPos == -1) { MenuPos = MenuIDStr.length; } InstrumentStr = MenuIDStr.substring(0 , MenuPos) + "|" + SubMenuStr;; URLStr = SubMenuURLStr; var LookUpTag = ""; var sPos = HTMLStr.indexOf(LookUpTag); if (sPos <= 0) {HTMLStr += newLineChar + newLineChar + ""; else HTMLStr = HTMLStr.replace(LookUpTag, TempStr); updateSubMenuWidth(MenuIDStr);} function addICPSubMenuLine(MenuIDStr) {tempID = "ICP_" + MenuIDStr; addSubMenuLine(tempID,true);} function addSubMenuLine(MenuIDStr, bICPMenu) {var LookUpTag = ""; var sPos = HTMLStr.indexOf(LookUpTag); if (sPos > 0) {cColor = bICPMenu? aDefICPColor[1] : aDefMSColor[1]; TempStr = newLineChar + "
" + LookUpTag; HTMLStr = HTMLStr.replace(LookUpTag, TempStr);}} function mouseMenu(id, MenuIDStr) { IsMouseout = (id.toUpperCase().indexOf("OUT") != -1); if (IsMouseout) { color = aDefICPColor[1]; if (MenuIDStr == CurICPMenu && aCurICPColor[1] != "") color = aCurICPColor[1]; } else { color = aDefICPColor[2]; if (MenuIDStr == CurICPMenu && aCurICPColor[2] != "") color = aCurICPColor[2]; } window.event.srcElement.style.color = color; } function doMenu(MenuIDStr) {var thisMenu = document.all(MenuIDStr); if (ToolbarMenu == null || thisMenu == null || thisMenu == ToolbarMenu) {window.event.cancelBubble = true; return false;} window.event.cancelBubble = true; ToolbarMenu.style.display = "none"; showElement("SELECT"); showElement("OBJECT"); ToolbarMenu = thisMenu; x = window.event.srcElement.offsetLeft + window.event.srcElement.offsetParent.offsetLeft; var ICPstart = 0; if (!IsMSMenu) {if (isIE5) ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetLeft; else ICPstart = window.event.srcElement.offsetParent.offsetParent.offsetParent.offsetParent.offsetWidth - window.event.srcElement.offsetParent.offsetParent.offsetWidth; x += ICPstart;} x -= thisMenu.style.posWidth; x += IsMSMenu ? 8 : -2; if (x < 0) x = 0; if (MenuIDStr == LastMSMenu) if (x < 0) x = 0; y = (idRow1.offsetHeight + idRow3.offsetHeight); //** if (IsMSMenu) x2 = window.event.srcElement.offsetLeft - window.event.srcElement.offsetWidth; //** else x2 = window.event.srcElement.offsetParent.offsetLeft + ICPstart; x2 = window.event.srcElement.offsetParent.offsetLeft + ICPstart; x3 = x + 160; for (i = 0; i < TotalMenu; i++) if (arrMenuInfo[i].IDStr == MenuIDStr) {x3 = x+ arrMenuInfo[i].unit; break;} thisMenu.style.top = y; thisMenu.style.left = x; thisMenu.style.clip = "rect(0 0 0 0)"; thisMenu.style.display = "block"; window.setTimeout("showMenu()", 2); return true;} function showMenu() {if (ToolbarMenu != null) {IsMenuDropDown = (Frame_Supported && IsMSMenu == false)? false : true; if (IsMenuDropDown == false) {y = (y - ToolbarMenu.offsetHeight - idRow3.offsetHeight); if (y < 0) y = 0; ToolbarMenu.style.top = y;} y2 = y + ToolbarMenu.offsetHeight; ToolbarMenu.style.clip = "rect(auto auto auto auto)"; hideElement("SELECT"); hideElement("OBJECT");}} function hideMenu() {if (ToolbarMenu != null && ToolbarMenu != StartMenu) {var cX = event.clientX + document.body.scrollLeft; if (isRTL) cX -= 16; var cY = event.clientY + document.body.scrollTop; var bHideMenu = true; if (IsMenuDropDown == true) {if ( cY-8 >= (y - idRow3.offsetHeight) && cY < y) {if (cX >= (x2+5) && cX <= x3) bHideMenu = false;} else if (cY >= y && cY <= y2) {if (cX > (x+5) && cX <= x3) bHideMenu = false;}} else {if (cY >= y2 && cY < (y2 + idRow3.offsetHeight)) {if (cX >= (x2+5) && cX <= x3) bHideMenu = false;} else if (cY >= y && cY <= y2) {if (cX > (x+5) && cX <= x3) bHideMenu = false;}} if (! bHideMenu) {window.event.cancelBubble = true; return; } ToolbarMenu.style.display = "none"; ToolbarMenu = StartMenu; window.event.cancelBubble = true; showElement("SELECT"); showElement("OBJECT");}} function hideElement(elmID) {for (i = 0; i < document.all.tags(elmID).length; i++) {obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; objLeft = obj.offsetLeft; objTop = obj.offsetTop; objParent = obj.offsetParent; while (objParent.tagName.toUpperCase() != "BODY") {objLeft += objParent.offsetLeft; objTop += objParent.offsetTop; objParent = objParent.offsetParent;} objTop = objTop - y; if (x > (objLeft + obj.offsetWidth) || objLeft > (x + ToolbarMenu.offsetWidth)); else if (objTop > ToolbarMenu.offsetHeight); else if (IsMSMenu && (y + ToolbarMenu.offsetHeight) <= 80); else obj.style.visibility = "hidden";}} function showElement(elmID) {for (i = 0; i < document.all.tags(elmID).length; i++) {obj = document.all.tags(elmID)[i]; if (! obj || ! obj.offsetParent) continue; obj.style.visibility = "";}} var ToolBar_Supported = ToolBar_Supported; if (ToolBar_Supported != null && ToolBar_Supported == true) { setToolbarBGColor("#ffffff"); setDefaultICPMenuColor("#335ACC", "#FFFFFF", "#FFEF00"); addICPMenu("HomeMenu", "| הביתה", "","[area scan/mp=0/st=sql/se=hds]"); addICPMenu("HD", "דיסקים קשיחים", "","[area scan/mp=0/st=sql/se=hds/sf=category]"); addICPSubMenu("HD", "ווסטרן דיגיטל - Western Digital","[area scan/st=sql/se=01w/sf=searchcat]"); addICPSubMenu("HD", "י.ב.מ - IBM","[area scan/st=sql/se=01i/sf=searchcat]"); addICPSubMenu("HD", "סיגייט - Seagate","[area scan/st=sql/se=01s/sf=searchcat]"); addICPSubMenu("HD", "קוואנטום - Quantum","[area scan/st=sql/se=01q/sf=searchcat]"); addICPMenu("MB", "לוחות אם","","[area scan/mp=0/st=sql/se=mother/sf=category]"); addICPSubMenu("MB", "אסוס - Asus", "[area scan/st=sql/se=02a/sf=searchcat]"); addICPSubMenu("MB", "פריטק - FreeTech", "[area scan/st=sql/se=02f/sf=searchcat]"); addICPSubMenu("MB", "פיסי פרטנטר - Pc Partner", "[area scan/st=sql/se=02p/sf=searchcat]"); addICPSubMenu("MB", "ביו-סטאר - BioStar", "[area scan/st=sql/se=02b/sf=searchcat]"); addICPSubMenu("MB", "יצרנים אחרים", "[area scan/st=sql/se=02o/sf=searchcat]"); addICPMenu ("DRV", "כוננים", "","[area scan/mp=0/st=sql/se=cds/sf=category]"); addICPSubMenu("DRV", "כונני CD-ROM", "[area scan/st=sql/se=04r]"); addICPSubMenu("DRV", "כונני DVD", "[area scan/st=sql/se=04d]"); addICPSubMenu("DRV", "צורבים - CDRs", "[area scan/st=sql/se=04w]"); addICPSubMenu("DRV", "שאר הכוננים", "[area scan/st=sql/se=04o]"); addICPMenu ("CRD", "כרטיסים", "","[area scan/mp=0/st=sql/se=accs]"); addICPSubMenu("CRD", "כרטיסי מסך", "[area scan/st=sql/se=03v]"); addICPSubMenu("CRD", "כרטיסי קול", "[area scan/st=sql/se=03s]"); addICPSubMenu("CRD", "מודמים", "[area scan/st=sql/se=03m]"); addICPSubMenu("CRD", "בקרי SCSI", "[area scan/st=sql/se=03c]"); addICPSubMenu("CRD", "כרטיסי רשת", "[area scan/st=sql/se=03n]"); addICPMenu ("CHIPS", "רכיבים", "", "[area scan/mp=0/st=sql/se=accs]"); addICPSubMenu("CHIPS", "מעבדים", "[area scan/st=sql/se=03c]"); addICPSubMenu("CHIPS", "זכרונות", "[area scan/st=sql/se=]"); addICPMenu ("MONI", "מסכים", "", "[area scan/mp=0/st=sql/se=monitors]"); addICPMenu("Help", "עזרה", "","[area ord/basket]"); addICPSubMenu("Help", "השימוש באתר", ""); addICPSubMenu("Help","מסכן מרדכי...", ""); } drawToolbar();
Search for: Match: Format: Sort by: