/* HM_Loader.js * HierMenus Version 6 * Copyright 2004 Jupitermedia Corporation */ HM_UserAgent = navigator.userAgent; HM_DOM = (document.getElementById) ? true : false; HM_NS4 = (document.layers) ? true : false; HM_IE = (document.all) ? true : false; HM_IE4 = HM_IE && !HM_DOM; HM_Mac = (navigator.appVersion.indexOf("Mac") != -1); HM_IE4M = HM_IE4 && HM_Mac; HM_IsSafari = ((HM_DOM)&& (parseInt(navigator.productSub)>=20020000)&& (navigator.vendor.indexOf("Apple Computer")!=-1)); if(HM_IsSafari) { HM_BrowserPattern = /Safari\/(\d+)/; HM_Matches = HM_UserAgent.match(HM_BrowserPattern); if (HM_Matches&&HM_Matches[1]) HM_BrowserVersion = (HM_Matches[1]-0); else HM_BrowserVersion = 0; } HM_Opera = (window.opera) ? true : false; if(HM_IsSafari||HM_Opera) { HM_IE=HM_NS4=HM_IE4=HM_IE4M=false; if(HM_IsSafari) HM_Mac=true; } HM_IE5M = (HM_IE&&HM_Mac&&HM_DOM); if(HM_Opera) { HM_BrowserPattern = /Opera(\/| )(\d+.*)/; HM_VersionSupported = 7; } HM_Konqueror = (HM_UserAgent.indexOf("Konqueror")!=-1); if(HM_Konqueror) { HM_BrowserPattern = /(Konqueror\/)(\d+.*)/; HM_VersionSupported = 3.2; } if(HM_Opera || HM_Konqueror) { if (HM_UserAgent.match) { HM_Matches = HM_UserAgent.match(HM_BrowserPattern); if (HM_Matches&&HM_Matches[2]) { HM_BrowserVersion = parseFloat(HM_Matches[2]); } else HM_BrowserVersion = 0; HM_IsMenu = (HM_BrowserVersion >= HM_VersionSupported); } else { HM_BrowserVersion = 0; HM_IsMenu = false; } } else { HM_BrowserVersion = 0; HM_IsMenu = !HM_IE4M && !HM_IE5M && (HM_DOM || HM_NS4 || HM_IE4 ); } if(window.event + "" == "undefined") event = null; function HM_f_PopUp(){return false}; function HM_f_PopDown(){return false}; popUp = HM_f_PopUp; popDown = HM_f_PopDown; // Configuration block. The following 6 variables should be configured // to match your default preferences. You can then override the settings // on a page by page basis by providing values for the variables in any // JavaScript segment that is loaded BEFORE this one. These variables // are the ONLY variables you should alter in this file. if(typeof(window.HM_ScriptDir)=="undefined") HM_ScriptDir = "/js/hm/scripts/optimized/"; if(typeof(window.HM_ImageDir)=="undefined") HM_ImageDir = "/js/hm/images/"; if(typeof(window.HM_ConfigDir)=="undefined") HM_ConfigDir = "/js/hm/configs/"; if(typeof(window.HM_ConfigFiles)=="undefined") HM_ConfigFiles = "HM_Config.js"; if(typeof(window.HM_ConfigType)=="undefined") HM_ConfigType = "default"; if(typeof(window.HM_FramesEnabled)!="boolean") HM_FramesEnabled = false; // Custom functions. We recommend that you delete any of these // that you have no use for, to reduce the overall download times // of the scripts. (Be sure to save yourself a copy, in case // you decide you want to use them in the future!) // The following function is included to illustrate the JS // expression handling of the MenuX and MenuY parameters. // It returns a centered horizontal position for the menu. function HW(kx){var b=0;var c=Hms[kx];var d=HM_DOM?parseInt(c.mh.style.width)+((Hjt||Hju)?0:c.sz+c.sx):HM_IE4?c.mh.style.pixelWidth:c.mh.clip.width; var gh=HM_IE?(HM_DOM?Hh.clientWidth:Hg.document.body.clientWidth):(Hg.document.body&&Hg.document.body.clientWidth)?Hg.document.body.clientWidth:Hg.innerWidth;return Math.max(parseInt((gh-d)/2),b);} HM_f_CenterMenu=HW; // The following three functions can be used in combination to // produce "sliding" menus; menus that slide in and out to their // desired locations. The "SetSlide" and "KillSlide" functions // are the required interface functions for HierMenus, and the // SlideMoveTo function does the actual work. To activate these // routines on a menu, you would add (as an example) // "ScrollEnabled:1,setTrans:HM_f_SetSlide,killTrans:HM_f_KillSlide,SlideInFrom:'left'" // to the menu definitions, in addition to the SlideIn/SlideOutInterval, // and SlideIn/SlideOutPercent variables (all of which will assume // defaults if not set). Note that for these particular transitions // to work, ScrollEnabled must be true on the menu. Hvq=(HM_DOM&&((navigator.productSub&&(navigator.productSub<20021130))||((/^Netscape/.test(navigator.vendor))&&(navigator.vendorSub==7.02))||(navigator.vendor=="Camino"&&(navigator.vendorSub<=.7)))); function HM_f_SetSlide(on){this.HYD();if(Hvq||(on&&!this.vm)||(!on&&!this.vn)){this.HYF(on);return;}else{var ve=(on?this.vm:this.vn);var vb=(on?this.vk:this.vl);if(!vb)vb=(HM_Opera)?20:10;var vj=(on?this.vo:this.vp);if(!vj)vj=20; }if(HM_Opera){if(this.mh.nl)this.HXh(null,1);}else{if(this.nl)this.HXh(null,1);}this.mh.uy={va:0,vf:0,vg:0,vc:"cs",vd:"width",vh:"left",vs:(HM_Opera)?parseInt(this.mh.cs.style.left):parseInt(this.cs.style.left),vr:vb};var uy=this.mh.uy; this.mh.vi=(on?1:2);if((ve=="top")||(ve=="bottom")){uy.vd="height";uy.vh="top";uy.vs=(HM_Opera)?parseInt(this.mh.cs.style.top):parseInt(this.cs.style.top);uy.vf=parseInt(this.mh.style.height);}else uy.vf=parseInt(this.mh.style.width); if((ve=="right")||(ve=="bottom"))uy.vc="mh";vj=vj/100;uy.vg=Math.round((uy.vf)*vj);if(uy.vc=="mh"){if(uy.vh=="left")uy.va=(on)?this.xPos:this.xPos+uy.vf;else uy.va=(on)?this.yPos:this.yPos+uy.vf;}else uy.va=(on)?uy.vs:uy.vf*(-1); if(on){this.mh.style[uy.vd]="0px";var jp=(uy.vc=="mh")?this.mh:(HM_Opera)?this.mh.cs:this.cs;jp.style[uy.vh]=((uy.vc=="mh")?uy.va+uy.vf:uy.vs-uy.vf)+"px";}else uy.vg*=(-1);HM_f_SlideMoveTo(this.ne);} function HM_f_SlideMoveTo(eg){if(Hax||!HWU())return;var uz=Hms[eg];if(!uz.mh.vi)return;var uy=uz.mh.uy;var jp=(uy.vc=="mh")?uz.mh:(HM_Opera)?uz.mh.cs:uz.cs;var oldPos=parseInt(jp.style[uy.vh]);var newPos=(oldPos+(uy.vg*(uy.vc=="mh"?(-1):1))); if((Math.abs(newPos-uy.va))=7.2)))?false:true;var rl=mf[rb];var rm=0;if(ra){rm=rh[re]; if(!isNaN(parseInt(rm))){if((rm.indexOf("%")!=-1)&&(mf.parentElement)){var rn=mf.parentElement[rd];if(isNaN(rn))rn=0;rm=Math.round((parseInt(rm)/100)*rn);}else rm=parseInt(rm);rl+=rm;}}if(qz&&mf.tagName!="TABLE"){rm=rh[rg]; if(!/\d/.test(rm))rm=mf.getAttribute('border');rm=parseInt(rm);if(!isNaN(rm))rl-=rm;}var ro=mf.offsetParent;var rp=true; if(HM_Opera&&ro&&(ro.tagName=="BODY")&&(HM_BrowserVersion>=7.2)){if(!/^(FORM|P|DIV|TD|TR|TABLE|DL|OL|UL)$/.test(mf.tagName))rp=false;}else if(HM_Opera&&(HM_BrowserVersion<7.2)){rp=false;}while(ro){rh=(ro.currentStyle)?ro.currentStyle:ro.style; if(window.getComputedStyle&&HM_Opera)rh=window.getComputedStyle(ro,null);if(rh&&(rh.position=="absolute"))ri=true;if(rh&&rh.position&&(rh.position!="static"))rj=true;if(ri&&HM_IsSafari)rk=false;if(HM_Opera&&rj&&(HM_BrowserVersion>=7.2))rk=false; if(HM_IE){if((!HM_Mac)&&(ro.tagName!="TABLE")&&(ro.tagName!=((Hjr)?"HTML":"BODY")))rl+=ro[rc];if(ra){rm=rh[re];if(!isNaN(parseInt(rm))){if((rm.indexOf("%")!=-1)&&(ro.parentElement)){var rq=ro.parentElement;var rn=rq[rd]; if(isNaN(rn))rn=0;rm=Math.round((parseInt(rm)/100)*rn);}else rm=parseInt(rm);rl+=rm;}}}else if(HM_NS6&&!HM_IsSafari){rm=rh[rg];var rr=rh.position;if(window.getComputedStyle&&!qy){rh=window.getComputedStyle(ro,null); rm=(xory=="x")?rh.getPropertyValue('border-left-width'):rh.getPropertyValue('border-top-width');rr=rh.getPropertyValue('position');}rm=(isNaN(parseInt(rm)))?0:parseInt(rm);if(rr=="absolute")ri=true; if(((ro.tagName=="BODY")&&(!qz))||((rr)&&(rr!="static")&&(ro.tagName!="TABLE"))){rl+=rm;}else if((ro.tagName=="TABLE")&&(qx)){if(rm==0){var rs=ro.getAttribute('frame');if(rs!=null)rl+=1;}else if(rm>0)rl+=rm; }}if(HM_NS6&&!qz&&!HM_IsSafari&&(ro.tagName=="BODY")&&!ri)rk=false;if((ro.tagName!="BODY")||rk){rl+=ro[rb];if(HM_Opera&&(ro.tagName=="BODY")&&rp)rl+=ro[rc];}ro=ro.offsetParent; }rh=(document.body.currentStyle)?document.body.currentStyle:document.body.style;if(HM_Konqueror&&!ri&&(HM_BrowserVersion<3.2)){rm=rh[re];if(!isNaN(parseInt(rm))){if(rm.indexOf("%")!=-1){var rn=document.documentElement.offsetWidth;if(isNaN(rn))rn=0; rm=parseInt((parseInt(rm)/100)*rn);}else rm=parseInt(rm);}else rm=10;rl+=rm;}return rl;} // The following function retrieves the current height or // width of a menu. Use it to position menus based on their // bottom or right edges, among other possibilities. function HM_f_GetMenuDimension(eg,width){var eh=Hms[eg];var mh=(eh)?eh.mh:null;if(mh){if(!HM_NS4&&((HM_Opera&&!mh.nb)||(!HM_Opera&&!eh.nb)))eh.HXq(false); if(HM_DOM){return((width)?((Hjt||Hju)?0:(eh.sz+eh.sx))+parseInt(mh.style.width):((Hjt||Hju)?0:(eh.sw+eh.sy))+parseInt(mh.style.height));}else if(HM_IE){return((width)?mh.style.pixelWidth:mh.style.pixelHeight); }else{return((width)?mh.clip.width:mh.clip.height);}}else return 0;} // In many (and especially older) browsers, select boxes and other form // elements as well as flash or java applets will cover menu elements // when they popup. The following function can be used to hide select // elements (or any other elements of your choosing) when the menus // appear or restore them when the menus are hidden. This function works // well in all HM supported browsers except NS4, which will only work // if the HTML of the page is structured in a specific way. For IE5.5 and // IE6.0, an alternate technique is presented lower in this script which // does not require element hiding. function HM_f_ToggleElementList(show,elList,toggleBy){if(HM_NS4&&(toggleBy=="tag"))return true;for(var i=0;i'+"\n"+'<\/scr'+'ipt>'+"\n"; document.write(HM_WriteString); for(var i=0; i'+"\n"+'<\/scr'+'ipt>'+"\n"; if(HM_aConfigs[i]) document.write(HM_WriteString); } if(HM_ConfigType=="arrays") { HM_WriteString = ''+"\n"+'<\/scr'+'ipt>'+"\n" document.write(HM_WriteString); } }