/* HM_Loader.js
*  HierMenus Version 6
*  Copyright 2004 Jupitermedia Corporation
*/


//alert("Got to HM_Loader.js");

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;

// /uration 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 variables and the GetElementXY function can 
// be used to position a menu relative to the current position 
// of another element on the page. 

HM_NS6=((navigator.product=="Gecko")||(HM_IsSafari));
if(HM_NS6||HM_Opera)HM_IE=HM_Konqueror=false;else if(HM_Konqueror)HM_IE=HM_NS6=HM_IsSafari=false;Hjr=(HM_IE&&document.compatMode)?document.compatMode=="CSS1Compat":false;
function HM_f_GetElementXY(elId,xory){var mf=document.images[elId];if(!mf)mf=document.anchors[elId];if(!mf){mf=(document.getElementById)?document.getElementById(elId):(document.all)?document.all(elId):(document.layers)?document.layers[elId]:null;
}if(!mf)return 0;if(HM_NS4){if(typeof(mf[xory])=="number")return mf[xory];else return 0;
}var qx=((navigator.productSub&&(navigator.productSub<20021130))||((/^Netscape/.test(navigator.vendor))&&(navigator.vendorSub==7.02))||(navigator.vendor=="Camino"&&(navigator.vendorSub<=.7)));
var qy=((/^Netscape/.test(navigator.vendor))&&(parseInt(navigator.vendorSub)==6));var qz=((qy)&&(navigator.vendorSub<6.1));if((HM_Konqueror)||(HM_Opera)||(HM_IsSafari))qx=qy=qz=false;var ra=((!HM_Mac)&&(HM_IE)&&(!document.getElementById));
var rb=(xory=="x")?"offsetLeft":"offsetTop";var rc=(xory=="x")?"clientLeft":"clientTop";var rd=(xory=="x")?"clientWidth":"clientHeight";var re=(xory=="x")?"marginLeft":"marginTop";var rf=(xory=="x")?"paddingLeft":"paddingTop";
var rg=(xory=="x")?"borderLeftWidth":"borderTopWidth";var rh=(mf.currentStyle)?mf.currentStyle:mf.style;if(window.getComputedStyle&&HM_Opera)rh=window.getComputedStyle(mf,null);var ri=(rh&&(rh.position=="absolute"));
var rj=(rh&&rh.position&&(rh.position!="static"));var rk=((ri&&HM_IsSafari)||(HM_Opera&&rj&&(HM_BrowserVersion>=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;}



// End custom functions


HM_IsMenu=(HM_Konqueror&&HM_FramesEnabled)?false:HM_IsMenu;
if(HM_IsMenu) {
HM_BrowserString = HM_NS4 ? "NS4" : HM_Opera ? "OPR" : HM_DOM ? "DOM" : "IE4";
HM_aConfigs = HM_ConfigFiles.split(',');

HM_WriteString = '<scr'+'ipt src="' + HM_ScriptDir + 'HM_Script' + HM_BrowserString + '.js" type="text/javascript">'+"\n"+'<\/scr'+'ipt>'+"\n"; 
document.write(HM_WriteString);

for(var i=0; i<HM_aConfigs.length; i++) {
HM_WriteString = '<scr'+'ipt src="' + HM_ConfigDir + HM_aConfigs[i] + '" type="text/javascript">'+"\n"+'<\/scr'+'ipt>'+"\n";
if(HM_aConfigs[i]) document.write(HM_WriteString);
}
if(HM_ConfigType=="arrays") {
HM_WriteString = '<scr'+'ipt src="' + HM_ScriptDir + 'HM_ConvertArrays.js" type="text/javascript">'+"\n"+'<\/scr'+'ipt>'+"\n"
document.write(HM_WriteString);
}

}