﻿var GLOBAL_LoadedImages=[],GLOBAL_CurrentItem="",GLOBAL_Close=null,GLOBAL_Hide=null,GLOBAL_items=new NOF_OpenedItems,GLOBAL_slideItem=null,GLOBAL_slideSpeed=10,GLOBAL_slidePixel=0,GLOBAL_slideMinOffset=-800,GLOBAL_slideMaxOffset=800,useDebuger=false;function NOF_DOMBrowser(){this.getMenuItemLayerStartString=function getMenuItemLayerStartString(b,a){a=a!=null&&a!="undefined"&&typeof a!="undefined"?new String(a+CONSTANTS.MENU_LAYER_SUFIX):null;b+=CONSTANTS.MENU_LAYER_SUFIX;var c=typeof C_MENU_AUTO_CLOSE=="undefined"||C_MENU_AUTO_CLOSE==true?"true":"false";return '<DIV ID="'+b+'" isautoclose="'+c+'" STYLE="z-index:5; filter:blendTrans(duration=0.5)" onmouseover="NOF_KeepOpen(\''+b+"', "+a+')" onmouseout="NOF_KeepClose()">'};this.getMenuItemLayerEndString=function getMenuItemLayerEndString(){return "</DIV>"};this.showMenuItem=function showMenuItem(c,a,g,h,b){if(typeof a=="string")a=this.getItem(a);c=typeof c=="string"?this.getItem(c):c;var f=this.findItemTopOffset(c),e=this.findItemLeftOffset(c),d="";if(b.indexOf("left")>-1||b.indexOf("Left")>-1){f+=h;e-=g;d="left"}else if(b.indexOf("top")>-1||b.indexOf("Top")>-1){f-=h;e+=g;d="top"}else if(b.indexOf("right")>-1||b.indexOf("Right")>-1){f+=h;e+=g;d="right"}else{f+=h;e+=g;d="bottom"}if(a==null||typeof a.style=="undefined"||a.style==null)return;a.style.top=f;a.style.left=e;a.style.visibility="visible";if(b.indexOf("slide")>-1)this.slideEffect(a,d);else if(b.indexOf("fade")>-1)this.fadeEffect(a)};this.hideMenuItem=function hideMenuItem(a){if(typeof a=="string")a=this.getItem(a);if(a==null||typeof a=="undefined"||a==""||typeof a=="number")return;a.style.visibility="hidden"};this.findItemLeftOffset=function findItemLeftOffset(a){var b=a.offsetLeft;if(a.offsetParent)b+=this.findItemLeftOffset(a.offsetParent);return b};this.findItemTopOffset=function findItemTopOffset(a){var b=a.offsetTop;if(a.offsetParent)b+=this.findItemTopOffset(a.offsetParent);return b};this.getItem=function getItem(a){return document.getElementById(a)};this.getItemAttribute=function getItemAttribute(itemId,attrId){if(this.getItem(itemId)){var attr=this.getItem(itemId).attributes;return eval("attr."+attrId.toLowerCase()+".value")}return ""};this.debug=function debug(b){var a=this.getItem("debug");if(useDebuger)a.value+=b+"\n"};this.fadeEffect=function fadeEffect(a){a.style.visibility="hidden";a.filters.blendTrans.Apply();a.filters.blendTrans.Play();a.style.visibility="visible"};this.slideEffect=function slideEffect(b,a){GLOBAL_slideItem=b;this.setItemClip("rect(auto, auto, auto, auto)");GLOBAL_slidePixel=a=="top"||a=="left"?100:0;this.playEffect(a)};this.playEffect=function playEffect(b){var c=GLOBAL_slideItem.style.clip;if(c.indexOf("-")>0)return;if(GLOBAL_slidePixel<GLOBAL_slideMinOffset||GLOBAL_slidePixel>GLOBAL_slideMaxOffset)return;var a="rect(";if(b=="top"){GLOBAL_slidePixel-=3;a+=GLOBAL_slidePixel+"px auto auto auto)"}else if(b=="right"){GLOBAL_slidePixel+=3;a+="auto "+GLOBAL_slidePixel+"px auto auto)"}else if(b=="bottom"){GLOBAL_slidePixel+=3;a+="auto auto "+GLOBAL_slidePixel+"px auto)"}else{GLOBAL_slidePixel-=3;a+="auto auto auto "+GLOBAL_slidePixel+"px)"}this.setItemClip(a);setTimeout('browser.playEffect("'+b+'")',GLOBAL_slideSpeed)};this.setItemClip=function setItemClip(a){GLOBAL_slideItem.style.clip=a};this.getLayerTag=function getLayerTag(){return "div"}}function NOF_BrowserNetscapeNavigator(){window.onclick=HideMenu;this.fadeEffect=function a(){return};GLOBAL_slideSpeed=1;return this}NOF_BrowserNetscapeNavigator.prototype=new NOF_DOMBrowser;function NOF_BrowserInternetExplorer(){document.onmouseup=HideMenu}NOF_BrowserInternetExplorer.prototype=new NOF_DOMBrowser;function NOF_BrowserNetscape4x(){this.getMenuItemLayerStartString=function getMenuItemLayerStartString(b,a){a=a!=null&&a!="undefined"&&typeof a!="undefined"?new String(a+CONSTANTS.MENU_LAYER_SUFIX):null;b+=CONSTANTS.MENU_LAYER_SUFIX;var c=typeof C_MENU_AUTO_CLOSE=="undefined"||C_MENU_AUTO_CLOSE==true?"true":"false";return '<layer ID="'+b+'" isautoclose="'+c+'" onmouseover="NOF_KeepOpen(\''+b+"', "+a+')" onmouseout="NOF_KeepClose()">'};this.getMenuItemLayerEndString=function getMenuItemLayerEndString(){return "</layer>"};this.getImageParent=function getImageParent(d){for(var b=0;b<document.layers.length;b++){var c=document.layers[b];for(var a=0;a<c.document.images.length;a++)if(c.document.images[a].name==d.name)return c}return null};this.showMenuItem=function showMenuItem(c,a,g,h,b){var i=this.getImageParent(c),j=c;if(typeof a=="string")a=this.getItem(a);c=typeof c=="string"?this.getItem(c):c;var e=this.findItemTopOffset(c),d=this.findItemLeftOffset(c);if(i!=null){d+=i.pageX;e+=i.pageY}var f="";if(b.indexOf("left")>-1||b.indexOf("Left")>-1){e+=h;d-=g;f="left"}else if(b.indexOf("top")>-1||b.indexOf("Top")>-1){e-=h;d+=g;f="top"}else if(b.indexOf("right")>-1||b.indexOf("Right")>-1){e+=h;d+=g;f="right"}else{e+=h;d+=g;f="bottom"}if(typeof a=="undefined")return;a.y=parseInt(e);a.x=parseInt(d);a.visibility="visible";if(b.indexOf("slide")>-1)this.slideEffect(a,f);else if(b.indexOf("fade")>-1)this.fadeEffect(a)};this.hideMenuItem=function hideMenuItem(a){if(typeof a=="string")a=this.getItem(a);if(a==null||typeof a=="undefined"||a=="")return;a.visibility="hide"};this.findItemLeftOffset=function findItemLeftOffset(a){return a.x};this.findItemTopOffset=function findItemTopOffset(a){return a.y};this.getItem=function getItem(itemId){return itemId==""?"":eval("document.layers['"+itemId+"']")};this.getItemAttribute=function getItemAttribute(itemId,attrId){return eval("document.layers['"+itemId.toLowerCase()+"']."+attrId)};this.getLayerTag=function getLayerTag(){return "layer"};this.slideEffect=function slideEffect(b,a){GLOBAL_slideItem=b;GLOBAL_slidePixel=a=="bottom"||a=="left"?200:0;this.playEffect(a)};this.playEffect=function playEffect(a){if(GLOBAL_slidePixel<GLOBAL_slideMinOffset||GLOBAL_slidePixel>GLOBAL_slideMaxOffset)return;if(a=="top")GLOBAL_slideItem.clip.bottom=GLOBAL_slidePixel+=1;else if(a=="right")GLOBAL_slideItem.clip.right=GLOBAL_slidePixel+=1;else if(a=="bottom")GLOBAL_slideItem.clip.top=GLOBAL_slidePixel-=1;else GLOBAL_slideItem.clip.left=GLOBAL_slidePixel-=1;setTimeout('browser.playEffect("'+a+'")',GLOBAL_slideSpeed)}}NOF_BrowserNetscape4x.prototype=new NOF_DOMBrowser;function NOF_BrowserFactory(){var a=navigator.userAgent.toLowerCase(),b=parseInt(navigator.appVersion),y=parseFloat(navigator.appVersion),d=a.indexOf("mozilla")!=-1&&a.indexOf("spoofer")==-1&&a.indexOf("compatible")==-1&&a.indexOf("opera")==-1&&a.indexOf("webtv")==-1&&a.indexOf("hotjava")==-1,z=d&&b==2,A=d&&b==3,p=d&&b==4,t=d&&b>=4,s=d&&(a.indexOf(";nav")!=-1||a.indexOf("; nav")!=-1),B=d&&b==5,i=d&&b>=5,v=a.indexOf("gecko")!=-1,c=a.indexOf("msie")!=-1&&a.indexOf("opera")==-1,e=c&&b<4,f=c&&b==4&&a.indexOf("msie 4")!=-1,w=c&&b>=4,g=c&&b==4&&a.indexOf("msie 5.0")!=-1,n=c&&b==4&&a.indexOf("msie 5.5")!=-1,m=c&&!e&&!f,r=c&&!e&&!f&&!g,C=c&&b==4&&a.indexOf("msie 6.")!=-1,x=c&&!e&&!f&&!g&&!n,o=a.indexOf("opera")!=-1,j=a.indexOf("opera 2")!=-1||a.indexOf("opera/2")!=-1,k=a.indexOf("opera 3")!=-1||a.indexOf("opera/3")!=-1,l=a.indexOf("opera 4")!=-1||a.indexOf("opera/4")!=-1,u=a.indexOf("opera 5")!=-1||a.indexOf("opera/5")!=-1,h=o&&!j&&!k&&!l;this.getBrowser=function q(){if(m)return new NOF_BrowserInternetExplorer;if(i)return new NOF_BrowserNetscapeNavigator;if(h)return new NOF_BrowserInternetExplorer;if(p)return new NOF_BrowserNetscape4x};return null}var browserFactory=new NOF_BrowserFactory,browser=browserFactory.getBrowser(),CONSTANTS={MENU_TYPE_IMAGE:"Image",MENU_TYPE_TEXT:"Text",BUTTON_TYPE_IMAGE:"image",BUTTON_TYPE_TEXT:"text",MENU_TABLE_HEADER:'<table border="0" cellspacing="0" cellpadding="0">',MENU_TABLE_END:"</table>",MOUSE_OVER_IMAGE:1,MOUSE_OUT_IMAGE:2,MENU_ITEM_HORIZONTAL:false,MENU_ITEM_VERTICAL:true,MENU_LAYER_SUFIX:"LYR",NOT_A_MAIN_ITEM:1,MENU_REFRESH_TIME:600};function NOF_Menu(){return this}function NOF_Menu_Item(){this.id=arguments[0];this.orientation=arguments[1];this.openEffect=arguments[2];this.offsetX=arguments[3];this.offsetY=arguments[4];this.buttons=[];this.submenuHeight=0;for(var a=5;a<arguments.length;a++)this.buttons[a-5]=arguments[a];this.getPosition=function(){return [this.offsetX,this.offsetY]};this.getOffsetX=function c(){return this.offsetX};this.getOffsetY=function getOffsetY(){return this.offsetY};this.getOpenEffect=function d(){return this.openEffect};this.getOrientation=function b(){return this.orientation};return this}function NOF_Menu_Button(d,b,a,c){this.link=d;this.normal=b;this.rollover=a!=""?a:b;this.submenu=c;this.hasSubmenu=function e(){return this.submenu!=null};this.type=function f(){if(typeof this.rollover=="object")return CONSTANTS.BUTTON_TYPE_TEXT;else if(typeof this.rollover=="string")return CONSTANTS.BUTTON_TYPE_IMAGE;else return null};return this}function NOF_Main_Menu(e,p){if(typeof e=="undefined")return;var j=e.id,a=browser.getMenuItemLayerStartString(j,p)+'<table width="10" border="'+C_MENU_BORDER+'" cellspacing="'+C_MENU_SPACING+'" cellpadding="0" bgcolor="'+C_MENU_BGCOLOR+'">',i=0;a+="<tr>";while(i<e.buttons.length){var d=e.buttons[i];if(d==null)return;var k="";if(d.hasSubmenu()&&d.submenu)k=d.submenu.id;var g=d.link,o=d.normal,c=d.rollover,h=d.type()==CONSTANTS.BUTTON_TYPE_IMAGE?true:false,b=h?j+"s"+i:"NavigationButton_"+j+"_"+i,n=e.orientation=="vertical"?true:false,m="";if(g.indexOf(" target=")!=-1){m=g.substr(g.indexOf(" target=")+8);g=g.substr(0,g.indexOf(" target="))}a+=n&&i>1?"<tr><td>":"<td>";var q=g!="javascript:void(0)"?"hand":"default";a+='<a class="nof-navPositioning" ';if(q=="default")a+='style="cursor: default" ';a+='href="'+g+'" ';a+="onMouseOver=\"F_roll('"+b+"' ,"+CONSTANTS.MOUSE_OVER_IMAGE+", '"+j+"', '"+CONSTANTS.NOT_A_MAIN_ITEM+"')\" onMouseOut=\"F_roll('"+b+"' ,"+CONSTANTS.MOUSE_OUT_IMAGE+", '"+j+"', '"+CONSTANTS.NOT_A_MAIN_ITEM+"')\"";a+=m.length?' target="'+m+'">':">";a+=h?'<img border="0" src="'+o+'"':"<"+browser.getLayerTag()+" ";if(typeof c!="undefined"||c.length||!h)if(k!=""){var f=d.submenu;if(h)a+='id="'+b+'" name="'+b+'" onLoad="F_loadRollover(this,\''+c+"', new Array('"+k+"','"+f.getOrientation()+"' , '"+f.getOpenEffect()+"', "+f.getOffsetX()+","+f.getOffsetY()+'))"';else{NOF_MenuLoadRollOver(b,c,[k,f.getOrientation(),f.getOpenEffect(),f.getOffsetX(),f.getOffsetY()]);a+='id="'+b+'" name="'+b+'" class="'+b+'" ';if(typeof d.rollover=="object")a+=' style="'+c[0]+'"'}}else if(h)a+='id="'+b+'" name="'+b+'" onLoad="F_loadRollover(this,\''+c+"',0)\"";else{NOF_MenuLoadRollOver(b,c,0);a+='id="'+b+'" name="'+b+'" class="'+b+'" ';if(typeof d.rollover=="object")a+=' style="'+c[0]+'"'}a+=h?"></a></td>":"><"+browser.getLayerTag()+' id="'+b+'_padding" style="padding:'+c[1]+'" padding="'+c[1]+'" paddingOver="'+c[3]+'">'+o+"</"+browser.getLayerTag()+"></"+browser.getLayerTag()+"></a></td>";a+=n?"</tr>":"";i++}a+=CONSTANTS.MENU_TABLE_END+browser.getMenuItemLayerEndString();document.writeln(a);var l=0;while(l<e.buttons.length){if(e.buttons[l].hasSubmenu())NOF_Main_Menu(e.buttons[l].submenu,e.id);l++}}function NOF_MenuLoadRollOver(a,b,d){if(a&&a.src&&(null==a.out||typeof a.out==typeof void 0)){var c=a.src;a.out=new Image;a.out.src=c;a.over=new Image;if(b.lastIndexOf("/")>=0||b.lastIndexOf("\\")>=0)c=b;else{var e=c.lastIndexOf("/");if(e<0)e=c.lastIndexOf("\\");if(e<0)c=b;else c=c.substring(0,e+1)+b}a.over.src=c;a.submenu=d;GLOBAL_LoadedImages[a.name]=a}else{if(typeof b=="object"){if(typeof GLOBAL_LoadedImages[a]=="undefined"){GLOBAL_LoadedImages[a+"Normal"]=b[0];GLOBAL_LoadedImages[a+"Over"]=b[2];GLOBAL_LoadedImages[a]=d}return}if(typeof d!="undefined"&&typeof a=="string"&&typeof GLOBAL_LoadedImages[a]=="undefined")GLOBAL_LoadedImages[a]=d}}function NOF_MenuRollButton(buttonName,over,layerId,isNotMainItem){var rollType=over==CONSTANTS.MOUSE_OVER_IMAGE?"over":"out",isOver=over==CONSTANTS.MOUSE_OVER_IMAGE?true:false,rollOver=GLOBAL_LoadedImages[buttonName];if(typeof rollOver=="undefined")return;var menuType=typeof rollOver.src=="undefined"?CONSTANTS.MENU_TYPE_TEXT:CONSTANTS.MENU_TYPE_IMAGE;if(menuType==CONSTANTS.MENU_TYPE_IMAGE){var imageRollSrcString="rollOver."+rollType+".src";if(rollOver)rollOver.src=eval(imageRollSrcString)?eval(imageRollSrcString):""}else if(menuType==CONSTANTS.MENU_TYPE_TEXT){if(typeof buttonName=="string"){browser.getItem(buttonName).className=isOver?buttonName+"Hover":buttonName;if(browser.getItem(buttonName+"_padding"))browser.getItem(buttonName+"_padding").style.padding=isOver?browser.getItem(buttonName+"_padding").paddingOver:browser.getItem(buttonName+"_padding").padding;if(typeof browser.getItem(buttonName).style!="undefined")browser.getItem(buttonName).style.cssText=isOver?GLOBAL_LoadedImages[buttonName+"Over"]:GLOBAL_LoadedImages[buttonName+"Normal"]}}else return;if((isNotMainItem==null||typeof isNotMainItem=="undefined")&&over==CONSTANTS.MOUSE_OUT_IMAGE){GLOBAL_CurrentItem="";GLOBAL_items.removeAll()}var hasSubmenu=null;if(menuType==CONSTANTS.MENU_TYPE_IMAGE)hasSubmenu=rollOver.submenu;else if(menuType==CONSTANTS.MENU_TYPE_TEXT)hasSubmenu=typeof rollOver=="object";if(hasSubmenu)if(over==CONSTANTS.MOUSE_OVER_IMAGE){if(layerId&&typeof layerId!="undefined"&&layerId!="null"){if(GLOBAL_Close!=null)clearTimeout(GLOBAL_Close);GLOBAL_items.removeSubitems(layerId+CONSTANTS.MENU_LAYER_SUFIX)}else GLOBAL_items.removeAll();if(menuType==CONSTANTS.MENU_TYPE_IMAGE)NOF_MenuOpenItem(rollOver,rollOver.submenu,layerId);else NOF_MenuOpenItem(buttonName,rollOver,layerId)}else if(menuType==CONSTANTS.MENU_TYPE_IMAGE)NOF_MenuCloseItem(rollOver.submenu);else NOF_MenuCloseItem(rollOver);else if(over==CONSTANTS.MOUSE_OVER_IMAGE)if(layerId&&typeof layerId!="undefined"&&layerId!="null"){GLOBAL_CurrentItem=layerId+CONSTANTS.MENU_LAYER_SUFIX;GLOBAL_items.removeSubitems(GLOBAL_CurrentItem)}else browser.hideMenuItem(GLOBAL_CurrentItem)}function NOF_MenuOpenItem(g,a,d){var b=a[0]+CONSTANTS.MENU_LAYER_SUFIX,h=a[1],c=a[2],e=a[3],f=a[4];GLOBAL_items.addItem(b,d);GLOBAL_CurrentItem=b;browser.showMenuItem(g,b,e,f,c)}function NOF_MenuCloseItem(a){if(a[0]){var b=a[0]+CONSTANTS.MENU_LAYER_SUFIX;if(GLOBAL_items.toArray().length==1)GLOBAL_CurrentItem=0;GLOBAL_Close=setTimeout("NOF_MenuHideItem('"+b+"')",CONSTANTS.MENU_REFRESH_TIME/4)}}function NOF_MenuHideItem(a){if(a&&a!=null&&GLOBAL_CurrentItem!=a)browser.hideMenuItem(a)}function NOF_KeepOpen(b){GLOBAL_CurrentItem=b;if(GLOBAL_Hide!=null)for(var a=0;a<GLOBAL_Hide.length;a++)clearTimeout(GLOBAL_Hide[a])}function NOF_KeepClose(){GLOBAL_CurrentItem="";setTimeout("NOF_CloseChilds()",CONSTANTS.MENU_REFRESH_TIME)}function NOF_CloseChilds(){var a=GLOBAL_items.toArray();GLOBAL_Hide=[];if(GLOBAL_CurrentItem==""||GLOBAL_CurrentItem==0)for(var b in a)if(a[b])GLOBAL_Hide[b]=setTimeout("browser.hideMenuItem('"+a[b]+"')",CONSTANTS.MENU_REFRESH_TIME/4);if(!isMenuAutoClose()){a=GLOBAL_items.toArray();for(var b in a)if(a[b])NOF_KeepOpen(a[b])}}function isMenuAutoClose(){var a=GLOBAL_items.toArray();if(a[0]&&a[0].length){var b=browser.getItemAttribute(a[0],"isautoclose");if(b=="true")return true;else return false}return false}function HideMenu(){if(isMenuAutoClose())return;var a=GLOBAL_items.toArray();if(GLOBAL_Hide==null)GLOBAL_Hide=[];for(var b in a)if(a[b]&&a[b].length){GLOBAL_items.removeItem(a[b]);GLOBAL_Hide[b]=browser.hideMenuItem(a[b])}}function NOF_OpenedItems(){this.openedItems="";this.separator="*";this.addItem=function e(a){if(a==null||!a||a=="")return;if(this.openedItems.indexOf(a)==-1)this.openedItems+=this.openedItems.length?(this.openedItems.indexOf(this.separator)==this.openedItems.length-1?"":this.separator)+a:a};this.removeItem=function c(b){if(b==GLOBAL_CurrentItem)return;var a=this.openedItems;if(a.indexOf(b)>0){var c=a.substring(0,a.indexOf(b)),d=a.substring(a.indexOf(b)+b.length,a.length);a=c+d}while(a.lastIndexOf(this.separator)==a.length-1)a=a.substring(0,a.length-1);this.openedItems=a};this.removeSubitems=function a(c){if(c&&typeof c!="undefined"){var a=this.openedItems;a=a.substring(0,a.lastIndexOf(c)+c.length);var b=this.openedItems.substring(this.openedItems.indexOf(a)+a.length,this.openedItems.length);b=b.split(this.separator);for(var d=b.length-1;d>=0;d--)if(b[d])browser.hideMenuItem(b[d]);this.openedItems=a}};this.currentItem=function b(){var a=this.toArray();return a[a.length-1]};this.removeAll=function d(){var b=this.toArray();clearTimeout(GLOBAL_Close);for(var a=b.length-1;a>=0;a--)if(b[a]!=null&&b[a]!=""){clearTimeout(b[a]);browser.hideMenuItem(b[a])}this.openedItems=""};this.toArray=function f(){return this.openedItems.split(this.separator)}}function F_menu(a){NOF_Menu(a)}function F_roll(a,e,c,b){if(typeof c=="undefined")c=null;if(typeof b=="undefined")b=null;if(typeof a=="object"&&a.constructor==Array)for(var d=0;d<a.length;d++)NOF_MenuRollButton(a[d],e,c,b);else NOF_MenuRollButton(a,e,c,b)}function F_loadRollover(c,a,b){return NOF_MenuLoadRollOver(c,a,b)}