/* 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 = "../en/";
if(typeof(window.HM_ImageDir)=="undefined")
	HM_ImageDir = "../en/";
if(typeof(window.HM_ConfigDir)=="undefined")
	HM_ConfigDir = "../en/";
if(typeof(window.HM_ConfigFiles)=="undefined")
	HM_ConfigFiles = "HM_Configs.js";
if(typeof(window.HM_ConfigType)=="undefined")
	HM_ConfigType = "default";
if(typeof(window.HM_FramesEnabled)!="boolean")
	HM_FramesEnabled = false;


// 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<elList.length;i++){var ElementsToToggle=[];
switch(toggleBy){case "tag":ElementsToToggle=(HM_DOM)?Hg.document.getElementsByTagName(elList[i]):Hg.document.all.tags(elList[i]);break;
case "id":ElementsToToggle[0]=(HM_DOM)?Hg.document.getElementById(elList[i]):(HM_IE)?Hg.document.all(elList[i]):Hg.document.layers[elList[i]];break;}for(var j=0;j<ElementsToToggle.length;j++){var theElement=ElementsToToggle[j];
if(!theElement)continue;if(HM_DOM||HM_IE)theElement.style.visibility=show?"inherit":"hidden";else if(HM_NS4)theElement.visibility=show?"inherit":"hide";}}return true;}

// The following functions are intended for use with the HM_OnVisibilityToggle,
// HM_OnMove, and HM_OnMenuCreated menu triggers. For Internet Explorer version 5.5 
// and 6, they utilize an IFrame based masking method that allows menus to cover 
// drop-down select boxes, Flash movies, and other windowed elements on pages 
// that have them.

function HM_f_IEMaskMove(menuEl,xPos,yPos){if(this.rt){this.rt.style.left=xPos+"px";this.rt.style.top=yPos+"px";}}
function HM_f_IEMaskToggle(menuEl,ru){if(window.HM_IE55){if(ru){this.rt.style.left=this.mh.style.left;this.rt.style.top=this.mh.style.top;this.rt.style.width=this.mh.offsetWidth;this.rt.style.height=this.mh.offsetHeight;
}if(this.rt)this.rt.style.visibility=(ru)?"visible":"hidden";}}
function HM_f_IEMaskCreate(menuEl){if(window.HM_IE55){this.rt=Hg.document.createElement("IFRAME");this.rt.src="javascript:void(0)";this.rt.frameBorder=0;this.rt.style.position="absolute";this.rt.style.visibility="hidden";
this.rt.style.left=(HXN())?"0px":"-500px";this.rt.style.top="-2000px";this.rt.style.width="100px";this.rt.style.height="100px";this.rt.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=0)";this.rt.allowTransparency=false;
if(this.UseInsert)Hg.document.body.insertBefore(this.rt,Hg.document.body.firstChild);else Hg.document.body.appendChild(this.rt);}}

// 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);
	}
}
