/*
	Title		: HM_Loader.js
	Description	: DTML menu setup script
	Author		: Steve Ford and:	
				  Copyright (c) 2001 Peter Belesis. All Rights Reserved.
				  Originally published and documented at http://www.dhtmlab.com/
				  You may use this code on a public Web site only if this entire
				  copyright notice appears unchanged and you publicly display
				  a link to http://www.dhtmlab.com/.				  
	Updated		: 21/4/01
*/

// determine browser type and version
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_IsMenu = (HM_DOM || HM_NS4 || HM_IE4);

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "IE4";

// (re-)prototype menu initiators (to avoid IE4+ layers bug)
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;

// See if we're in a sub-directory, then...
count = 0;
pos = 0;
while (pos != -1) {
	pos = location.pathname.indexOf('/', pos + 1);
	count++;
}

if(HM_IsMenu) {
	if (count = 1) { // we're in the (a) server root
		document.write("<scr" + "ipt language='JavaScript1.2' src='JavaMenu/sub_HM_Arrays.js' type='text/javascript'><\/scr" + "ipt>");
		document.write("<scr" + "ipt language='JavaScript1.2' src='JavaMenu/HM_Script"+ HM_BrowserString +".js' type='text/javascript'><\/scr" + "ipt>");
	} else { // we're in a subdirectory of the (a) server
		document.write("<scr" + "ipt language='JavaScript1.2' src='../JavaMenu/HM_Arrays.js' type='text/javascript'><\/scr" + "ipt>");
		document.write("<scr" + "ipt language='JavaScript1.2' src='../JavaMenu/HM_Script"+ HM_BrowserString +".js' type='text/javascript'><\/scr" + "ipt>");
	}
}