/*HM_Loader.js
* by Peter Belesis. v4.0.12 010612
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
*/

   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_IE4M));

HM_BrowserString = HM_NS4 ? "NS4" : HM_DOM ? "DOM" : "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;


HM_GL_MenuWidth          = 150;
HM_GL_FontFamily         = "Arial,sans-serif";
HM_GL_FontSize           = 10;
HM_GL_FontBold           = true;
HM_GL_FontItalic         = false;
HM_GL_FontColor          = "black";
HM_GL_FontColorOver      = "white";
HM_GL_BGColor            = "transparent";
HM_GL_BGColorOver        = "transparent";
HM_GL_ItemPadding        = 3;

HM_GL_BorderWidth        = 2;
HM_GL_BorderColor        = "red";
HM_GL_BorderStyle        = "solid";
HM_GL_SeparatorSize      = 2;
HM_GL_SeparatorColor     = "yellow";
HM_GL_ImageSrc           = "tri.gif";
HM_GL_ImageSrcLeft       = "triL.gif";
HM_GL_ImageSize          = 10;
HM_GL_ImageHorizSpace    = 10;
HM_GL_ImageVertSpace     = 10;

HM_GL_KeepHilite         = false;
HM_GL_ClickStart         = false;
HM_GL_ClickKill          = 0;
HM_GL_ChildOverlap       = 40;
HM_GL_ChildOffset        = 10;
HM_GL_ChildPerCentOver   = null;
HM_GL_TopSecondsVisible  = .5;
HM_GL_ChildSecondsVisible = .3;
HM_GL_StatusDisplayBuild = 0;
HM_GL_StatusDisplayLink  = 1;
HM_GL_UponDisplay        = null;
HM_GL_UponHide           = null;

//HM_GL_RightToLeft      = true;
HM_GL_CreateTopOnly      = HM_NS4 ? true : false;
HM_GL_ShowLinkCursor     = true;

// the following function is included to illustrate the improved JS expression handling of
// the left_position and top_position parameters
// you may delete if you have no use for it

function HM_f_CenterMenu(topmenuid) {
	var MinimumPixelLeft = 0;
	var TheMenu = HM_DOM ? document.getElementById(topmenuid) : HM_IE4 ? document.all(topmenuid) : eval("window." + topmenuid);
	var TheMenuWidth = HM_DOM ? parseInt(TheMenu.style.width) : HM_IE4 ? TheMenu.style.pixelWidth : TheMenu.clip.width;
	var TheWindowWidth = HM_IE ? document.body.clientWidth : window.innerWidth;
	return Math.max(parseInt((TheWindowWidth-TheMenuWidth) / 2),MinimumPixelLeft);
}

function lib_bwcheck(){
	this.ver=navigator.appVersion; this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}
var bw=new lib_bwcheck()


function HM_f_HideSelects(showSelects, menu){
	if(!bw.ns4 && HM_AreLoaded){ //CHECKING FOR SELECT BOXES
		selects = bw.ie4 ? document.all.tags("SELECT") : document.getElementsByTagName("SELECT")
		for(i=0;i<selects.length;i++){
			if(selects[i].offsetParent){
				selp = selects[i]
				selx = 0
				sely = 0
				while(selp.offsetParent){
					selp  = selp.offsetParent
					selx += selp.offsetLeft
					sely += selp.offsetTop
				}
				selx += selects[i].offsetLeft
				sely += selects[i].offsetTop
				selw  = selects[i].offsetWidth
				selh  = selects[i].offsetHeight

				menx = menu.style.left.toString()
				meny = menu.style.top.toString()
				menw = menu.style.width.toString()
				menh = menu.style.height.toString()
				menx = parseInt(menu.style.left.substring(0, 3))
				meny = parseInt(menu.style.top.substring(0, 3))
				menw = parseInt(menu.style.width.substring(0, 3))
				menh = parseInt(menu.style.height.substring(0, 3))
				//window.status = selx + ' ' + sely + ' ' + selw + ' ' + selh + '    ' + menx + ' ' + meny + ' ' + menw + ' ' + menh
				if(((selx + selw) > menx && selx < (menx + menw))
				&& ((sely + selh) > meny && sely < (meny + menh))){
					if(showSelects == "hide" && selects[i].style.visibility != "hidden")  selects[i].style.visibility="hidden"
					if(showSelects == "show" && selects[i].style.visibility != "visible") selects[i].style.visibility="visible"
				}
			}
		}
	}
}

function stringReplace(originalString, findText, replaceText)
{
 var pos=0;
 var len=findText.length;
 pos=originalString.indexOf(findText);
 while (pos!=-1)
  {
   preString=originalString.substring(0,pos);
   postString=originalString.substring(pos+len,originalString.length);
   originalString=preString+replaceText+postString;
   pos=originalString.indexOf(findText);
  }
 return originalString;
}



//end