1var GLOBAL_LoadedImages = new Array(); 2var GLOBAL_CurrentItem = ""; 3var GLOBAL_Close = null; 4var GLOBAL_Hide = null; 5var GLOBAL_items = new NOF_OpenedItems(); 6var GLOBAL_slideItem = null; 7var GLOBAL_slideSpeed = 10; 8var GLOBAL_slidePixel = 0; 9var GLOBAL_slideMinOffset = -800; 10var GLOBAL_slideMaxOffset = 800; 11var useDebuger = false; 12function NOF_DOMBrowser() { 13this.getMenuItemLayerStartString = function getMenuItemLayerStartString(menuItemId, parentId) { 14parentId = ( (parentId != null) && (parentId != "undefined") && (typeof(parentId) != "undefined")) 15? new String(parentId + CONSTANTS.MENU_LAYER_SUFIX) : null; 16menuItemId += CONSTANTS.MENU_LAYER_SUFIX; 17var isAutoClose = typeof(C_MENU_AUTO_CLOSE) == "undefined" || C_MENU_AUTO_CLOSE == true ? "true" : "false"; 18return '<DIV ID="' + menuItemId + '" isautoclose="' + isAutoClose + '" STYLE="z-index:5; filter:blendTrans(duration=0.5)" onmouseover="NOF_KeepOpen(\'' + menuItemId + '\', ' + parentId + ')" onmouseout="NOF_KeepClose()">'; 19} 20this.getMenuItemLayerEndString = function getMenuItemLayerEndString() { 21return '</DIV>'; 22} 23this.showMenuItem = function showMenuItem(image, item, offsetX, offsetY, openEffect) { 24if (typeof(item) == "string") 25item = this.getItem(item) 26image = typeof(image) == "string" ? this.getItem(image) : image; 27var top = this.findItemTopOffset(image); 28var left = this.findItemLeftOffset(image); 29var slideDirection = ""; 30if (openEffect.indexOf("left") > -1 || openEffect.indexOf("Left") > -1 ) { 31top += offsetY; 32left -= offsetX; 33slideDirection = "left"; 34} else if (openEffect.indexOf("top") > -1 || openEffect.indexOf("Top") > -1 ) { 35top -= offsetY; 36left += offsetX; 37slideDirection = "top"; 38} else if (openEffect.indexOf("right") > -1 || openEffect.indexOf("Right") > -1 ) { 39top += offsetY; 40left += offsetX; 41slideDirection = "right"; 42} else { 43top += offsetY; 44left += offsetX; 45slideDirection = "bottom"; 46} 47if (item == null || typeof(item.style) == "undefined" || item.style == null ) 48return; 49item.style.top = top+"px"; 50item.style.left = left+"px"; 51item.style.visibility = "visible"; 52if (openEffect.indexOf("slide") > -1) 53this.slideEffect(item, slideDirection); 54else if (openEffect.indexOf("fade") > -1) 55this.fadeEffect(item); 56else 57item.style.filter = ""; 58} 59this.hideMenuItem = function hideMenuItem(item) { 60if (typeof(item) == "string") 61item = this.getItem(item) 62if ( item == null || typeof(item) == "undefined" || item == "" || typeof(item) == "number") 63return; 64item.style.visibility = "hidden"; 65} 66this.findItemLeftOffset = function findItemLeftOffset(item) { 67var offset = item.offsetLeft; 68if (item.offsetParent) 69offset += this.findItemLeftOffset(item.offsetParent); 70return offset; 71} 72this.findItemTopOffset = function findItemTopOffset(item) { 73var offset = item.offsetTop; 74if (item.offsetParent) 75offset += this.findItemTopOffset(item.offsetParent); 76return offset; 77} 78this.getItem = function getItem(itemId) { 79return document.getElementById(itemId); 80} 81this.getItemAttribute = function getItemAttribute(itemId, attrId) { 82if (this.getItem(itemId)) { 83var attr = this.getItem(itemId).attributes; 84return eval("attr." + attrId.toLowerCase() + ".value"); 85} 86return ""; 87} 88this.debug = function debug(txt) { 89var container = this.getItem("debug"); 90if ( useDebuger ) 91container.value += txt + "\n"; 92} 93this.fadeEffect = function fadeEffect(item) { 94item.style.visibility = "hidden"; 95item.filters.blendTrans.Apply(); 96item.filters.blendTrans.Play(); 97item.style.visibility = "visible"; 98} 99this.slideEffect = function slideEffect(item, margin) { 100GLOBAL_slideItem = item; 101this.setItemClip('rect(auto, auto, auto, auto)'); 102GLOBAL_slidePixel = (margin == "top" || margin == "left") ? 100 : 0; 103this.playEffect(margin); 104} 105this.playEffect = function playEffect(margin) { 106var clip = GLOBAL_slideItem.style.clip; 107if (clip.indexOf("-") > 0) 108return; 109if (GLOBAL_slidePixel < GLOBAL_slideMinOffset || GLOBAL_slidePixel > GLOBAL_slideMaxOffset) 110return; 111var rect = 'rect('; 112if (margin == "top") { 113GLOBAL_slidePixel -= 3; 114rect += GLOBAL_slidePixel +'px auto auto auto)'; 115} else if (margin == "right") { 116GLOBAL_slidePixel += 3; 117rect += 'auto ' + GLOBAL_slidePixel +'px auto auto)'; 118} else if (margin == "bottom") { 119GLOBAL_slidePixel += 3; 120rect += 'auto auto ' + GLOBAL_slidePixel + 'px auto)'; 121} else { 122GLOBAL_slidePixel -= 3; 123rect += 'auto auto auto ' + GLOBAL_slidePixel + 'px)'; 124} 125this.setItemClip(rect); 126setTimeout('browser.playEffect("' + margin + '")', GLOBAL_slideSpeed); 127} 128this.setItemClip = function setItemClip(rect) { 129GLOBAL_slideItem.style.clip = rect; 130} 131this.getLayerTag = function getLayerTag() { return "div" }; 132} 133function NOF_BrowserNetscapeNavigator() { 134window.onclick= HideMenu; 135this.fadeEffect = function fadeEffect() { return; }; 136GLOBAL_slideSpeed = 1; 137return this; 138} 139NOF_BrowserNetscapeNavigator.prototype = new NOF_DOMBrowser; 140function NOF_BrowserInternetExplorer() { 141document.onmouseup = HideMenu; 142} 143NOF_BrowserInternetExplorer.prototype = new NOF_DOMBrowser; 144function NOF_BrowserNetscape4x() { 145this.getMenuItemLayerStartString = function getMenuItemLayerStartString(menuItemId, parentId) { 146parentId = ( (parentId != null) && (parentId != "undefined") && (typeof(parentId) != "undefined")) 147? new String(parentId + CONSTANTS.MENU_LAYER_SUFIX) : null; 148menuItemId += CONSTANTS.MENU_LAYER_SUFIX; 149var isAutoClose = typeof(C_MENU_AUTO_CLOSE) == "undefined" || C_MENU_AUTO_CLOSE == true ? "true" : "false"; 150return '<layer ID="' + menuItemId + '" isautoclose="' + isAutoClose + '" onmouseover="NOF_KeepOpen(\'' + menuItemId + '\', ' + parentId + ')" onmouseout="NOF_KeepClose()">'; 151} 152this.getMenuItemLayerEndString = function getMenuItemLayerEndString() { 153return '</layer>'; 154} 155this.getImageParent = function getImageParent(imageObject){ 156for (var position = 0; position < document.layers.length; position++) { 157var layer = document.layers[position]; 158for (var imagePosition = 0; imagePosition < layer.document.images.length; imagePosition++) { 159if (layer.document.images[imagePosition].name == imageObject.name) { 160return layer; 161} 162} 163} 164return null; 165} 166this.showMenuItem = function showMenuItem(image, item, offsetX, offsetY, openEffect) { 167var parent = this.getImageParent(image); 168var itemId = image; 169if (typeof(item) == "string") 170item = this.getItem(item) 171image = typeof(image) == "string" ? this.getItem(image) : image; 172var top = this.findItemTopOffset(image); 173var left = this.findItemLeftOffset(image); 174if (parent != null) { 175left += parent.pageX; 176top += parent.pageY; 177} 178var slideDirection = ""; 179if (openEffect.indexOf("left") > -1 || openEffect.indexOf("Left") > -1 ) { 180top += offsetY; 181left -= offsetX; 182slideDirection = "left"; 183} else if (openEffect.indexOf("top") > -1 || openEffect.indexOf("Top") > -1 ) { 184top -= offsetY; 185left += offsetX; 186slideDirection = "top"; 187} else if (openEffect.indexOf("right") > -1 || openEffect.indexOf("Right") > -1 ) { 188top += offsetY; 189left += offsetX; 190slideDirection = "right"; 191} else { 192top += offsetY; 193left += offsetX; 194slideDirection = "bottom"; 195} 196if (typeof(item) == "undefined") 197return; 198item.y = parseInt(top); 199item.x = parseInt(left); 200item.visibility = "visible"; 201if (openEffect.indexOf("slide") > -1) 202this.slideEffect(item, slideDirection); 203else if (openEffect.indexOf("fade") > -1) { 204this.fadeEffect(item); 205} 206} 207this.hideMenuItem = function hideMenuItem(item) { 208if (typeof(item) == "string") 209item = this.getItem(item) 210if ( item == null || typeof(item) == "undefined" || item == "") 211return; 212item.visibility = "hide"; 213} 214this.findItemLeftOffset = function findItemLeftOffset(item) { 215return item.x; 216} 217this.findItemTopOffset = function findItemTopOffset(item) { 218return item.y; 219} 220this.getItem = function getItem(itemId) { 221return itemId == "" ? "" : eval("document.layers['" + itemId + "']"); 222} 223this.getItemAttribute = function getItemAttribute(itemId, attrId) { 224return eval("document.layers['" + itemId.toLowerCase() + "']." + attrId); 225} 226this.getLayerTag = function getLayerTag() { return "layer" }; 227this.slideEffect = function slideEffect(item, margin) { 228GLOBAL_slideItem = item; 229GLOBAL_slidePixel = (margin == "bottom" || margin == "left") ? 200 : 0; 230this.playEffect(margin); 231} 232this.playEffect = function playEffect(margin) { 233if (GLOBAL_slidePixel < GLOBAL_slideMinOffset || GLOBAL_slidePixel > GLOBAL_slideMaxOffset) 234return; 235if (margin == "top") { 236GLOBAL_slideItem.clip.bottom = GLOBAL_slidePixel += 1; 237} else if (margin == "right") { 238GLOBAL_slideItem.clip.right = GLOBAL_slidePixel += 1; 239} else if (margin == "bottom") { 240GLOBAL_slideItem.clip.top = GLOBAL_slidePixel -= 1;
241} else { 242GLOBAL_slideItem.clip.left = GLOBAL_slidePixel -= 1; 243} 244setTimeout('browser.playEffect("' + margin + '")', GLOBAL_slideSpeed); 245} 246} 247NOF_BrowserNetscape4x.prototype = new NOF_DOMBrowser; 248function NOF_BrowserFactory() { 249var agt = navigator.userAgent.toLowerCase(); 250var is_major = parseInt(navigator.appVersion); 251var is_minor = parseFloat(navigator.appVersion); 252var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 253&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 254&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)); 255var is_nav2 = (is_nav && (is_major == 2)); 256var is_nav3 = (is_nav && (is_major == 3)); 257var is_nav4 = (is_nav && (is_major == 4)); 258var is_nav4up = (is_nav && (is_major >= 4)); 259var is_navonly = (is_nav && ((agt.indexOf(";nav") != -1) || 260(agt.indexOf("; nav") != -1)) ); 261var is_nav6 = (is_nav && (is_major == 5)); 262var is_nav6up = (is_nav && (is_major >= 5)); 263var is_gecko = (agt.indexOf('gecko') != -1); 264var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)); 265var is_ie3 = (is_ie && (is_major < 4)); 266var is_ie4 = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) ); 267var is_ie4up = (is_ie && (is_major >= 4)); 268var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); 269var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1)); 270var is_ie5up = (is_ie && !is_ie3 && !is_ie4); 271var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5); 272var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) ); 273var is_ie6up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5); 274var is_opera = (agt.indexOf("opera") != -1); 275var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1); 276var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1); 277var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1); 278var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1); 279var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4); 280this.getBrowser = function getBrowser() { 281if (is_ie5up) { 282return new NOF_BrowserInternetExplorer(); 283} 284if (is_nav6up) { 285return new NOF_BrowserNetscapeNavigator(); 286} 287if (is_opera5up) { 288return new NOF_BrowserInternetExplorer(); 289} 290if (is_nav4) { 291return new NOF_BrowserNetscape4x(); 292} 293} 294return null; 295} 296var browserFactory = new NOF_BrowserFactory(); 297var browser = browserFactory.getBrowser(); 298var CONSTANTS = { 299MENU_TYPE_IMAGE : "Image", 300MENU_TYPE_TEXT : "Text", 301BUTTON_TYPE_IMAGE : "image", 302BUTTON_TYPE_TEXT : "text", 303MENU_TABLE_HEADER : '<table border="0" cellspacing="0" cellpadding="0">', 304MENU_TABLE_END : '</table>', 305MOUSE_OVER_IMAGE : 1, 306MOUSE_OUT_IMAGE : 2, 307MENU_ITEM_HORIZONTAL : false, 308MENU_ITEM_VERTICAL : true, 309MENU_LAYER_SUFIX : "LYR", 310NOT_A_MAIN_ITEM : 1, 311MENU_REFRESH_TIME : 600 312} 313function NOF_Menu() { 314return this; 315} 316function NOF_Menu_Item() { 317this.id = arguments[0]; 318this.orientation = arguments[1]; 319this.openEffect = arguments[2]; 320this.offsetX = arguments[3]; 321this.offsetY = arguments[4]; 322this.buttons = new Array(); 323this.submenuHeight = 0; 324for (var i = 5; i < arguments.length; i++) 325this.buttons[i - 5] = arguments[i]; 326this.getPosition = function () { 327return new Array(this.offsetX, this.offsetY); 328} 329this.getOffsetX = function getOffsetX() { return this.offsetX;} 330this.getOffsetY = function getOffsetY() { return this.offsetY;} 331this.getOpenEffect = function getOffsetY() { return this.openEffect;} 332this.getOrientation = function getOrientation() { return this.orientation; } 333return this; 334} 335function NOF_Menu_Button(link, normal, rollover, submenu) { 336this.link = link; 337this.normal = normal; 338this.rollover = rollover != "" ? rollover : normal; 339this.submenu = submenu; 340this.hasSubmenu = function hasSubmenu() { 341return (this.submenu != null) 342} 343this.type = function type() { 344if (typeof(this.rollover) == "object") 345return CONSTANTS.BUTTON_TYPE_TEXT; 346else if (typeof(this.rollover) == "string") 347return CONSTANTS.BUTTON_TYPE_IMAGE; 348else 349return null; 350} 351return this; 352} 353function NOF_Main_Menu(menuItem, parentId) { 354if(typeof(menuItem) == "undefined") 355return; 356var menuItemId = menuItem.id; 357var buffer = browser.getMenuItemLayerStartString(menuItemId, parentId) + '<table width="10" border="' + C_MENU_BORDER + '" cellspacing="' + C_MENU_SPACING + '" cellpadding="0" bgcolor="' + C_MENU_BGCOLOR + '">'; 358var i = 0; 359buffer += '<tr>'; 360while (i < menuItem.buttons.length) { 361var menuButton = menuItem.buttons[i]; 362if (menuButton == null) 363return; 364var submenuId = ""; 365if (menuButton.hasSubmenu() && menuButton.submenu) { 366submenuId = menuButton.submenu.id; 367} 368var link = menuButton.link; 369var image = menuButton.normal; 370var rollOverButton = menuButton.rollover; 371var isImageMenu = menuButton.type() == CONSTANTS.BUTTON_TYPE_IMAGE ? true : false; 372var imageName = isImageMenu ? menuItemId + 's' + i : 'NavigationButton_' + menuItemId + '_' + i; 373var isVertical = menuItem.orientation == "vertical" ? true : false; 374var target = ''; 375if (link.indexOf(' target=') != -1) { 376target = link.substr(link.indexOf(' target=') + 8); 377link = link.substr(0, link.indexOf(' target=')); 378} 379buffer += (isVertical && i > 1) ? '<tr><td>' : '<td>'; 380if(!isImageMenu) 381buffer += '<style type="text/css"> ' + '.' + imageName + ' span {' + 'display:block; padding:' + rollOverButton[1] + '} ' + '.' + imageName + 'Hover span {' + 'display:block; padding:' + rollOverButton[3] + '}' + '</style>'; 382var cursor = link != 'javascript:void(0)' ? 'hand' : 'default'; 383buffer += '<a class="nof-navPositioning" '; 384if (cursor == 'default') 385buffer += 'style="cursor: default" '; 386buffer += 'href="' + link + '" '; 387buffer += 'onMouseOver="F_roll(\'' + imageName + '\' ,' + CONSTANTS.MOUSE_OVER_IMAGE + ', \'' + menuItemId + '\', \''+ 388CONSTANTS.NOT_A_MAIN_ITEM + '\')" onMouseOut="F_roll(\'' + imageName + '\' ,' + 389CONSTANTS.MOUSE_OUT_IMAGE + ', \''+menuItemId+'\', \'' + CONSTANTS.NOT_A_MAIN_ITEM + '\')"'; 390buffer += target.length ? ' target="' + target + '">' : '>';
391buffer += isImageMenu ? '<img border="0" src="' + image + '"' : '<' + browser.getLayerTag() + ' '; 392if (typeof(rollOverButton) != "undefined" || rollOverButton.length || !isImageMenu) { 393if (submenuId != "") { 394var submenu = menuButton.submenu; 395if (isImageMenu) { 396buffer += 'id="' + imageName + '" name="' + imageName + 397'" onLoad="F_loadRollover(this,\'' + rollOverButton + '\', new Array(\'' + submenuId + '\',\'' + submenu.getOrientation() + '\' , \'' + submenu.getOpenEffect() + '\', ' + submenu.getOffsetX() + ',' + submenu.getOffsetY() + '))"'; 398} else { 399NOF_MenuLoadRollOver(imageName, rollOverButton, new Array(submenuId, submenu.getOrientation(), submenu.getOpenEffect(), submenu.getOffsetX(), submenu.getOffsetY() )); 400buffer += 'id="' + imageName + '" name="' + imageName + '" class="' + imageName + '" ' ; 401if (typeof(menuButton.rollover) == "object") 402buffer+= ' style="' + rollOverButton[0] + '"'; 403} 404} 405else { 406if (isImageMenu) 407buffer += 'id="' + imageName + '" name="' + imageName + 408'" onLoad="F_loadRollover(this,\'' + rollOverButton + '\',0)"'; 409else { 410NOF_MenuLoadRollOver(imageName, rollOverButton, 0); 411buffer += 'id="' + imageName + '" name="' + imageName + '" class="' + imageName + '" '; 412if (typeof(menuButton.rollover) == "object") 413buffer+= ' style="' + rollOverButton[0] +'"'; 414} 415} 416} 417buffer += isImageMenu ? '></a></td>' : 418'><span id="' + imageName + '_padding"' + '>' + image + 419'</span></' + browser.getLayerTag() + '></a></td>'; 420buffer += isVertical ? "</tr>" : ""; 421i++; 422} 423buffer += CONSTANTS.MENU_TABLE_END + browser.getMenuItemLayerEndString(); 424document.writeln(buffer); 425var k = 0; 426while (k < menuItem.buttons.length) { 427if (menuItem.buttons[k].hasSubmenu()) { 428NOF_Main_Menu(menuItem.buttons[k].submenu, menuItem.id); 429} 430k++; 431} 432} 433function NOF_MenuLoadRollOver(button, buttonName, submenu) { 434if (button && button.src && 435(null == button.out || typeof(button.out) == typeof(void(0)))) { 436var imageSrc = button.src; 437button.out = new Image(); 438button.out.src = imageSrc; 439button.over = new Image(); 440if (button.parentNode.tagName.toLowerCase() == 'a') 441button.parentNode.style.display = 'block'; 442if (buttonName.lastIndexOf('/') >= 0 || buttonName.lastIndexOf('\\') >= 0) { 443imageSrc = buttonName; 444} else { 445var i = imageSrc.lastIndexOf('/'); 446if (i < 0) 447i = imageSrc.lastIndexOf('\\'); 448if (i < 0) 449imageSrc = buttonName; 450else 451imageSrc = imageSrc.substring(0, i + 1) + buttonName; 452} 453button.over.src = imageSrc; 454button.submenu = submenu; 455GLOBAL_LoadedImages[button.name] = button; 456} else { 457if (typeof(buttonName) == "object") { 458if (typeof(GLOBAL_LoadedImages[button]) == "undefined") { 459GLOBAL_LoadedImages[button + "Normal"] = buttonName[0]; 460GLOBAL_LoadedImages[button + "Over"] = buttonName[2]; 461GLOBAL_LoadedImages[button] = submenu; 462} 463return; 464} 465if (typeof(submenu) != "undefined" && typeof(button) == "string" && typeof(GLOBAL_LoadedImages[button]) == "undefined") 466GLOBAL_LoadedImages[button] = submenu; 467} 468} 469function NOF_MenuRollButton(buttonName, over, layerId, isNotMainItem) { 470var rollType = (over == CONSTANTS.MOUSE_OVER_IMAGE) ? "over" : "out"; 471var isOver = (over == CONSTANTS.MOUSE_OVER_IMAGE) ? true : false; 472var rollOver = GLOBAL_LoadedImages[buttonName]; 473if (typeof(rollOver) == "undefined") 474return; 475var menuType = typeof(rollOver.src) == "undefined" ? CONSTANTS.MENU_TYPE_TEXT : 476CONSTANTS.MENU_TYPE_IMAGE; 477if (menuType == CONSTANTS.MENU_TYPE_IMAGE) { 478var imageRollSrcString = "rollOver." + rollType + ".src"; 479if (rollOver) 480rollOver.src = eval(imageRollSrcString) ? eval(imageRollSrcString) : ""; 481} else if (menuType == CONSTANTS.MENU_TYPE_TEXT){ 482if (typeof(buttonName) == "string") { 483browser.getItem(buttonName).className = isOver ? buttonName + "Hover" : buttonName; 484if (typeof(browser.getItem(buttonName).style) != "undefined") 485browser.getItem(buttonName).style.cssText = isOver ? 486GLOBAL_LoadedImages[buttonName + "Over"] : 487GLOBAL_LoadedImages[buttonName + "Normal"]; 488} 489} else 490return; 491if ((isNotMainItem == null || typeof(isNotMainItem) == "undefined" ) && over == CONSTANTS.MOUSE_OUT_IMAGE) { 492GLOBAL_CurrentItem = ""; 493GLOBAL_items.removeAll(); 494} 495var hasSubmenu = null; 496if (menuType == CONSTANTS.MENU_TYPE_IMAGE) 497hasSubmenu = rollOver.submenu; 498else if (menuType == CONSTANTS.MENU_TYPE_TEXT)
499hasSubmenu = typeof(rollOver) == "object"; 500if (hasSubmenu) { 501if (over == CONSTANTS.MOUSE_OVER_IMAGE) { 502if ( layerId && typeof(layerId) != "undefined" && layerId != "null") { 503if (GLOBAL_Close != null) 504clearTimeout(GLOBAL_Close); 505GLOBAL_items.removeSubitems(layerId + CONSTANTS.MENU_LAYER_SUFIX); 506} else 507GLOBAL_items.removeAll(); 508if (menuType == CONSTANTS.MENU_TYPE_IMAGE) 509NOF_MenuOpenItem(rollOver, rollOver.submenu, layerId); 510else 511NOF_MenuOpenItem(buttonName, rollOver, layerId); 512} 513else { 514if (menuType == CONSTANTS.MENU_TYPE_IMAGE) 515NOF_MenuCloseItem(rollOver.submenu); 516else 517NOF_MenuCloseItem(rollOver); 518} 519} else if (over == CONSTANTS.MOUSE_OVER_IMAGE ) { 520if ( layerId && typeof(layerId) != "undefined" && layerId != "null" ) { 521GLOBAL_CurrentItem = layerId + CONSTANTS.MENU_LAYER_SUFIX; 522GLOBAL_items.removeSubitems(GLOBAL_CurrentItem); 523} else 524browser.hideMenuItem(GLOBAL_CurrentItem); 525} 526} 527function NOF_MenuOpenItem(image, submenu, parentId) { 528var layerId = submenu[0] + CONSTANTS.MENU_LAYER_SUFIX; 529var orientation = submenu[1]; 530var openEffect = submenu[2]; 531var offsetX = submenu[3]; 532var offsetY = submenu[4]; 533GLOBAL_items.addItem(layerId, parentId); 534GLOBAL_CurrentItem = layerId; 535browser.showMenuItem(image, layerId, offsetX, offsetY, openEffect); 536} 537function NOF_MenuCloseItem(imageSubmenu) { 538if (imageSubmenu[0]) { 539var layerId = imageSubmenu[0] + CONSTANTS.MENU_LAYER_SUFIX; 540if (GLOBAL_items.toArray().length == 1) 541GLOBAL_CurrentItem = 0; 542GLOBAL_Close = setTimeout("NOF_MenuHideItem('" + layerId + "')", CONSTANTS.MENU_REFRESH_TIME/4); 543} 544} 545function NOF_MenuHideItem(itemId) { 546if (itemId && itemId != null && GLOBAL_CurrentItem != itemId) { 547browser.hideMenuItem(itemId); 548} 549} 550function NOF_KeepOpen(itemId, parentId) { 551GLOBAL_CurrentItem = itemId; 552if (GLOBAL_Hide != null) 553for (var i = 0; i < GLOBAL_Hide.length; i++) 554clearTimeout(GLOBAL_Hide[i]); 555} 556function NOF_KeepClose() { 557GLOBAL_CurrentItem = ""; 558setTimeout("NOF_CloseChilds()", CONSTANTS.MENU_REFRESH_TIME); 559} 560function NOF_CloseChilds() { 561var itemsList = GLOBAL_items.toArray(); 562GLOBAL_Hide = new Array(); 563if (GLOBAL_CurrentItem == "" || GLOBAL_CurrentItem == 0) 564for (var i in itemsList) 565if (itemsList[i]) 566GLOBAL_Hide[i] = setTimeout("browser.hideMenuItem('" + itemsList[i] + "')", CONSTANTS.MENU_REFRESH_TIME/4); 567if (!isMenuAutoClose()) { 568itemsList = GLOBAL_items.toArray(); 569for ( var i in itemsList ) 570if (itemsList[i]) 571NOF_KeepOpen(itemsList[i]); 572} 573} 574function isMenuAutoClose() { 575var itemsList = GLOBAL_items.toArray(); 576if (itemsList[0] && itemsList[0].length) { 577var autoClose = browser.getItemAttribute(itemsList[0], "isautoclose"); 578if ( autoClose == "true") 579return true; 580else 581return false; 582} 583return false; 584} 585function HideMenu() { 586if (isMenuAutoClose()) 587return; 588var itemsList = GLOBAL_items.toArray(); 589if (GLOBAL_Hide == null) 590GLOBAL_Hide = new Array(); 591for (var i in itemsList) 592if (itemsList[i] && itemsList[i].length) { 593GLOBAL_items.removeItem(itemsList[i]); 594GLOBAL_Hide[i] = browser.hideMenuItem(itemsList[i]); 595} 596} 597function NOF_OpenedItems() { 598this.openedItems = ""; 599this.separator = "*"; 600this.addItem = function addItem(item, parent) { 601if ( item == null || !item || item == "" ) 602return; 603if (this.openedItems.indexOf(item) == -1) { 604this.openedItems += this.openedItems.length ? 605( this.openedItems.indexOf(this.separator) == this.openedItems.length - 1 ? "" : this.separator ) + item : 606item; 607} 608} 609this.removeItem = function removeItem(item) { 610if ( item == GLOBAL_CurrentItem ) 611return; 612var temp = this.openedItems; 613if (temp.indexOf(item) > 0) { 614var a = temp.substring(0, temp.indexOf(item)); 615var b = temp.substring(temp.indexOf(item) + item.length, temp.length ); 616temp = a + b; 617} 618while (temp.lastIndexOf(this.separator) == temp.length - 1) 619temp = temp.substring(0, temp.length - 1); 620this.openedItems = temp; 621} 622this.removeSubitems = function removeSubitems(item) { 623if (item && typeof(item) != "undefined") { 624var temp = this.openedItems; 625temp = temp.substring(0, temp.lastIndexOf(item) + item.length); 626var temp1 = this.openedItems.substring(this.openedItems.indexOf(temp) + temp.length, this.openedItems.length); 627temp1 = temp1.split(this.separator); 628for (var i = temp1.length - 1; i >= 0; i--) 629if (temp1[i]) 630browser.hideMenuItem(temp1[i]); 631this.openedItems = temp; 632} 633} 634this.currentItem = function currentItem() { 635var list = this.toArray(); 636return list[list.length - 1]; 637} 638this.removeAll = function removeAll() { 639var items = this.toArray(); 640clearTimeout(GLOBAL_Close); 641for (var i = items.length - 1; i >= 0; i--) 642if ( items[i] != null && items[i] != "" ) { 643if(!isNaN(items[i])) 644clearTimeout(items[i]); 645browser.hideMenuItem(items[i]); 646} 647this.openedItems = ""; 648} 649this.toArray = function toArray() { 650return this.openedItems.split(this.separator); 651} 652} 653function F_menu(item) { 654NOF_Menu(item); 655} 656function F_roll(itemId, over, layerId, isNotMainItem){ 657if (typeof(layerId) == "undefined") 658layerId = null; 659if (typeof(isNotMainItem) == "undefined") 660isNotMainItem = null; 661if (typeof(itemId) == "object" && itemId.constructor == Array) { 662for (var i = 0; i < itemId.length; i++) { 663NOF_MenuRollButton(itemId[i], over, layerId, isNotMainItem); 664} 665} 666else { 667NOF_MenuRollButton(itemId, over, layerId, isNotMainItem); 668} 669} 670function F_loadRollover(image, rollOverButton, submenu) { 671return NOF_MenuLoadRollOver(image, rollOverButton, submenu); 672} 673
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.