Menu uniwersalne


Po kliknięciu nastąpi powrót do strony głównej skryptów.

       Niezwykle uniwersalne, ale nieco skomplikowane menu. Jego uniwersalność polega na tym, że może być używane jako menu w postaci zwartego panelu dostępnego u góry ekranu, bądź wywoływane w dowolnym miejscu strony poleceniem tekstowym, albo zilustrowane grafiką. Jego komplikacja wynika z potrzeby użycia szeregu skryptów i grafik. Przekonany jednak jestem, że osoba nawet niedoświadczona potrafi z powodzeniem używać tego menu.


Pozycja relatywna – zbliżenie kursora

Pozycja relatywna – kliknięcie myszki

Pozycja absolutna – zbliżenie kursora





Spis treści:

Zawartość skryptu HM_ScriptIE4.js
Zawartość skryptu HM_ScriptNS4.js
Zawartość skryptu HM_Loader.js
Zawartość skryptu HM_ScriptDOM.js
Zawartość skryptu Hm_pg.js
Zawartość skryptu HM_Arrays.js
Przeskok do dólu strony





Do zamieszczenia w ramach HEAD:

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--

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;

//-->
</SCRIPT>
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript" SRC="Hm_pg.js"></SCRIPT>


Do umieszczenia w dowolnym miejscu (wywołanie):

<SCRIPT LANGUAGE="JavaScript1.2"
SRC="HM_Loader.js"
TYPE='text/javascript'></SCRIPT>

<A HREF="aLinkForOldBrowsersGoesHere.html"
onMouseOver="HM_f_PopUp('elMenu1',event)"
onMouseOut="HM_f_PopDown('elMenu1')">
Pozycja relatywna – zbliżenie kursora</A>

<A HREF="aLinkForOldBrowsersGoesHere.html"
onMouseOver="HM_f_PopUp('elMenu4',event)"
onMouseOut="HM_f_PopDown('elMenu4')">
Pozycja relatywna – kliknięcie myszki</A>

<A HREF="aLinkForOldBrowsersGoesHere.html"
onMouseOver="popUp('HM_Menu3',event)"
onMouseOut="popDown('HM_Menu3')">
Pozycja absolutna – zbliżenie kursora</A>


Zawartość skryptu HM_ScriptNS4.js:

/*HM_ScriptNS4.js
* by Peter Belesis. v4.0.13 010713
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
* Originally published and documented at http://www.dhtmlab.com/
* You may use this code only if this entire
* copyright notice appears unchanged and you publicly display
* a link to http://www.dhtmlab.com/.
*
* Contact peterbelesis@yahoo.co.uk for all other uses.
*/

HM_a_Parameters = [
["MenuWidth", 150, "number"],
["FontFamily", "Arial,sans-serif"],
["FontSize", 10, "number"],
["FontBold", false, "boolean"],
["FontItalic", false, "boolean"],
["FontColor", "black"],
["FontColorOver", "white"],
["BGColor", "white"],
["BGColorOver", "black"],
["ItemPadding", 3, "number"],
["BorderWidth", 2, "number"],
["BorderColor", "red"],
["SeparatorSize", 1, "number"],
["ImageSrc", "HM_More_black_right.gif"],
["ImageSrcOver", null],
["ImageSrcLeft", "HM_More_black_left.gif"],
["ImageSrcLeftOver", null],
["ImageSize", 5, "number"],
["ImageHorizSpace", 0, "number"],
["ImageVertSpace", 0, "number"],
["KeepHilite", false, "boolean"],
["ClickStart", false, "boolean"],
["ClickKill", true, "boolean"],
["ChildOverlap", 20, "number"],
["ChildOffset", 10, "number"],
["ChildPerCentOver", null, "number"],
["TopSecondsVisible", .5, "number"],
["ChildSecondsVisible",.3, "number"],
["StatusDisplayBuild", 1, "boolean"],
["StatusDisplayLink", 1, "boolean"],
["UponDisplay", null, "delayed"],
["UponHide", null, "delayed"],
["RightToLeft", false, "boolean"],
["CreateTopOnly", 0, "boolean"],
["ShowLinkCursor", false, "boolean"],
["NSFontOver", true, "boolean"]
]

HM_MenuIDPrefix = "HM_Menu";
HM_ItemIDPrefix = "HM_Item";
HM_ArrayIDPrefix = "HM_Array";

Function.prototype.isFunction = true;
Function.prototype.isString = false;
String.prototype.isFunction = false;
String.prototype.isString = true;
String.prototype.isBoolean = false;
String.prototype.isNumber = false;
Number.prototype.isString = false;
Number.prototype.isFunction = false;
Number.prototype.isBoolean = false;
Number.prototype.isNumber = true;
Boolean.prototype.isString = false;
Boolean.prototype.isFunction = false;
Boolean.prototype.isBoolean = true;
Boolean.prototype.isNumber = false;
Array.prototype.itemValidation = false;
Array.prototype.isArray = true;

function HM_f_AssignParameters(paramarray){
var ParamName = paramarray[0];
var DefaultValue = paramarray[1];
var FullParamName = "HM_" + ParamName;

if (typeof eval("window.HM_PG_" + ParamName) == "undefined") {
if (typeof eval("window.HM_GL_" + ParamName) == "undefined") {
eval(FullParamName + "= DefaultValue");
}
else {
eval(FullParamName + "= HM_GL_" + ParamName);
}
}
else {
eval(FullParamName + "= HM_PG_" + ParamName);
}

paramarray[0] = FullParamName;
paramarray[1] = eval(FullParamName);
}

function HM_f_EvalParameters(valuenew,valueold,valuetype){
var TestString, ParPosition;

if(typeof valuenew == "undefined" || valuenew == null || (valuenew.isString && valuenew.length == 0)){
return valueold;
}

if(valuetype != "delayed"){
while(valuenew.isString) {
ParPosition = valuenew.indexOf("(");
if(ParPosition !=-1) {
TestString = "window." + valuenew.substr(0,ParPosition);
if (typeof eval(TestString) != "undefined" && eval(TestString).isFunction) {
valuenew = eval(valuenew);
}
}
else break
}
}

while(valuenew.isFunction) {valuenew = valuenew()}

switch(valuetype){
case "number":
while (valuenew.isString) {valuenew = eval(valuenew)}
break;
case "boolean":
while (!valuenew.isBoolean) {
valuenew = (valuenew.isNumber) ? valuenew ? true : false : eval(valuenew);
}
break;
}

return valuenew;
}

for (i=0;i<HM_a_Parameters.length;i++) {
HM_f_AssignParameters(HM_a_Parameters[i]);
eval(HM_a_Parameters[i][0] + "= HM_f_EvalParameters("+ HM_a_Parameters[i][0]
+",null,HM_a_Parameters[i][2])")
}

HM_ChildPerCentOver = (isNaN(parseFloat(HM_ChildPerCentOver))) ? null :
parseFloat(HM_ChildPerCentOver)/100;

HM_ChildMilliSecondsVisible = HM_ChildSecondsVisible * 1000;

function HM_f_ValidateArray(arrayname){
var MenuArrayIsValid = false;
var MenuArrayIsObject = (typeof eval("window." + arrayname) == "object");
if(MenuArrayIsObject) {
var TheMenuArray = eval(arrayname);
if(TheMenuArray.isArray && TheMenuArray.length > 1) {
MenuArrayIsValid = true;
if(!TheMenuArray.itemValidation) {
while((typeof TheMenuArray[TheMenuArray.length-1] != "object") ||
(!TheMenuArray[TheMenuArray.length-1].isArray)) {
TheMenuArray.length--;
}
TheMenuArray.itemValidation = true;
}
}
}
return MenuArrayIsValid;
}

if(!window.HM_a_TreesToBuild) {
HM_a_TreesToBuild = [];
for(i=1; i<100; i++){
if(HM_f_ValidateArray(HM_ArrayIDPrefix + i)) HM_a_TreesToBuild[HM_a_TreesToBuild.length] = i;
}
}

HM_CurrentArray = null;
HM_CurrentTree = null;
HM_CurrentMenu = null;
HM_CurrentItem = null;
HM_a_TopMenus = [];
HM_AreLoaded = false;
HM_AreCreated = false;
HM_BeingCreated = false;
HM_UserOverMenu = false;
HM_HideAllTimer = null;
HM_TotalTrees = 0;
HM_ZIndex = 5000;

function HM_f_Initialize() {
if(HM_AreCreated) {
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i];
clearTimeout(TopMenu.hideTimer);
TopMenu.hideTimer = null;
}
clearTimeout(HM_HideAllTimer);
}
HM_AreCreated = false;
HM_BeingCreated = false;
HM_UserOverMenu = false;
HM_CurrentMenu = null;
HM_HideAllTimer = null;
HM_TotalTrees = 0;
HM_a_TopMenus = [];
}

Layer.prototype.showIt = HM_f_ShowIt;
Layer.prototype.keepInWindow = HM_f_KeepInWindow;
Layer.prototype.hideTree = HM_f_HideTree
Layer.prototype.hideParents = HM_f_HideParents;
Layer.prototype.hideChildren = HM_f_HideChildren;
Layer.prototype.hideTop = HM_f_HideTop;
Layer.prototype.hideSelf = HM_f_HideSelf;
Layer.prototype.hasChildVisible = false;
Layer.prototype.isOn = false;
Layer.prototype.hideTimer = null;
Layer.prototype.currentItem = null;
Layer.prototype.itemSetup = HM_f_ItemSetup;
Layer.prototype.itemCount = 0;
Layer.prototype.child = null;
Layer.prototype.isWritten = false;

HM_NS_OrigWidth = window.innerWidth;
HM_NS_OrigHeight = window.innerHeight;

window.onresize = function (){
if (window.innerWidth == HM_NS_OrigWidth && window.innerHeight == HM_NS_OrigHeight) return;
HM_f_Initialize();
window.history.go(0);
}

function HM_f_StartIt() {
if(HM_AreCreated) return;
HM_AreLoaded = true;
if (HM_ClickKill) {
HM_f_OtherMouseDown = (document.onmousedown) ? document.onmousedown : new Function;
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = function(){HM_f_PageClick();HM_f_OtherMouseDown()}
}
else {
HM_TopMilliSecondsVisible = HM_TopSecondsVisible * 1000;
}
HM_f_MakeTrees();
HM_f_OtherOnLoad();
}

function HM_f_MakeTrees(){
HM_BeingCreated = true;
var TreeParams = null;
var TreeHasChildren = false;
var ItemArray = null;

for(var t=0; t<HM_a_TreesToBuild.length; t++) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + HM_a_TreesToBuild[t])) continue;
HM_CurrentArray = eval(HM_ArrayIDPrefix + HM_a_TreesToBuild[t]);

TreeParams = HM_CurrentArray[0];
TreeHasChildren = false;

for(var i=1; i<HM_CurrentArray.length; i++) {
ItemArray = HM_CurrentArray[i];
if(ItemArray[ItemArray.length-1]) {TreeHasChildren = true; break}
}

HM_CurrentTree = {
MenuWidth : MenuWidth = HM_f_EvalParameters(TreeParams[0],HM_MenuWidth,"number"),
MenuLeft : MenuLeft = HM_f_EvalParameters(TreeParams[1],null,"delayed"),
MenuTop : MenuTop = HM_f_EvalParameters(TreeParams[2],null,"delayed"),
ItemWidth : ItemWidth = MenuWidth - (HM_BorderWidth*2),
ItemTextWidth : TreeHasChildren ? (ItemWidth - (HM_ImageSize + HM_ImageHorizSpace + HM_ItemPadding)) : ItemWidth,
HorizOffsetRight : HorizOffsetRight = (parseInt((HM_ChildPerCentOver != null) ? (HM_ChildPerCentOver * ItemWidth) : HM_ChildOverlap)) - HM_ItemPadding,
HorizOffsetLeft : (MenuWidth - HorizOffsetRight) - (HM_BorderWidth) - HM_ItemPadding,
FontColor : FontColor = HM_f_EvalParameters(TreeParams[3],HM_FontColor),
FontColorOver : FontColorOver = HM_f_EvalParameters(TreeParams[4],HM_FontColorOver),
BGColor : HM_f_EvalParameters(TreeParams[5],HM_BGColor),
BGColorOver : HM_f_EvalParameters(TreeParams[6],HM_BGColorOver),
BorderColor : HM_f_EvalParameters(TreeParams[7],HM_BorderColor),
TopIsPermanent : ((MenuLeft == null) || (MenuTop == null)) ? false :
HM_f_EvalParameters(TreeParams[9],false,"boolean"),
TopIsHorizontal : TopIsHorizontal = HM_f_EvalParameters(TreeParams[10],false,"boolean"),
TreeIsHorizontal : TreeHasChildren ? HM_f_EvalParameters(TreeParams[11],false,"boolean") : false,
PositionUnder : (!TopIsHorizontal || !TreeHasChildren) ? false :
HM_f_EvalParameters(TreeParams[12],false,"boolean"),
TopImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[13],true,"boolean") : false,
TreeImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[14],true,"boolean") : false,
UponDisplay : HM_f_EvalParameters(TreeParams[15],HM_UponDisplay,"delayed"),
UponHide : HM_f_EvalParameters(TreeParams[16],HM_UponHide,"delayed"),
RightToLeft : HM_f_EvalParameters(TreeParams[17],HM_RightToLeft,"boolean"),
NSFontOver : HM_NSFontOver ? (FontColor != FontColorOver) : false,
ClickStart : HM_f_EvalParameters(TreeParams[18],HM_ClickStart,"boolean")
}

HM_CurrentMenu = null;
HM_f_MakeMenu(HM_a_TreesToBuild[t]);
HM_a_TopMenus[HM_TotalTrees] = HM_CurrentTree.treeParent;
HM_TotalTrees++;
if(HM_CurrentTree.TopIsPermanent){
with(HM_CurrentTree.treeParent) {
moveTo(eval(HM_CurrentTree.MenuLeft),eval(HM_CurrentTree.MenuTop));
zIndex = HM_ZIndex;
visibility = "show";
}
}
}

if(HM_StatusDisplayBuild) status = HM_TotalTrees + " Hierarchical Menu Trees Created";
HM_AreCreated = true;
HM_BeingCreated = false;
}

function HM_f_GetItemHtmlStr(arraystring){
var TempString = arraystring;
if (HM_FontBold) TempString = TempString.bold();
if (HM_FontItalic) TempString = TempString.italics();
TempString = "<FONT FACE='" + HM_FontFamily + "' POINT-SIZE=" + HM_FontSize + ">" + TempString + "</FONT>";
var TempStringOver = TempString.fontcolor(HM_CurrentTree.FontColorOver);
TempString = TempString.fontcolor(HM_CurrentTree.FontColor);
return [TempString,TempStringOver];
}

function HM_f_MakeMenu(menucount) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + menucount)) return false;
HM_CurrentArray = eval(HM_ArrayIDPrefix + menucount);

NewMenu = eval("window." + HM_MenuIDPrefix + menucount);
if(!NewMenu) {
eval(HM_MenuIDPrefix + menucount + " = new Layer(HM_CurrentTree.MenuWidth,window)")
NewMenu = eval(HM_MenuIDPrefix + menucount);

if(HM_CurrentMenu) {
NewMenu.parentMenu = HM_CurrentMenu;
NewMenu.parentItem = HM_CurrentItem;
NewMenu.parentItem.child = NewMenu;
NewMenu.hasParent = true;
NewMenu.isHorizontal = HM_CurrentTree.TreeIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TreeImageShow;
}
else {
NewMenu.isHorizontal = HM_CurrentTree.TopIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TopImageShow;
}

HM_CurrentMenu = NewMenu;
HM_CurrentMenu.count = menucount;
HM_CurrentMenu.tree = HM_CurrentTree;
HM_CurrentMenu.array = HM_CurrentArray;
HM_CurrentMenu.maxItems = HM_CurrentArray.length - 1;
HM_CurrentMenu.bgColor = HM_CurrentTree.BorderColor;
HM_CurrentMenu.onmouseover = HM_f_MenuOver;
HM_CurrentMenu.onmouseout = HM_f_MenuOut;
HM_CurrentMenu.moveTo(0,0);
}

if(!HM_CurrentTree.treeParent) HM_CurrentTree.treeParent = HM_CurrentTree.startChild = HM_CurrentMenu;

while (HM_CurrentMenu.itemCount < HM_CurrentMenu.maxItems) {
HM_CurrentMenu.itemCount++;
HM_CurrentItem = eval("window." + HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount);
if(!HM_CurrentItem) {
eval(HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount + " = new Layer(HM_CurrentTree.ItemWidth - (HM_ItemPadding*2),HM_CurrentMenu)")
if(HM_StatusDisplayBuild) status = "Creating Hierarchical Menus: " + menucount + " / " + HM_CurrentMenu.itemCount;
HM_CurrentItem = eval(HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount);
HM_CurrentItem.itemSetup(menucount + "_" + HM_CurrentMenu.itemCount);
}
if(HM_CurrentItem.hasMore && (!HM_CreateTopOnly || HM_AreCreated && HM_CreateTopOnly)) {
MenuCreated = HM_f_MakeMenu(menucount + "_" + HM_CurrentMenu.itemCount);
if(MenuCreated) {
HM_CurrentMenu = HM_CurrentMenu.parentMenu;
HM_CurrentArray = HM_CurrentMenu.array;
}
}
}
HM_CurrentMenu.itemCount = 0;
if (HM_CurrentMenu.isHorizontal) {
HM_CurrentMenu.clip.right = HM_CurrentMenu.lastItem.left + HM_CurrentMenu.lastItem.clip.right + HM_BorderWidth;
}
else {
HM_CurrentMenu.clip.right = HM_CurrentTree.MenuWidth;
}
HM_CurrentMenu.clip.bottom = HM_CurrentMenu.lastItem.top + HM_CurrentMenu.lastItem.clip.bottom + HM_BorderWidth;

return HM_CurrentMenu;
}

function HM_f_ItemSetup(itemidsuffix) {
this.menu = HM_CurrentMenu;
this.tree = HM_CurrentTree;
this.index = HM_CurrentMenu.itemCount - 1;
this.array = HM_CurrentArray[HM_CurrentMenu.itemCount];
this.dispText = this.array[0];
this.linkText = this.array[1];
this.permHilite = HM_f_EvalParameters(this.array[3],false,"boolean");
this.hasRollover = (!this.permHilite && HM_f_EvalParameters(this.array[2],true,"boolean"));
this.hasMore = HM_f_EvalParameters(this.array[4],false,"boolean") && HM_f_ValidateArray(HM_ArrayIDPrefix + itemidsuffix);
var HtmlStrings = HM_f_GetItemHtmlStr(this.dispText);
this.htmStr = HtmlStrings[0];
this.htmStrOver = HtmlStrings[1];
this.visibility = "inherit";
this.onmouseover = HM_f_ItemOver;
this.onmouseout = HM_f_ItemOut;
this.menu.lastItem = this;
this.showChild = HM_f_ShowChild;

this.ClickStart = this.hasMore && this.tree.ClickStart && (this.tree.TopIsPermanent &&
(this.tree.treeParent==this.menu));
if(this.ClickStart) {
this.captureEvents(Event.MOUSEUP);
this.onmouseup = this.showChild;
this.linkText = "";
}
else {
if (this.linkText) {
this.captureEvents(Event.MOUSEUP);
this.onmouseup = HM_f_LinkIt;
}
}

if (this.menu.isHorizontal) {
if (this.index) this.left = this.siblingBelow.left + this.siblingBelow.clip.width + HM_SeparatorSize;
else this.left = (HM_BorderWidth + HM_ItemPadding);
this.top = (HM_BorderWidth + HM_ItemPadding);
}
else {
this.left = (HM_BorderWidth + HM_ItemPadding);
if (this.index) this.top = this.siblingBelow.top + this.siblingBelow.clip.height + HM_SeparatorSize;
else this.top = (HM_BorderWidth + HM_ItemPadding)
}
this.clip.top = this.clip.left = -HM_ItemPadding;
this.clip.right = this.tree.ItemWidth - HM_ItemPadding;
this.bgColor = this.permHilite ? this.tree.BGColorOver : this.tree.BGColor;

this.txtLyrOff = new Layer(HM_CurrentTree.ItemTextWidth - (HM_ItemPadding*2),this);
with(this.txtLyrOff) {
document.write(this.permHilite ? this.htmStrOver : this.htmStr);
document.close();
if (HM_CurrentTree.RightToLeft && this.menu.showImage) left = HM_ItemPadding + HM_ImageSize + HM_ImageHorizSpace;
visibility = "inherit";
}

if(this.tree.NSFontOver) {
if(!this.permHilite){
this.txtLyrOn = new Layer(HM_CurrentTree.ItemTextWidth - (HM_ItemPadding*2),this);
with(this.txtLyrOn) {
if (HM_CurrentTree.RightToLeft && this.menu.showImage) left = HM_ItemPadding + HM_ImageSize + HM_ImageHorizSpace;
visibility = "hide";
}
}
}

this.fullClip = this.txtLyrOff.document.height + (HM_ItemPadding * 2);
if(this.menu.isHorizontal) {
if(this.index) {
var SiblingHeight = this.siblingBelow.clip.height;
this.fullClip = Math.max(SiblingHeight,this.fullClip);
if(this.fullClip > SiblingHeight) {
var SiblingPrevious = this.siblingBelow;
while(SiblingPrevious != null) {
SiblingPrevious.clip.height = this.fullClip;
SiblingPrevious = SiblingPrevious.siblingBelow;
}
}
}
}
this.clip.height = this.fullClip;

this.dummyLyr = new Layer(100,this);
with(this.dummyLyr) {
left = top = -HM_ItemPadding;
clip.width = this.clip.width;
clip.height = this.clip.height;
visibility = "inherit";
}

if(this.hasMore && HM_CurrentMenu.showImage) {
this.imageSrc = this.tree.RightToLeft ? HM_ImageSrcLeft : HM_ImageSrc;
this.hasImageRollover = ((!this.tree.RightToLeft && HM_ImageSrcOver) || (this.tree.RightToLeft && HM_ImageSrcLeftOver));
if(this.hasImageRollover) {
this.imageSrcOver = this.tree.RightToLeft ? HM_ImageSrcLeftOver : HM_ImageSrcOver;
}

this.imgLyr = new Layer(HM_ImageSize,this);

with(this.imgLyr) {
document.write("<IMG SRC='" + this.imageSrc + "' WIDTH=" + HM_ImageSize + " VSPACE=0 HSPACE=0 BORDER=0>");
document.close();
moveBelow(this.txtLyrOff);
left = (HM_CurrentTree.RightToLeft) ? HM_ImageHorizSpace : this.tree.ItemWidth - (HM_ItemPadding * 2) - HM_ImageSize - HM_ImageHorizSpace;
top = HM_ImageVertSpace;
visibility = "inherit";
}
this.imageElement = this.imgLyr.document.images[0];
}
}

function HM_f_PopUp(menuname,e){
if (!HM_AreLoaded) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var TempMenu = eval("window."+menuname);
if(!TempMenu)return;
HM_CurrentMenu = TempMenu;
if (HM_CurrentMenu.tree.ClickStart) {
var ClickElement = e.target;
ClickElement.onclick = HM_f_PopMenu;
}
else HM_f_PopMenu(e);
}

function HM_f_PopMenu(e){
if (!HM_AreLoaded || !HM_AreCreated) return true;
if (HM_CurrentMenu.tree.ClickStart && e.type != "click") return true;
HM_f_HideAll();
HM_CurrentMenu.hasParent = false;
HM_CurrentMenu.tree.startChild = HM_CurrentMenu;
var mouse_x_position = e.pageX;
var mouse_y_position = e.pageY;
HM_CurrentMenu.xPos = (HM_CurrentMenu.tree.MenuLeft!=null) ? eval(HM_CurrentMenu.tree.MenuLeft) : mouse_x_position;
HM_CurrentMenu.yPos = (HM_CurrentMenu.tree.MenuTop!=null) ? eval(HM_CurrentMenu.tree.MenuTop) : mouse_y_position;

HM_CurrentMenu.keepInWindow();
HM_CurrentMenu.moveTo(HM_CurrentMenu.xPos,HM_CurrentMenu.yPos);
HM_CurrentMenu.isOn = true;
HM_CurrentMenu.showIt(true);
return false;
}

function HM_f_MenuOver() {
if(!this.tree.startChild){this.tree.startChild = this}
if(this.tree.startChild == this) HM_f_HideAll(this)
this.isOn = true;
HM_UserOverMenu = true;
HM_CurrentMenu = this;
if (this.hideTimer) clearTimeout(this.hideTimer);
}

function HM_f_MenuOut() {
this.isOn = false;
HM_UserOverMenu = false;
if(HM_StatusDisplayLink) status = "";
if(!HM_ClickKill) {
clearTimeout(HM_HideAllTimer);
HM_HideAllTimer = null;
HM_HideAllTimer = setTimeout("HM_CurrentMenu.hideTree()",HM_ChildMilliSecondsVisible);
}
}

function HM_f_ShowChild(){
if(!this.child) {
HM_CurrentTree = this.tree;
HM_CurrentMenu = this.menu;
HM_CurrentItem = this;
this.child = HM_f_MakeMenu(this.menu.count + "_"+(this.index+1));
this.tree.treeParent = this.menu;
this.tree.startChild = this.menu;
}
if (this.tree.PositionUnder && (this.menu == this.tree.treeParent)) {
this.child.xPos = this.pageX + this.clip.left - HM_BorderWidth;
this.child.yPos = this.menu.top + this.menu.clip.height - HM_BorderWidth;
}
else {
this.oL = this.pageX + this.clip.left;
this.child.offsetWidth = this.child.clip.width;
this.oT = this.pageY + this.clip.top - HM_BorderWidth;
if(this.tree.RightToLeft) {
this.child.xPos = this.oL + (this.tree.HorizOffsetRight - this.child.offsetWidth);
}
else {
this.child.xPos = this.oL + this.tree.HorizOffsetLeft;
}
this.child.yPos = this.oT + HM_ChildOffset + HM_BorderWidth;
}
if(!this.tree.PositionUnder || this.menu!=this.tree.treeParent) this.child.keepInWindow();
this.child.moveTo(this.child.xPos,this.child.yPos);
this.menu.hasChildVisible = true;
this.menu.visibleChild = this.child;
this.child.showIt(true);
}

function HM_f_ItemOver(){
if (HM_KeepHilite) {
if (this.menu.currentItem && this.menu.currentItem != this && this.menu.currentItem.hasRollover) {
with(this.menu.currentItem){
bgColor = this.tree.BGColor;
if(this.tree.NSFontOver) {
txtLyrOff.visibility = "inherit";
txtLyrOn.visibility = "hide";
}
}
if(this.menu.currentItem.hasImageRollover)this.menu.currentItem.imageElement.src =
this.menu.currentItem.imageSrc;
}
}
if(this.hasRollover) {
this.bgColor = this.tree.BGColorOver;
if(this.tree.NSFontOver) {
if(!this.txtLyrOn.isWritten){
this.txtLyrOn.document.write(this.htmStrOver);
this.txtLyrOn.document.close();
this.txtLyrOn.isWritten = true;
}
this.txtLyrOff.visibility = "hide";
this.txtLyrOn.visibility = "inherit";
}
if(this.hasImageRollover)this.imageElement.src = this.imageSrcOver;
}

if(HM_StatusDisplayLink) status = this.linkText;
this.menu.currentItem = this;
if (this.menu.hasChildVisible) {
if(this.menu.visibleChild == this.child && this.menu.visibleChild.hasChildVisible)
this.menu.visibleChild.hideChildren(this);
else this.menu.hideChildren(this);
}

if (this.hasMore && !this.ClickStart) this.showChild();
}

function HM_f_ItemOut() {
if ( (!HM_KeepHilite || ((this.tree.TopIsPermanent && (this.tree.treeParent==this)) && !this.menu.hasChildVisible)) && this.hasRollover) {
with(this){
bgColor = this.tree.BGColor;
if(this.tree.NSFontOver) {
txtLyrOff.visibility = "inherit";
txtLyrOn.visibility = "hide";
}
if(this.hasImageRollover)this.imageElement.src = this.imageSrc;
}
}
if(!HM_ClickKill && !HM_UserOverMenu) {
clearTimeout(HM_HideAllTimer);
HM_HideAllTimer = null;
HM_HideAllTimer = setTimeout("HM_CurrentMenu.hideTree()",HM_ChildMilliSecondsVisible);
}
}

function HM_f_ShowIt(on) {
if (!(this.tree.TopIsPermanent && (this.tree.treeParent==this))) {
if(!this.hasParent || (this.hasParent && this.tree.TopIsPermanent && (this.tree.treeParent==this.parentMenu) )) {
if (on == this.hidden)
eval(on ? this.tree.UponDisplay : this.tree.UponHide)
}
if(on) this.zIndex = ++HM_ZIndex;
this.visibility = on ? "show" : "hide";
}
if (HM_KeepHilite && this.currentItem && this.currentItem.hasRollover) {
with(this.currentItem){
bgColor = this.tree.BGColor;
if(this.tree.NSFontOver) {
txtLyrOff.visibility = "inherit";
txtLyrOn.visibility = "hide";
}
}
if(this.currentItem.hasImageRollover)this.currentItem.imageElement.src = this.currentItem.imageSrc;
}
this.currentItem = null;
}

function HM_f_KeepInWindow() {
var ExtraSpace = 10;
var WindowLeftEdge = window.pageXOffset;
var WindowTopEdge = window.pageYOffset;
var WindowWidth = window.innerWidth;
var WindowHeight = window.innerHeight;
var WindowRightEdge = (WindowLeftEdge + WindowWidth) - ExtraSpace;
var WindowBottomEdge = (WindowTopEdge + WindowHeight) - ExtraSpace;

var MenuLeftEdge = this.xPos;
var MenuRightEdge = MenuLeftEdge + this.clip.width;
var MenuBottomEdge = this.yPos + this.clip.height;

if (this.hasParent) {
var ParentLeftEdge = this.parentItem.pageX - HM_ItemPadding;
this.offsetWidth = this.clip.width;
}
if (MenuRightEdge > WindowRightEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetRight - this.offsetWidth;
}
else {
dif = MenuRightEdge - WindowRightEdge;
this.xPos -= dif;
}
this.xPos = Math.max(5,this.xPos);
}

if (MenuBottomEdge > WindowBottomEdge) {
dif = MenuBottomEdge - WindowBottomEdge;
this.yPos -= dif;
}

if (MenuLeftEdge < WindowLeftEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetLeft;
MenuRightEdge = this.xPos + this.offsetWidth;
if(MenuRightEdge > WindowRightEdge) this.xPos -= (MenuRightEdge - WindowRightEdge);
}
else {this.xPos = 5}
}
}

function HM_f_LinkIt() {
if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
else {
HM_f_HideAll();
location.href = this.linkText;
}
}

function HM_f_PopDown(menuname){
if (!HM_AreLoaded || !HM_AreCreated) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var MenuToHide = eval("window."+menuname);
if(!MenuToHide)return;
MenuToHide.isOn = false;
if (!HM_ClickKill) MenuToHide.hideTop();
}

function HM_f_HideAll(callingmenu) {
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i].tree.startChild;
if(TopMenu == callingmenu)continue
TopMenu.isOn = false;
if (TopMenu.hasChildVisible) TopMenu.hideChildren();
TopMenu.showIt(false);
}
}

function HM_f_HideTree() {
HM_HideAllTimer = null;
if (HM_UserOverMenu) return;
if (this.hasChildVisible) this.hideChildren();
this.hideParents();
}

function HM_f_HideTop() {
TopMenuToHide = this;
(HM_ClickKill) ? TopMenuToHide.hideSelf() : (this.hideTimer =
setTimeout("TopMenuToHide.hideSelf()",HM_TopMilliSecondsVisible));
}

function HM_f_HideSelf() {
this.hideTimer = null;
if (!this.isOn && !HM_UserOverMenu) this.showIt(false);
}

function HM_f_HideParents() {
var TempMenu = this;
while(TempMenu.hasParent) {
TempMenu.showIt(false);
TempMenu.parentMenu.isOn = false;
TempMenu = TempMenu.parentMenu;
}
TempMenu.hideTop();
}

function HM_f_HideChildren(callingitem) {
var TempMenu = this.visibleChild;
while(TempMenu.hasChildVisible) {
TempMenu.visibleChild.showIt(false);
TempMenu.hasChildVisible = false;
TempMenu = TempMenu.visibleChild;
}

if (!this.isOn || !callingitem.hasMore || this.visibleChild != callingitem.child) {
this.visibleChild.showIt(false);
this.hasChildVisible = false;
}
}

function HM_f_PageClick() {
if (!HM_UserOverMenu && HM_CurrentMenu!=null && !HM_CurrentMenu.isOn) HM_f_HideAll();
}

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

HM_f_OtherOnLoad = (window.onload) ? window.onload : new Function;
window.onload = HM_f_StartIt;

//end


Zawartość skryptu HM_Loader.js:

/*HM_Loader.js
* by Peter Belesis. v4.0.13 010712
* 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 = "HM_More_black_right.gif";
HM_GL_ImageSrcLeft = "HM_More_black_left.gif";

HM_GL_ImageSrcOver = "HM_More_white_right.gif";
HM_GL_ImageSrcLeftOver = "HM_More_white_left.gif";

HM_GL_ImageSize = 5;
HM_GL_ImageHorizSpace = 5;
HM_GL_ImageVertSpace = 5;

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);
}

if(HM_IsMenu) {
document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='HM_Arrays.js'
TYPE='text/javascript'><\/SCR" + "IPT>");
document.write("<SCR" + "IPT LANGUAGE='JavaScript1.2' SRC='HM_Script"+ HM_BrowserString +".js'
TYPE='text/javascript'><\/SCR" + "IPT>");
}

//end


Zawartość skryptu HM_ScriptIE4.js:

/*HM_ScriptIE4.js
* by Peter Belesis. v4.0.13 010712
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
* Originally published and documented at http://www.dhtmlab.com/
* You may use this code only if this entire
* copyright notice appears unchanged and you publicly display
* a link to http://www.dhtmlab.com/.
*
* Contact peterbelesis@yahoo.co.uk for all other uses.
*/

HM_a_Parameters = [
["MenuWidth", 150, "number"],
["FontFamily", "Arial,sans-serif"],
["FontSize", 10, "number"],
["FontBold", false, "boolean"],
["FontItalic", false, "boolean"],
["FontColor", "black"],
["FontColorOver", "white"],
["BGColor", "white"],
["BGColorOver", "black"],
["ItemPadding", 3, "number"],
["BorderWidth", 2, "number"],
["BorderColor", "red"],
["BorderStyle", "solid"],
["SeparatorSize", 1, "number"],
["SeparatorColor", "yellow"],
["ImageSrc", "HM_More_black_right.gif"],
["ImageSrcOver", null],
["ImageSrcLeft", "HM_More_black_left.gif"],
["ImageSrcLeftOver", null],
["ImageSize", 5, "number"],
["ImageHorizSpace", 0, "number"],
["ImageVertSpace", 0, "number"],
["KeepHilite", false, "boolean"],
["ClickStart", false, "boolean"],
["ClickKill", true, "boolean"],
["ChildOverlap", 20, "number"],
["ChildOffset", 10, "number"],
["ChildPerCentOver", null, "number"],
["TopSecondsVisible", .5, "number"],
["ChildSecondsVisible",.3, "number"],
["StatusDisplayBuild", 1, "boolean"],
["StatusDisplayLink", 1, "boolean"],
["UponDisplay", null, "delayed"],
["UponHide", null, "delayed"],
["RightToLeft", false, "boolean"],
["CreateTopOnly", 0, "boolean"],
["ShowLinkCursor", false, "boolean"]
]

HM_MenuIDPrefix = "HM_Menu";
HM_ItemIDPrefix = "HM_Item";
HM_ArrayIDPrefix = "HM_Array";

Function.prototype.isFunction = true;
Function.prototype.isString = false;
String.prototype.isFunction = false;
String.prototype.isString = true;
String.prototype.isBoolean = false;
String.prototype.isNumber = false;
Number.prototype.isString = false;
Number.prototype.isFunction = false;
Number.prototype.isBoolean = false;
Number.prototype.isNumber = true;
Boolean.prototype.isString = false;
Boolean.prototype.isFunction = false;
Boolean.prototype.isBoolean = true;
Boolean.prototype.isNumber = false;
Array.prototype.itemValidation = false;
Array.prototype.isArray = true;

function HM_f_AssignParameters(paramarray){
var ParamName = paramarray[0];
var DefaultValue = paramarray[1];
var FullParamName = "HM_" + ParamName;

if (typeof eval("window.HM_PG_" + ParamName) == "undefined") {
if (typeof eval("window.HM_GL_" + ParamName) == "undefined") {
eval(FullParamName + "= DefaultValue");
}
else {
eval(FullParamName + "= HM_GL_" + ParamName);
}
}
else {
eval(FullParamName + "= HM_PG_" + ParamName);
}

paramarray[0] = FullParamName;
paramarray[1] = eval(FullParamName);
}

function HM_f_EvalParameters(valuenew,valueold,valuetype){
var TestString, ParPosition;

if(typeof valuenew == "undefined" || valuenew == null || (valuenew.isString && valuenew.length == 0)){
return valueold;
}

if(valuetype != "delayed"){
while(valuenew.isString) {
ParPosition = valuenew.indexOf("(");
if(ParPosition !=-1) {
TestString = "window." + valuenew.substr(0,ParPosition);
if (typeof eval(TestString) != "undefined" && eval(TestString).isFunction) {
valuenew = eval(valuenew);
}
}
else break
}
}

while(valuenew.isFunction) {valuenew = valuenew()}

switch(valuetype){
case "number":
while (valuenew.isString) {valuenew = eval(valuenew)}
break;
case "boolean":
while (!valuenew.isBoolean) {
valuenew = (valuenew.isNumber) ? valuenew ? true : false : eval(valuenew);
}
break;
}

return valuenew;
}

for (i=0;i<HM_a_Parameters.length;i++) {
HM_f_AssignParameters(HM_a_Parameters[i]);
eval(HM_a_Parameters[i][0] + "= HM_f_EvalParameters("+ HM_a_Parameters[i][0]
+",null,HM_a_Parameters[i][2])")
}

HM_ChildPerCentOver = (isNaN(parseFloat(HM_ChildPerCentOver))) ? null :
parseFloat(HM_ChildPerCentOver)/100;

HM_ChildMilliSecondsVisible = HM_ChildSecondsVisible * 1000;

function HM_f_ValidateArray(arrayname){
var MenuArrayIsValid = false;
var MenuArrayIsObject = (typeof eval("window." + arrayname) == "object");
if(MenuArrayIsObject) {
var TheMenuArray = eval(arrayname);
if(TheMenuArray.isArray && TheMenuArray.length > 1) {
MenuArrayIsValid = true;
if(!TheMenuArray.itemValidation) {
while((typeof TheMenuArray[TheMenuArray.length-1] != "object") ||
(!TheMenuArray[TheMenuArray.length-1].isArray)) {
TheMenuArray.length--;
}
TheMenuArray.itemValidation = true;
}
}
}
return MenuArrayIsValid;
}

if(!window.HM_a_TreesToBuild) { HM_a_TreesToBuild = [];
for(i=1; i<100; i++){
if(HM_f_ValidateArray(HM_ArrayIDPrefix + i)) HM_a_TreesToBuild[HM_a_TreesToBuild.length] = i;
}
}

HM_CurrentArray = null;
HM_CurrentTree = null;
HM_CurrentMenu = null;
HM_CurrentItem = null;
HM_a_TopMenus = [];
HM_AreLoaded = false;
HM_AreCreated = false;
HM_BeingCreated = false;
HM_UserOverMenu = false;
HM_HideAllTimer = null;
HM_TotalTrees = 0;
HM_ZIndex = 5000;

function propertyTransfer(){
this.obj = eval(this.id + "Obj");
for (temp in this.obj) {this[temp] = this.obj[temp]}
}

function HM_f_StartIt() {
if((typeof(document.body) == "undefined") || (document.body == null)) return;
if(HM_AreCreated) return;
HM_AreLoaded = true;
if (HM_ClickKill) {
HM_f_OtherMouseDown = (document.onmousedown) ? document.onmousedown : new Function;
document.onmousedown = function(){HM_f_PageClick();HM_f_OtherMouseDown()}
}
else {
HM_TopMilliSecondsVisible = HM_TopSecondsVisible * 1000;
}
HM_f_MakeTrees();
HM_f_OtherOnLoad();
}

function HM_f_MakeTrees(){
HM_BeingCreated = true;
var TreeParams = null;
var TreeHasChildren = false;
var ItemArray = null;

for(var t=0; t<HM_a_TreesToBuild.length; t++) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + HM_a_TreesToBuild[t])) continue;
HM_CurrentArray = eval(HM_ArrayIDPrefix + HM_a_TreesToBuild[t]);

TreeParams = HM_CurrentArray[0];
TreeHasChildren = false;

for(var i=1; i<HM_CurrentArray.length; i++) {
ItemArray = HM_CurrentArray[i];
if(ItemArray[ItemArray.length-1]) {TreeHasChildren = true; break}
}

HM_CurrentTree = {
MenuWidth : MenuWidth = HM_f_EvalParameters(TreeParams[0],HM_MenuWidth,"number"),
MenuLeft : MenuLeft = HM_f_EvalParameters(TreeParams[1],null,"delayed"),
MenuTop : MenuTop = HM_f_EvalParameters(TreeParams[2],null,"delayed"),
ItemWidth : ItemWidth = MenuWidth - (HM_BorderWidth*2),
ItemTextWidth : TreeHasChildren ? (ItemWidth - (HM_ImageSize + HM_ImageHorizSpace + HM_ItemPadding)) : ItemWidth,
HorizOffsetRight : HorizOffsetRight = (parseInt((HM_ChildPerCentOver != null) ? (HM_ChildPerCentOver * ItemWidth) : HM_ChildOverlap)),
HorizOffsetLeft : (MenuWidth - HorizOffsetRight),
FontColor : HM_f_EvalParameters(TreeParams[3],HM_FontColor),
FontColorOver : HM_f_EvalParameters(TreeParams[4],HM_FontColorOver),
BGColor : HM_f_EvalParameters(TreeParams[5],HM_BGColor),
BGColorOver : HM_f_EvalParameters(TreeParams[6],HM_BGColorOver),
BorderColor : HM_f_EvalParameters(TreeParams[7],HM_BorderColor),
SeparatorColor : HM_f_EvalParameters(TreeParams[8],HM_SeparatorColor),
TopIsPermanent : ((MenuLeft == null) || (MenuTop == null)) ? false :
HM_f_EvalParameters(TreeParams[9],false,"boolean"),
TopIsHorizontal : TopIsHorizontal = HM_f_EvalParameters(TreeParams[10],false,"boolean"),
TreeIsHorizontal : TreeHasChildren ? HM_f_EvalParameters(TreeParams[11],false,"boolean") : false,
PositionUnder : (!TopIsHorizontal || !TreeHasChildren) ? false :
HM_f_EvalParameters(TreeParams[12],false,"boolean"),
TopImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[13],true,"boolean") : false,
TreeImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[14],true,"boolean") : false,
UponDisplay : HM_f_EvalParameters(TreeParams[15],HM_UponDisplay,"delayed"),
UponHide : HM_f_EvalParameters(TreeParams[16],HM_UponHide,"delayed"),
RightToLeft : HM_f_EvalParameters(TreeParams[17],HM_RightToLeft,"boolean"),
ClickStart : HM_f_EvalParameters(TreeParams[18],HM_ClickStart,"boolean")
}

HM_CurrentMenu = null;
HM_f_MakeMenu(HM_a_TreesToBuild[t]);
HM_a_TopMenus[HM_TotalTrees] = HM_CurrentTree.treeParent;
HM_TotalTrees++;
if(HM_CurrentTree.TopIsPermanent){
with(HM_CurrentTree.treeParent) {
HM_CurrentTree.treeParent.xPos = eval(HM_CurrentTree.MenuLeft);
HM_CurrentTree.treeParent.yPos = eval(HM_CurrentTree.MenuTop);
moveTo(HM_CurrentTree.treeParent.xPos,HM_CurrentTree.treeParent.yPos);
style.zIndex = HM_ZIndex;
setTimeout(HM_CurrentTree.treeParent.id + ".fixSize(true)",10);
}
}
}

if(HM_StatusDisplayBuild) status = HM_TotalTrees + " Hierarchical Menu Trees Created";
HM_AreCreated = true;
HM_BeingCreated = false;
}

function HM_f_GetItemDivStr(itemid,disptext,hasmore){
var WidthValue = HM_CurrentMenu.isHorizontal ? (ItemElement.isLastItem) ? (HM_CurrentTree.MenuWidth - HM_BorderWidth - HM_SeparatorSize) : (HM_CurrentTree.MenuWidth - HM_BorderWidth) : HM_CurrentTree.ItemWidth;
var TempString = "<DIV ID=" + itemid + " STYLE='position:absolute;width:" + WidthValue + "px'>";
if(HM_CurrentMenu.showImage) {
var FullPadding = (HM_ItemPadding*2) + HM_ImageSize + HM_ImageHorizSpace;
}
if(hasmore && HM_CurrentMenu.showImage) {
var ImgPosition = HM_CurrentTree.RightToLeft ? "absolute;" : "relative;";
var ImgSrc = HM_CurrentTree.RightToLeft ? HM_ImageSrcLeft : HM_ImageSrc;
var ImgHSpace = (HM_CurrentTree.RightToLeft) ? 0 : HM_ItemPadding;
var ImgStyle = HM_CurrentTree.RightToLeft ? ("left:"+ (HM_ItemPadding + HM_ImageHorizSpace) + "px;top:"+ (HM_ItemPadding + HM_ImageVertSpace) + "px;") : ("float:right;margin-right:"+ (-FullPadding)
+"px;margin-top:"+ HM_ImageVertSpace + "px;width:"+ HM_ImageSize + "px;");
var ImgString = "<IMG ID='HM_ImMore' STYLE='position:"+ ImgPosition + ImgStyle +"' SRC='" + ImgSrc + "' HSPACE="+ ImgHSpace +" VSPACE=0 BORDER=0>";
TempString += ImgString;
}
TempString += disptext + "</DIV>";
return TempString;
}

function HM_f_SetItemProperties(itemid,itemidsuffix) {
this.tree = HM_CurrentTree;
this.itemsetup = HM_f_ItemSetup;
this.index = HM_CurrentMenu.itemCount - 1;
this.isLastItem = (HM_CurrentMenu.itemCount == HM_CurrentMenu.maxItems);
this.array = HM_CurrentMenu.array[HM_CurrentMenu.itemCount];
this.dispText = this.array[0];
this.linkText = this.array[1];
this.permHilite = HM_f_EvalParameters(this.array[3],false,"boolean");
this.hasRollover = (!this.permHilite && HM_f_EvalParameters(this.array[2],true,"boolean"));
this.hasMore = HM_f_EvalParameters(this.array[4],false,"boolean") && HM_f_ValidateArray(HM_ArrayIDPrefix + itemidsuffix);
this.childID = this.hasMore ? (HM_MenuIDPrefix + itemidsuffix) : null;
this.child = null;
this.onmouseover = HM_f_ItemOver;
this.onmouseout = HM_f_ItemOut;
this.setItemStyle = HM_f_SetItemStyle;
this.itemStr = HM_f_GetItemDivStr(itemid,this.dispText,this.hasMore);
this.showChild = HM_f_ShowChild;
}

function HM_f_Make4ItemElement(menucount) {
var ItemIDSuffix = menucount + "_" + HM_CurrentMenu.itemCount;
var LayerID = HM_ItemIDPrefix + ItemIDSuffix;
var ObjectID = LayerID + "Obj";
eval(ObjectID + " = new Object()");
ItemElement = eval(ObjectID);
ItemElement.setItemProperties = HM_f_SetItemProperties;
ItemElement.setItemProperties(LayerID,ItemIDSuffix);
return ItemElement;
}

function HM_f_MakeElement(menuid) {
var MenuObject;
var LayerID = menuid;
var ObjectID = LayerID + "Obj";
eval(ObjectID + " = new Object()");
MenuObject = eval(ObjectID);
return MenuObject;
}

function HM_f_MakeMenu(menucount) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + menucount)) return false;
HM_CurrentArray = eval(HM_ArrayIDPrefix + menucount);
NewMenu = document.all(HM_MenuIDPrefix + menucount);
if(!NewMenu) {
NewMenu = HM_f_MakeElement(HM_MenuIDPrefix + menucount);
NewMenu.array = HM_CurrentArray;
NewMenu.tree = HM_CurrentTree;

if(HM_CurrentMenu) {
NewMenu.parentMenu = HM_CurrentMenu;
NewMenu.parentItem = HM_CurrentMenu.itemElement;
NewMenu.parentItem.child = NewMenu;
NewMenu.hasParent = true;
NewMenu.isHorizontal = HM_CurrentTree.TreeIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TreeImageShow;
}
else {
NewMenu.isHorizontal = HM_CurrentTree.TopIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TopImageShow;
}

HM_CurrentMenu = NewMenu;
HM_CurrentMenu.itemCount = 0;
HM_CurrentMenu.maxItems = HM_CurrentMenu.array.length - 1;
HM_CurrentMenu.showIt = HM_f_ShowIt;
HM_CurrentMenu.keepInWindow = HM_f_KeepInWindow;
HM_CurrentMenu.onmouseover = HM_f_MenuOver;
HM_CurrentMenu.onmouseout = HM_f_MenuOut;
HM_CurrentMenu.hideTree = HM_f_HideTree
HM_CurrentMenu.hideParents = HM_f_HideParents;
HM_CurrentMenu.hideChildren = HM_f_HideChildren;
HM_CurrentMenu.hideTop = HM_f_HideTop;
HM_CurrentMenu.hideSelf = HM_f_HideSelf;
HM_CurrentMenu.count = menucount;
HM_CurrentMenu.hasChildVisible = false;
HM_CurrentMenu.isOn = false;
HM_CurrentMenu.hideTimer = null;
HM_CurrentMenu.currentItem = null;
HM_CurrentMenu.setMenuStyle = HM_f_SetMenuStyle;
HM_CurrentMenu.sizeFixed = false;
HM_CurrentMenu.fixSize = HM_f_FixSize;
HM_CurrentMenu.onselectstart = HM_f_CancelSelect;
HM_CurrentMenu.moveTo = HM_f_MoveTo;
HM_CurrentMenu.htmlString = "<DIV ID='" + HM_MenuIDPrefix + menucount +"'
STYLE='position:absolute;visibility:hidden;width:"+ HM_CurrentTree.MenuWidth +"'>";
}

while (HM_CurrentMenu.itemCount < HM_CurrentMenu.maxItems) {
HM_CurrentMenu.itemCount++;

HM_CurrentItem = document.all(HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount);
if(!HM_CurrentItem) {
if(HM_StatusDisplayBuild) status = "Creating Hierarchical Menus: " + menucount + " / " + HM_CurrentMenu.itemCount;
HM_CurrentMenu.itemElement = HM_f_Make4ItemElement(menucount);
HM_CurrentMenu.htmlString += HM_CurrentMenu.itemElement.itemStr;
}
if(HM_CurrentMenu.itemElement.hasMore && (!HM_CreateTopOnly || HM_AreCreated && HM_CreateTopOnly)) {
MenuCreated = HM_f_MakeMenu(menucount + "_" + HM_CurrentMenu.itemCount);
if(MenuCreated) {
HM_CurrentMenu = HM_CurrentMenu.parentMenu;
}
}
}

document.body.insertAdjacentHTML("BeforeEnd",HM_CurrentMenu.htmlString + "</DIV>");
menuLyr = document.all(HM_MenuIDPrefix + menucount);
menuLyr.propertyTransfer = propertyTransfer;
menuLyr.propertyTransfer();
HM_CurrentMenu = menuLyr;
if(!HM_CurrentMenu.hasParent)HM_CurrentTree.treeParent = HM_CurrentTree.startChild = HM_CurrentMenu;
HM_CurrentMenu.setMenuStyle();
HM_CurrentMenu.childNodes = HM_CurrentMenu.children;
HM_CurrentMenu.lastItem = HM_CurrentMenu.childNodes[HM_CurrentMenu.childNodes.length-1];
for(var i=0; i<HM_CurrentMenu.childNodes.length; i++) {
it = HM_CurrentMenu.childNodes[i];
it.siblingBelow = i>0 ? HM_CurrentMenu.childNodes[i-1] : null;
it.propertyTransfer = propertyTransfer;
it.propertyTransfer();
it.itemsetup(i+1);
}
HM_CurrentMenu.moveTo(0,0);
return HM_CurrentMenu;
}

function HM_f_SetMenuStyle(){
with(this.style) {
borderWidth = HM_BorderWidth + "px";
borderColor = HM_CurrentTree.BorderColor;
borderStyle = HM_BorderStyle;
overflow = "hidden";
cursor = "default";
}
}

function HM_f_SetItemStyle() {
with(this.style){
backgroundColor = (this.permHilite) ? HM_CurrentTree.BGColorOver : HM_CurrentTree.BGColor;
color = (this.permHilite) ? HM_CurrentTree.FontColorOver : HM_CurrentTree.FontColor;
font = ((HM_FontBold) ? "bold " : "normal ") + HM_FontSize + "pt " + HM_FontFamily;
padding = HM_ItemPadding +"px";
fontStyle = (HM_FontItalic) ? "italic" : "normal";
overflow = "hidden";
pixelWidth = HM_CurrentTree.ItemWidth;

if(HM_CurrentMenu.showImage) {
var FullPadding = (HM_ItemPadding*2) + HM_ImageSize + HM_ImageHorizSpace;
if (this.tree.RightToLeft) paddingLeft = FullPadding + "px";
else paddingRight = FullPadding + "px";
}
if(!this.isLastItem) {
var SeparatorString = HM_SeparatorSize + "px solid " + this.tree.SeparatorColor;
if (this.menu.isHorizontal) borderRight = SeparatorString;
else borderBottom = SeparatorString;
}

if(this.menu.isHorizontal){
if(this.isLastItem) pixelWidth = (HM_CurrentTree.MenuWidth - HM_BorderWidth - HM_SeparatorSize);
else pixelWidth = (HM_CurrentTree.MenuWidth - HM_BorderWidth);
pixelTop = 0;
pixelLeft = (this.index * (HM_CurrentTree.MenuWidth - HM_BorderWidth));
var LeftAndWidth = pixelLeft + pixelWidth;
this.menu.style.pixelWidth = LeftAndWidth + (HM_BorderWidth * 2);
}
else {
pixelLeft = 0;
}
}
}

function HM_f_FixSize(makevis){
if(this.isHorizontal) {
var MaxItemHeight = 0;
for(i=0; i<this.childNodes.length; i++) {
var TempItem = this.childNodes[i];
if (TempItem.index) {
var SiblingHeight = TempItem.siblingBelow.scrollHeight;
MaxItemHeight = Math.max(MaxItemHeight,SiblingHeight);
}
else{
MaxItemHeight = TempItem.scrollHeight;
}
}
for(i=0; i<this.childNodes.length; i++) {
this.childNodes[i].style.pixelHeight = MaxItemHeight;
}
this.style.pixelHeight = MaxItemHeight+(HM_BorderWidth * 2);
}
else {
for(i=0; i<this.childNodes.length; i++) {
var TempItem = this.childNodes[i];
if (TempItem.index) {
var SiblingHeight =(TempItem.siblingBelow.scrollHeight + HM_SeparatorSize);
TempItem.style.pixelTop = TempItem.siblingBelow.style.pixelTop + SiblingHeight;
}
else TempItem.style.pixelTop = 0;
}
this.style.pixelHeight = TempItem.style.pixelTop + TempItem.scrollHeight + (HM_BorderWidth * 2);
}
this.sizeFixed = true;
if(makevis)this.style.visibility = "visible";
}

function HM_f_ItemSetup(whichItem) {
this.menu = this.parentElement;
this.ClickStart = this.hasMore && this.tree.ClickStart && (this.tree.TopIsPermanent &&
(this.tree.treeParent==this.menu));
if(this.ClickStart) {
this.linkText = "";
this.onclick = this.showChild;
}

if (this.hasMore) {
if(this.menu.showImage){
this.imgLyr = this.children("HM_ImMore");
this.hasImageRollover = ((!this.tree.RightToLeft && HM_ImageSrcOver) || (this.tree.RightToLeft && HM_ImageSrcLeftOver));
if(this.hasImageRollover) {
this.imageSrc = this.tree.RightToLeft ? HM_ImageSrcLeft : HM_ImageSrc;
this.imageSrcOver = this.tree.RightToLeft ? HM_ImageSrcLeftOver : HM_ImageSrcOver;
}
}

this.child = document.all(this.childID);
if(this.child) {
this.child.parentMenu = this.menu;
this.child.parentItem = this;
}
}
if(this.linkText && !this.ClickStart) {
this.onclick = HM_f_LinkIt;
if(HM_ShowLinkCursor)this.style.cursor = "hand";
}

this.setItemStyle();
}

function HM_f_PopUp(menuname){
if (!HM_AreLoaded) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var TempMenu = document.all(menuname);
if(!TempMenu) return;
HM_CurrentMenu = TempMenu;
if (HM_CurrentMenu.tree.ClickStart) {
var ClickElement = event.srcElement;
ClickElement.onclick = HM_f_PopMenu;
}
else HM_f_PopMenu();
}

function HM_f_PopMenu(){
if (!HM_AreLoaded || !HM_AreCreated) return true;
if (HM_CurrentMenu.tree.ClickStart && event.type != "click") return true;
var mouse_x_position, mouse_y_position;
HM_f_HideAll();
HM_CurrentMenu.hasParent = false;
HM_CurrentMenu.tree.startChild = HM_CurrentMenu;
HM_CurrentMenu.mouseX = mouse_x_position = (event.clientX + document.body.scrollLeft);
HM_CurrentMenu.mouseY = mouse_y_position = (event.clientY + document.body.scrollTop);
HM_CurrentMenu.xIntended = HM_CurrentMenu.xPos = (HM_CurrentMenu.tree.MenuLeft!=null) ? eval(HM_CurrentMenu.tree.MenuLeft) : mouse_x_position;
HM_CurrentMenu.yIntended = HM_CurrentMenu.yPos = (HM_CurrentMenu.tree.MenuTop!=null) ? eval(HM_CurrentMenu.tree.MenuTop) : mouse_y_position;
if(!HM_CurrentMenu.sizeFixed) HM_CurrentMenu.fixSize(false);
HM_CurrentMenu.keepInWindow();
HM_CurrentMenu.moveTo(HM_CurrentMenu.xPos,HM_CurrentMenu.yPos);
HM_CurrentMenu.isOn = true;
HM_CurrentMenu.showIt(true);
return false;
}

function HM_f_MenuOver() {
if(!this.tree.startChild){this.tree.startChild = this}
if(this.tree.startChild == this) HM_f_HideAll(this)
this.isOn = true;
HM_UserOverMenu = true;
HM_CurrentMenu = this;
if (this.hideTimer) clearTimeout(this.hideTimer);
}

function HM_f_MenuOut() {
if(event.srcElement.contains(event.toElement)) return;
this.isOn = false;
HM_UserOverMenu = false;
if(HM_StatusDisplayLink) status = "";
if(!HM_ClickKill) {
clearTimeout(HM_HideAllTimer);
HM_HideAllTimer = null;
HM_HideAllTimer = setTimeout("HM_CurrentMenu.hideTree()",HM_ChildMilliSecondsVisible);
}
}

function HM_f_ShowChild(){
if(!this.child) {
HM_CurrentTree = this.tree;
HM_CurrentMenu = this.menu;
HM_CurrentItem = this;
this.child = HM_f_MakeMenu(this.menu.count + "_"+(this.index+1));
this.tree.treeParent = this.menu;
this.tree.startChild = this.menu;
this.child.parentItem = this;
}
if (this.tree.PositionUnder && (this.menu == this.tree.treeParent)) {
this.child.xPos = this.menu.style.pixelLeft + this.style.pixelLeft;
this.child.yPos = this.menu.style.pixelTop + this.menu.offsetHeight - (HM_BorderWidth);
}
else {
this.oL = this.menu.style.pixelLeft + this.offsetLeft;
this.oT = this.menu.style.pixelTop + this.offsetTop;
if(this.tree.RightToLeft) {
this.child.xPos = this.oL + (this.tree.HorizOffsetRight - this.child.offsetWidth);
}
else {
this.child.xPos = this.oL + this.tree.HorizOffsetLeft;
}
this.child.yPos = this.oT + HM_ChildOffset + HM_BorderWidth;
}
this.child.xDiff = this.child.xPos - this.menu.style.pixelLeft;
this.child.yDiff = this.child.yPos - this.menu.style.pixelTop;
if(!this.child.sizeFixed) this.child.fixSize(false);
if(!this.tree.PositionUnder || this.menu!=this.tree.treeParent) this.child.keepInWindow();
this.child.moveTo(this.child.xPos,this.child.yPos);
this.menu.hasChildVisible = true;
this.menu.visibleChild = this.child;
this.child.showIt(true);
}

function HM_f_ItemOver(){
if (HM_KeepHilite) {
if (this.menu.currentItem && this.menu.currentItem != this && this.menu.currentItem.hasRollover) {
with(this.menu.currentItem.style){
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor
}
if(this.menu.currentItem.hasImageRollover)this.menu.currentItem.imgLyr.src = this.menu.currentItem.imageSrc;
}
}
if(event.srcElement.id == "HM_ImMore") return;
if(this.hasRollover) {
this.style.backgroundColor = this.tree.BGColorOver;
this.style.color = this.tree.FontColorOver;
if(this.hasImageRollover)this.imgLyr.src = this.imageSrcOver;
}
if(HM_StatusDisplayLink) status = this.linkText;
this.menu.currentItem = this;
if (this.menu.hasChildVisible) {
if(this.menu.visibleChild == this.child && this.menu.visibleChild.hasChildVisible)
this.menu.visibleChild.hideChildren(this);
else this.menu.hideChildren(this);
}
if (this.hasMore && !this.ClickStart) this.showChild();
}

function HM_f_ItemOut() {
if (event.srcElement.contains(event.toElement)
|| (event.fromElement.tagName=="IMG" && (event.toElement && event.toElement.contains(event.fromElement))))
return;
if ( (!HM_KeepHilite || ((this.tree.TopIsPermanent && (this.tree.treeParent==this)) && !this.menu.hasChildVisible)) && this.hasRollover) {
with(this.style) {
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor
}
if(this.hasImageRollover)this.imgLyr.src = this.imageSrc;
}
}

function HM_f_MoveTo(xPos,yPos) {
this.style.pixelLeft = xPos;
this.style.pixelTop = yPos;
}

function HM_f_ShowIt(on) {
if (!(this.tree.TopIsPermanent && (this.tree.treeParent==this))) {
if(!this.hasParent || (this.hasParent && this.tree.TopIsPermanent && (this.tree.treeParent==this.parentMenu))) {
var IsVisible = (this.style.visibility == "visible");
if ((on && !IsVisible) || (!on && IsVisible))
eval(on ? this.tree.UponDisplay : this.tree.UponHide)
}
if(on) this.style.zIndex = ++HM_ZIndex;
this.style.visibility = (on) ? "visible" : "hidden";
}
if (HM_KeepHilite && this.currentItem && this.currentItem.hasRollover) {
with(this.currentItem.style){
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor;
}
if(this.currentItem.hasImageRollover)this.currentItem.imgLyr.src = this.currentItem.imageSrc;
}
this.currentItem = null;
}

function HM_f_KeepInWindow() {
var ExtraSpace = 10;
var WindowLeftEdge = document.body.scrollLeft;
var WindowTopEdge = document.body.scrollTop;
var WindowWidth = document.body.clientWidth;
var WindowHeight = document.body.clientHeight;
var WindowRightEdge = (WindowLeftEdge + WindowWidth) - ExtraSpace;
var WindowBottomEdge = (WindowTopEdge + WindowHeight) - ExtraSpace;

var MenuLeftEdge = this.xPos;
var MenuRightEdge = MenuLeftEdge + this.style.pixelWidth;
var MenuBottomEdge = this.yPos + this.style.pixelHeight;

if (this.hasParent) {
var ParentLeftEdge = this.parentItem.oL;
}
if (MenuRightEdge > WindowRightEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetRight - this.offsetWidth;
}
else {
dif = MenuRightEdge - WindowRightEdge;
this.xPos -= dif;
}
this.xPos = Math.max(5,this.xPos);
}

if (MenuBottomEdge > WindowBottomEdge) {
dif = MenuBottomEdge - WindowBottomEdge;
this.yPos -= dif;
}

if (MenuLeftEdge < WindowLeftEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetLeft;
MenuRightEdge = this.xPos + this.style.pixelWidth;
if(MenuRightEdge > WindowRightEdge) this.xPos -= (MenuRightEdge - WindowRightEdge);
}
else {this.xPos = 5}
}
}

function HM_f_LinkIt() {
if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
else {
HM_f_HideAll();
location.href = this.linkText;
}
}

function HM_f_PopDown(menuname){
if (!HM_AreLoaded || !HM_AreCreated) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var MenuToHide = document.all(menuname);
if(!MenuToHide)return;
MenuToHide.isOn = false;
if (!HM_ClickKill) MenuToHide.hideTop();
}

function HM_f_HideAll(callingmenu) {
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i].tree.startChild;
if(TopMenu == callingmenu)continue
TopMenu.isOn = false;
if (TopMenu.hasChildVisible) TopMenu.hideChildren();
TopMenu.showIt(false);
}
}

function HM_f_HideTree() {
HM_HideAllTimer = null;
if (HM_UserOverMenu) return;
if (this.hasChildVisible) this.hideChildren();
this.hideParents();
}

function HM_f_HideTop() {
TopMenuToHide = this;
(HM_ClickKill) ? TopMenuToHide.hideSelf() : (this.hideTimer =
setTimeout("TopMenuToHide.hideSelf()",HM_TopMilliSecondsVisible));
}

function HM_f_HideSelf() {
this.hideTimer = null;
if (!this.isOn && !HM_UserOverMenu) this.showIt(false);
}

function HM_f_HideParents() {
var TempMenu = this;
while(TempMenu.hasParent) {
TempMenu.showIt(false);
TempMenu.parentMenu.isOn = false;
TempMenu = TempMenu.parentMenu;
}
TempMenu.hideTop();
}

function HM_f_HideChildren(callingitem) {
var TempMenu = this.visibleChild;
while(TempMenu.hasChildVisible) {
TempMenu.visibleChild.showIt(false);
TempMenu.hasChildVisible = false;
TempMenu = TempMenu.visibleChild;
}
if((callingitem && (!callingitem.hasMore || this.visibleChild != callingitem.child)) || (!callingitem && !this.isOn)) {
this.visibleChild.showIt(false);
this.hasChildVisible = false;
}
}

function HM_f_CancelSelect(){return false}

function HM_f_PageClick() {
if (!HM_UserOverMenu && HM_CurrentMenu!=null && !HM_CurrentMenu.isOn) HM_f_HideAll();
}

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

function HM_f_ResizeHandler(){
var mouse_x_position, mouse_y_position;
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i].tree.startChild;
if(TopMenu.style.visibility == "visible") {
TopMenu.oldLeft = TopMenu.xPos;
TopMenu.oldTop = TopMenu.yPos;
mouse_x_position = TopMenu.mouseX;
mouse_y_position = TopMenu.mouseY;
TopMenu.xPos = eval(TopMenu.tree.MenuLeft);
TopMenu.yPos = eval(TopMenu.tree.MenuTop);
if(TopMenu.xPos == null) TopMenu.xPos = TopMenu.xIntended;
if(TopMenu.yPos == null) TopMenu.yPos = TopMenu.yIntended;
if(!TopMenu.tree.TopIsPermanent) TopMenu.keepInWindow();
TopMenu.moveTo(TopMenu.xPos,TopMenu.yPos);
var TempMenu = TopMenu;
while(TempMenu.hasChildVisible) {
TempParent = TempMenu;
TempMenu = TempMenu.visibleChild;
TempMenu.xPos = TempParent.xPos + TempMenu.xDiff;
TempMenu.yPos = TempParent.yPos + TempMenu.yDiff;
if(!TopMenu.tree.TopIsPermanent || (TopMenu.tree.TopIsPermanent && !TopMenu.tree.PositionUnder))
TempMenu.keepInWindow();
TempMenu.moveTo(TempMenu.xPos,TempMenu.yPos);
}
}
}
HM_f_OtherResize();
}

HM_f_OtherResize = (window.onresize) ? window.onresize : new Function;
window.onresize = HM_f_ResizeHandler;

HM_f_OtherOnLoad = (window.onload) ? window.onload : new Function;
window.onload = function(){setTimeout("HM_f_StartIt()",10)};

//end


Zawartość skryptu HM_ScriptDOM.js:

/*HM_ScriptDOM.js
* by Peter Belesis. v4.0.13 010712
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
* Originally published and documented at http://www.dhtmlab.com/
* You may use this code only if this entire
* copyright notice appears unchanged and you publicly display
* a link to http://www.dhtmlab.com/.
*
* Contact peterbelesis@yahoo.co.uk for all other uses.
*/

HM_IE5M = HM_IE && HM_Mac;
HM_IE5W = HM_IE && !HM_Mac;
HM_NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));
HM_IEDTD = (HM_IE && document.doctype) ? document.doctype.name.indexOf(".dtd")!=-1 : false;
HM_IEnoDTD = HM_IE && !HM_IEDTD;

HM_a_Parameters = [
["MenuWidth", 150, "number"],
["FontFamily", "Arial,sans-serif"],
["FontSize", 10, "number"],
["FontBold", false, "boolean"],
["FontItalic", false, "boolean"],
["FontColor", "black"],
["FontColorOver", "white"],
["BGColor", "white"],
["BGColorOver", "black"],
["ItemPadding", 3, "number"],
["BorderWidth", 2, "number"],
["BorderColor", "red"],
["BorderStyle", "solid"],
["SeparatorSize", 1, "number"],
["SeparatorColor", "yellow"],
["ImageSrc", "HM_More_black_right.gif"],
["ImageSrcOver", null],
["ImageSrcLeft", "HM_More_black_left.gif"],
["ImageSrcLeftOver", null],
["ImageSize", 5, "number"],
["ImageHorizSpace", 0, "number"],
["ImageVertSpace", 0, "number"],
["KeepHilite", false, "boolean"],
["ClickStart", false, "boolean"],
["ClickKill", true, "boolean"],
["ChildOverlap", 20, "number"],
["ChildOffset", 10, "number"],
["ChildPerCentOver", null, "number"],
["TopSecondsVisible", .5, "number"],
["ChildSecondsVisible",.3, "number"],
["StatusDisplayBuild", 1, "boolean"],
["StatusDisplayLink", 1, "boolean"],
["UponDisplay", null, "delayed"],
["UponHide", null, "delayed"],
["RightToLeft", false, "boolean"],
["CreateTopOnly", 0, "boolean"],
["ShowLinkCursor", false, "boolean"]
]

HM_MenuIDPrefix = "HM_Menu";
HM_ItemIDPrefix = "HM_Item";
HM_ArrayIDPrefix = "HM_Array";

Function.prototype.isFunction = true;
Function.prototype.isString = false;
String.prototype.isFunction = false;
String.prototype.isString = true;
String.prototype.isBoolean = false;
String.prototype.isNumber = false;
Number.prototype.isString = false;
Number.prototype.isFunction = false;
Number.prototype.isBoolean = false;
Number.prototype.isNumber = true;
Boolean.prototype.isString = false;
Boolean.prototype.isFunction = false;
Boolean.prototype.isBoolean = true;
Boolean.prototype.isNumber = false;
Array.prototype.itemValidation = false;
Array.prototype.isArray = true;

function HM_f_AssignParameters(paramarray){
var ParamName = paramarray[0];
var DefaultValue = paramarray[1];
var FullParamName = "HM_" + ParamName;

if (typeof eval("window.HM_PG_" + ParamName) == "undefined") {
if (typeof eval("window.HM_GL_" + ParamName) == "undefined") {
eval(FullParamName + "= DefaultValue");
}
else {
eval(FullParamName + "= HM_GL_" + ParamName);
}
}
else {
eval(FullParamName + "= HM_PG_" + ParamName);
}

paramarray[0] = FullParamName;
paramarray[1] = eval(FullParamName);
}

function HM_f_EvalParameters(valuenew,valueold,valuetype){
var TestString, ParPosition;

if(typeof valuenew == "undefined" || valuenew == null || (valuenew.isString && valuenew.length == 0)){
return valueold;
}

if(valuetype != "delayed"){
while(valuenew.isString) {
ParPosition = valuenew.indexOf("(");
if(ParPosition !=-1) {
TestString = "window." + valuenew.substr(0,ParPosition);
if (typeof eval(TestString) != "undefined" && eval(TestString).isFunction) {
valuenew = eval(valuenew);
}
}
else break
}
}

while(valuenew.isFunction) {valuenew = valuenew()}

switch(valuetype){
case "number":
while (valuenew.isString) {valuenew = eval(valuenew)}
break;
case "boolean":
while (!valuenew.isBoolean) {
valuenew = (valuenew.isNumber) ? valuenew ? true : false : eval(valuenew);
}
break;
}

return valuenew;
}

for (i=0;i<HM_a_Parameters.length;i++) {
HM_f_AssignParameters(HM_a_Parameters[i]);
eval(HM_a_Parameters[i][0] + "= HM_f_EvalParameters("+ HM_a_Parameters[i][0]
+",null,HM_a_Parameters[i][2])")
}

HM_ChildPerCentOver = (isNaN(parseFloat(HM_ChildPerCentOver))) ? null :
parseFloat(HM_ChildPerCentOver)/100;

HM_ChildMilliSecondsVisible = HM_ChildSecondsVisible * 1000;

function HM_f_ValidateArray(arrayname){
var MenuArrayIsValid = false;
var MenuArrayIsObject = (typeof eval("window." + arrayname) == "object");
if(MenuArrayIsObject) {
var TheMenuArray = eval(arrayname);
if(TheMenuArray.isArray && TheMenuArray.length > 1) {
MenuArrayIsValid = true;
if(!TheMenuArray.itemValidation) {
while((typeof TheMenuArray[TheMenuArray.length-1] != "object") ||
(!TheMenuArray[TheMenuArray.length-1].isArray)) {
TheMenuArray.length--;
}
TheMenuArray.itemValidation = true;
}
}
}
return MenuArrayIsValid;
}

if(!window.HM_a_TreesToBuild) {
HM_a_TreesToBuild = [];
for(i=1; i<100; i++){
if(HM_f_ValidateArray(HM_ArrayIDPrefix + i)) HM_a_TreesToBuild[HM_a_TreesToBuild.length] = i;
}
}

HM_CurrentArray = null;
HM_CurrentTree = null;
HM_CurrentMenu = null;
HM_CurrentItem = null;
HM_a_TopMenus = [];
HM_AreLoaded = false;
HM_AreCreated = false;
HM_BeingCreated = false;
HM_UserOverMenu = false;
HM_HideAllTimer = null;
HM_TotalTrees = 0;
HM_ZIndex = 5000;

function HM_f_StartIt() {
if(HM_AreCreated) return;
if((typeof(document.body) == "undefined") || (document.body == null)) return;
HM_AreLoaded = true;
if (HM_ClickKill) {
HM_f_OtherMouseDown = (document.onmousedown) ? document.onmousedown : new Function;
document.onmousedown = function(){HM_f_PageClick();HM_f_OtherMouseDown()}
}
else {
HM_TopMilliSecondsVisible = HM_TopSecondsVisible * 1000;
}
HM_f_MakeTrees();
HM_f_OtherOnLoad();
}

function HM_f_MakeTrees(){
HM_BeingCreated = true;
var TreeParams = null;
var TreeHasChildren = false;
var ItemArray = null;

for(var t=0; t<HM_a_TreesToBuild.length; t++) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + HM_a_TreesToBuild[t])) continue;
HM_CurrentArray = eval(HM_ArrayIDPrefix + HM_a_TreesToBuild[t]);

TreeParams = HM_CurrentArray[0];
TreeHasChildren = false;

for(var i=1; i<HM_CurrentArray.length; i++) {
ItemArray = HM_CurrentArray[i];
if(ItemArray[ItemArray.length-1]) {TreeHasChildren = true; break}
}

HM_CurrentTree = {
MenuWidth : MenuWidth = HM_f_EvalParameters(TreeParams[0],HM_MenuWidth,"number"),
MenuLeft : MenuLeft = HM_f_EvalParameters(TreeParams[1],null,"delayed"),
MenuTop : MenuTop = HM_f_EvalParameters(TreeParams[2],null,"delayed"),
ItemWidth : ItemWidth = MenuWidth - (HM_BorderWidth*2),
ItemTextWidth : TreeHasChildren ? (ItemWidth - (HM_ImageSize + HM_ImageHorizSpace + HM_ItemPadding)) : ItemWidth,
HorizOffsetRight : HorizOffsetRight = (parseInt((HM_ChildPerCentOver != null) ? (HM_ChildPerCentOver * ItemWidth) : HM_ChildOverlap)),
HorizOffsetLeft : (MenuWidth - HorizOffsetRight),
FontColor : HM_f_EvalParameters(TreeParams[3],HM_FontColor),
FontColorOver : HM_f_EvalParameters(TreeParams[4],HM_FontColorOver),
BGColor : HM_f_EvalParameters(TreeParams[5],HM_BGColor),
BGColorOver : HM_f_EvalParameters(TreeParams[6],HM_BGColorOver),
BorderColor : HM_f_EvalParameters(TreeParams[7],HM_BorderColor),
SeparatorColor : HM_f_EvalParameters(TreeParams[8],HM_SeparatorColor),
TopIsPermanent : ((MenuLeft == null) || (MenuTop == null)) ? false : HM_f_EvalParameters(TreeParams[9],false,"boolean"),
TopIsHorizontal : TopIsHorizontal = HM_f_EvalParameters(TreeParams[10],false,"boolean"),
TreeIsHorizontal : TreeHasChildren ? HM_f_EvalParameters(TreeParams[11],false,"boolean") : false,
PositionUnder : (!TopIsHorizontal || !TreeHasChildren) ? false : HM_f_EvalParameters(TreeParams[12],false,"boolean"),
TopImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[13],true,"boolean") : false,
TreeImageShow : TreeHasChildren ? HM_f_EvalParameters(TreeParams[14],true,"boolean") : false,
UponDisplay : HM_f_EvalParameters(TreeParams[15],HM_UponDisplay,"delayed"),
UponHide : HM_f_EvalParameters(TreeParams[16],HM_UponHide,"delayed"),
RightToLeft : HM_f_EvalParameters(TreeParams[17],HM_RightToLeft,"boolean"),
ClickStart : HM_f_EvalParameters(TreeParams[18],HM_ClickStart,"boolean")
}

HM_CurrentMenu = null;
HM_f_MakeMenu(HM_a_TreesToBuild[t]);
HM_a_TopMenus[HM_TotalTrees] = HM_CurrentTree.treeParent;
HM_TotalTrees++;
if(HM_CurrentTree.TopIsPermanent){
with(HM_CurrentTree.treeParent) {
HM_CurrentTree.treeParent.xPos = eval(HM_CurrentTree.MenuLeft);
HM_CurrentTree.treeParent.yPos = eval(HM_CurrentTree.MenuTop);
moveTo(HM_CurrentTree.treeParent.xPos,HM_CurrentTree.treeParent.yPos);
style.zIndex = 5000;
}
if(HM_IE5M) setTimeout(HM_CurrentTree.treeParent.id + ".fixSize(true)",10);
else HM_CurrentTree.treeParent.style.visibility = "visible";
}
}

if(HM_StatusDisplayBuild) status = HM_TotalTrees + " Hierarchical Menu Trees Created";
HM_AreCreated = true;
HM_BeingCreated = false;
}

function HM_f_SetItemProperties(itemidsuffix) {
this.tree = HM_CurrentTree;
this.index = HM_CurrentMenu.itemCount - 1;
this.isLastItem = (HM_CurrentMenu.itemCount == HM_CurrentMenu.maxItems);
this.array = HM_CurrentMenu.array[HM_CurrentMenu.itemCount];
this.dispText = this.array[0];
this.linkText = this.array[1];
this.permHilite = HM_f_EvalParameters(this.array[3],false,"boolean");
this.hasRollover = (!this.permHilite && HM_f_EvalParameters(this.array[2],true,"boolean"));
this.hasMore = HM_f_EvalParameters(this.array[4],false,"boolean") && HM_f_ValidateArray(HM_ArrayIDPrefix + itemidsuffix);
this.childID = this.hasMore ? (HM_MenuIDPrefix + itemidsuffix) : null;
this.child = null;
this.onmouseover = HM_f_ItemOver;
this.onmouseout = HM_f_ItemOut;
this.setItemStyle = HM_f_SetItemStyle;
this.showChild = HM_f_ShowChild;
this.ClickStart = this.hasMore && this.tree.ClickStart && (this.tree.TopIsPermanent && (this.tree.treeParent==this.menu));
if(this.ClickStart) {
this.linkText = "";
this.onclick = this.showChild;
}
}

function HM_f_MakeElement(menuid) {
var MenuObject;
MenuObject = document.createElement("DIV");
with(MenuObject){
id = menuid;
with(style) {
position = "absolute";
visibility = "hidden";
left = "-500px";
top = "0px";
width = (HM_IEnoDTD ? HM_CurrentTree.MenuWidth : HM_CurrentTree.ItemWidth) + "px";
}
}
document.body.appendChild(MenuObject);
return MenuObject;
}

function HM_f_MakeMenu(menucount) {
if(!HM_f_ValidateArray(HM_ArrayIDPrefix + menucount)) return false;
HM_CurrentArray = eval(HM_ArrayIDPrefix + menucount);

NewMenu = document.getElementById(HM_MenuIDPrefix + menucount);
if(!NewMenu){
NewMenu = HM_f_MakeElement(HM_MenuIDPrefix + menucount);
if(HM_CurrentMenu) {
NewMenu.parentMenu = HM_CurrentMenu;
NewMenu.parentItem = HM_CurrentMenu.itemElement;
NewMenu.parentItem.child = NewMenu;
NewMenu.hasParent = true;
NewMenu.isHorizontal = HM_CurrentTree.TreeIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TreeImageShow;
}
else {
NewMenu.isHorizontal = HM_CurrentTree.TopIsHorizontal;
NewMenu.showImage = HM_CurrentTree.TopImageShow;
HM_CurrentTree.treeParent = HM_CurrentTree.startChild = NewMenu;
}

HM_CurrentMenu = NewMenu;
HM_CurrentMenu.array = HM_CurrentArray;
HM_CurrentMenu.tree = HM_CurrentTree;
HM_CurrentMenu.itemCount = 0;
HM_CurrentMenu.maxItems = HM_CurrentMenu.array.length - 1;
HM_CurrentMenu.showIt = HM_f_ShowIt;
HM_CurrentMenu.count = menucount;
HM_CurrentMenu.keepInWindow = HM_f_KeepInWindow;
HM_CurrentMenu.onmouseover = HM_f_MenuOver;
HM_CurrentMenu.onmouseout = HM_f_MenuOut;
HM_CurrentMenu.hideTree = HM_f_HideTree
HM_CurrentMenu.hideParents = HM_f_HideParents;
HM_CurrentMenu.hideChildren = HM_f_HideChildren;
HM_CurrentMenu.hideTop = HM_f_HideTop;
HM_CurrentMenu.hideSelf = HM_f_HideSelf;
HM_CurrentMenu.hasChildVisible = false;
HM_CurrentMenu.isOn = false;
HM_CurrentMenu.hideTimer = null;
HM_CurrentMenu.currentItem = null;
HM_CurrentMenu.setMenuStyle = HM_f_SetMenuStyle;
HM_CurrentMenu.sizeFixed = false;
HM_CurrentMenu.fixSize = HM_f_FixSize;

if(HM_IE) HM_CurrentMenu.onselectstart = HM_f_CancelSelect;
HM_CurrentMenu.moveTo = HM_f_MoveTo;
HM_CurrentMenu.setMenuStyle();
}

while (HM_CurrentMenu.itemCount < HM_CurrentMenu.maxItems) {
HM_CurrentMenu.itemCount++;
HM_CurrentMenu.itemElement = document.getElementById(HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount);
if(!HM_CurrentMenu.itemElement){
if(HM_StatusDisplayBuild) status = "Creating Hierarchical Menus: " + menucount + " / " + HM_CurrentMenu.itemCount;
HM_CurrentMenu.itemElement = HM_f_MakeItemElement(menucount);
}
if(HM_CurrentMenu.itemElement.hasMore && (!HM_CreateTopOnly || HM_AreCreated && HM_CreateTopOnly)) {
MenuCreated = HM_f_MakeMenu(menucount + "_" + HM_CurrentMenu.itemCount);
if(MenuCreated) {
HM_CurrentMenu = HM_CurrentMenu.parentMenu;
}
}
}
if(!HM_IE5M)HM_CurrentMenu.fixSize();
return HM_CurrentMenu;
}

function HM_f_SetMenuStyle(){
with(this.style) {
borderWidth = HM_BorderWidth + "px";
borderColor = HM_CurrentTree.BorderColor;
borderStyle = HM_BorderStyle;
overflow = "hidden";
cursor = "default";
}
}

function HM_f_MakeItemElement(menucount) {
var ItemElement = document.createElement("DIV");
ItemElement.id = HM_ItemIDPrefix + menucount + "_" + HM_CurrentMenu.itemCount;

ItemElement.style.position = "absolute";
ItemElement.style.visibility = "inherit";
HM_CurrentMenu.appendChild(ItemElement);
ItemElement.menu = HM_CurrentMenu;
ItemElement.setItemProperties = HM_f_SetItemProperties;
ItemElement.setItemProperties(menucount + "_" + HM_CurrentMenu.itemCount);
ItemElement.siblingBelow = ItemElement.previousSibling;
if(ItemElement.linkText && !ItemElement.ClickStart) {
ItemElement.onclick = HM_f_LinkIt;
if(HM_ShowLinkCursor)ItemElement.style.cursor = HM_NS6 ? "pointer" : "hand";
}
var FullPadding = (HM_ItemPadding*2) + HM_ImageSize + HM_ImageHorizSpace;
if(ItemElement.hasMore && HM_CurrentMenu.showImage) {
var ImageElement = document.createElement("IMG");
ItemElement.imageSrc = HM_CurrentTree.RightToLeft ? HM_ImageSrcLeft : HM_ImageSrc;
with(ImageElement){
src = ItemElement.imageSrc;
removeAttribute("height");
hspace = (!HM_CurrentTree.RightToLeft && HM_IE5W) ? HM_ItemPadding : 0;
vspace = 0;
width = HM_ImageSize;
with(style) {
if(HM_CurrentTree.RightToLeft) {
position = "absolute";
top = (HM_ItemPadding + HM_ImageVertSpace) + "px";
left = (HM_ItemPadding + HM_ImageHorizSpace) + "px";
}
else {
position = "relative";
marginTop = HM_ImageVertSpace + "px";
if(HM_IE5W) {
marginRight = -FullPadding + "px";
}
else marginRight = -(HM_ImageSize + HM_ItemPadding) +"px";
if(HM_NS6) cssFloat = "right";
else styleFloat = "right";
}
}
}
ItemElement.imgLyr = ImageElement;
ItemElement.hasImageRollover = ((!HM_CurrentTree.RightToLeft && HM_ImageSrcOver) || (HM_CurrentTree.RightToLeft && HM_ImageSrcLeftOver));
if(ItemElement.hasImageRollover) {
ItemElement.imageSrcOver = HM_CurrentTree.RightToLeft ? HM_ImageSrcLeftOver : HM_ImageSrcOver;
}
}
ItemElement.innerHTML = ItemElement.dispText;
if(ImageElement) ItemElement.insertBefore(ImageElement,ItemElement.firstChild);
ItemElement.setItemStyle();
return ItemElement;
}

function HM_f_SetItemStyle() {
with(this.style){
backgroundColor = (this.permHilite) ? HM_CurrentTree.BGColorOver : HM_CurrentTree.BGColor;
color = (this.permHilite) ? HM_CurrentTree.FontColorOver : HM_CurrentTree.FontColor;
padding = HM_ItemPadding +"px";
font = ((HM_FontBold) ? "bold " : "normal ") + HM_FontSize + "pt " + HM_FontFamily;
fontStyle = (HM_FontItalic) ? "italic" : "normal";
if(HM_IE) overflow = "hidden";

if(HM_CurrentMenu.showImage) {
var FullPadding = (HM_ItemPadding*2) + HM_ImageSize + HM_ImageHorizSpace;
if (HM_CurrentTree.RightToLeft) paddingLeft = FullPadding + "px";
else paddingRight = FullPadding + "px";
}
if(!this.isLastItem) {
var SeparatorString = HM_SeparatorSize + "px solid " + this.tree.SeparatorColor;
if (this.menu.isHorizontal) borderRight = SeparatorString;
else borderBottom = SeparatorString;
}

if(HM_IEnoDTD) width = HM_CurrentTree.ItemWidth + "px";
else width = (HM_CurrentTree.ItemWidth - (parseInt(paddingLeft) + parseInt(paddingRight))) + "px";

if(this.menu.isHorizontal){
if(HM_IEnoDTD){
if(this.isLastItem) width = (HM_CurrentTree.MenuWidth - HM_BorderWidth - HM_SeparatorSize) + "px"
else width = (HM_CurrentTree.MenuWidth - HM_BorderWidth) + "px"
}
else {
width = (HM_CurrentTree.MenuWidth - HM_BorderWidth - parseInt(paddingLeft) - parseInt(paddingRight) - HM_SeparatorSize) + "px";
}
top = "0px";
if(HM_IEnoDTD){
left = (this.index * (HM_CurrentTree.MenuWidth - HM_BorderWidth)) + "px";
}
else {
left = ((this.index * parseInt(width)) + ((HM_SeparatorSize * this.index))) + ((parseInt(paddingLeft) + parseInt(paddingRight)) * this.index) + "px";
}
var LeftAndWidth = parseInt(left) + parseInt(width);
this.menu.style.width = LeftAndWidth + (HM_IEnoDTD ? (HM_BorderWidth * 2) : (parseInt(paddingLeft) + parseInt(paddingRight))) + "px"
}
else {
left = "0px";
}
}
}

function HM_f_FixSize(makevis){
if(this.isHorizontal) {
var MaxItemHeight = 0;
for(i=0; i<this.childNodes.length; i++) {
var TempItem = this.childNodes[i];
if (TempItem.index) {
var SiblingHeight = TempItem.siblingBelow.offsetHeight - (HM_IEnoDTD ? 0 : HM_ItemPadding * 2);
MaxItemHeight = Math.max(MaxItemHeight,SiblingHeight);
}
else{
MaxItemHeight = TempItem.offsetHeight;
}
}
for(i=0; i<this.childNodes.length; i++) {
this.childNodes[i].style.height = MaxItemHeight +"px";
}
this.style.height = MaxItemHeight + (HM_IEnoDTD ? HM_BorderWidth * 2 : 0) + "px";
}
else {
for(i=0; i<this.childNodes.length; i++) {
var TempItem = this.childNodes[i];
if (TempItem.index) {
var SiblingHeight =(TempItem.siblingBelow.offsetHeight);
TempItem.style.top = parseInt(TempItem.siblingBelow.style.top) + SiblingHeight + "px";
}
else TempItem.style.top = "0px";
}
this.style.height = parseInt(TempItem.style.top) + (HM_IE5W ? TempItem.scrollHeight : TempItem.offsetHeight) + (HM_IEnoDTD ? (HM_BorderWidth * 2) : 0) + "px";
}

this.sizeFixed = true;
if(makevis)this.style.visibility = "visible";
}

function HM_f_PopUp(menuname,e){
if(HM_IE) e = event;
if (!HM_AreLoaded) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var TempMenu = document.getElementById(menuname);
if(!TempMenu)return;
HM_CurrentMenu = TempMenu;
if (HM_CurrentMenu.tree.ClickStart) {
var ClickElement = (HM_IE) ? e.srcElement : e.target;
if(HM_NS6) {
while(ClickElement.tagName==null){
ClickElement = ClickElement.parentNode;
}
}
ClickElement.onclick = HM_f_PopMenu;
}
else HM_f_PopMenu(e);
}

function HM_f_PopMenu(e){
if(HM_IE) e = event;
if (!HM_AreLoaded || !HM_AreCreated) return true;
if (HM_CurrentMenu.tree.ClickStart && e.type != "click") return true;
var mouse_x_position, mouse_y_position;
HM_f_HideAll();
HM_CurrentMenu.hasParent = false;
HM_CurrentMenu.tree.startChild = HM_CurrentMenu;
HM_CurrentMenu.mouseX = mouse_x_position = (HM_IE) ? (e.clientX + document.body.scrollLeft) : e.pageX;
HM_CurrentMenu.mouseY = mouse_y_position = (HM_IE) ? (e.clientY + document.body.scrollTop) : e.pageY;
HM_CurrentMenu.xIntended = HM_CurrentMenu.xPos = (HM_CurrentMenu.tree.MenuLeft!=null) ? eval(HM_CurrentMenu.tree.MenuLeft) : mouse_x_position;
HM_CurrentMenu.yIntended = HM_CurrentMenu.yPos = (HM_CurrentMenu.tree.MenuTop!=null) ? eval(HM_CurrentMenu.tree.MenuTop) : mouse_y_position;
if(HM_IE5M && !HM_CurrentMenu.sizeFixed) HM_CurrentMenu.fixSize(false);
HM_CurrentMenu.keepInWindow();
HM_CurrentMenu.moveTo(HM_CurrentMenu.xPos,HM_CurrentMenu.yPos);
HM_CurrentMenu.isOn = true;
HM_CurrentMenu.showIt(true);
return false;
}

function HM_f_MenuOver() {
if(!this.tree.startChild){this.tree.startChild = this}
if(this.tree.startChild == this) HM_f_HideAll(this)
this.isOn = true;
HM_UserOverMenu = true;
HM_CurrentMenu = this;
if (this.hideTimer) clearTimeout(this.hideTimer);
}

function HM_f_MenuOut() {
if(HM_IE && event.srcElement.contains(event.toElement)) return;
this.isOn = false;
HM_UserOverMenu = false;
if(HM_StatusDisplayLink) status = "";
if(!HM_ClickKill) {
clearTimeout(HM_HideAllTimer);
HM_HideAllTimer = null;
HM_HideAllTimer = setTimeout("HM_CurrentMenu.hideTree()",HM_ChildMilliSecondsVisible);
}
}

function HM_f_ShowChild(){
if(!this.child) {
HM_CurrentTree = this.tree;
HM_CurrentMenu = this.menu;
HM_CurrentItem = this;
HM_CurrentMenu.itemElement = this;
this.child = HM_f_MakeMenu(this.menu.count + "_"+(this.index+1));
this.tree.treeParent = this.menu;
this.tree.startChild = this.menu;
}
if (this.tree.PositionUnder && (this.menu == this.tree.treeParent)) {
this.child.xPos = parseInt(this.menu.style.left) + parseInt(this.style.left);
this.child.yPos = parseInt(this.menu.style.top) + this.menu.offsetHeight - (HM_BorderWidth);
}
else {
if(HM_IE5M) {
this.oL = parseInt(this.menu.style.left) - HM_ItemPadding;
this.oL += this.offsetLeft;
this.oT = parseInt(this.menu.style.top) - HM_ItemPadding;
this.oT += this.offsetTop;
}
else {
this.oL = (HM_IE) ? parseInt(this.menu.style.left) : -HM_BorderWidth;
this.oL += this.offsetLeft;
this.oT = (HM_IE) ? parseInt(this.menu.style.top) : -HM_BorderWidth;
this.oT += this.offsetTop;
}

if(this.tree.RightToLeft) {
this.child.xPos = this.oL + (this.tree.HorizOffsetRight - this.child.offsetWidth);
}
else {
this.child.xPos = this.oL + this.tree.HorizOffsetLeft;
}
this.child.yPos = this.oT + HM_ChildOffset + HM_BorderWidth;
}

this.child.xDiff = this.child.xPos - parseInt(this.menu.style.left);
this.child.yDiff = this.child.yPos - parseInt(this.menu.style.top);
if(HM_IE5M && !this.child.sizeFixed) this.child.fixSize(false);
if(!this.tree.PositionUnder || this.menu!=this.tree.treeParent) this.child.keepInWindow();
this.child.moveTo(this.child.xPos,this.child.yPos);
this.menu.hasChildVisible = true;
this.menu.visibleChild = this.child;
this.child.showIt(true);
}

function HM_f_ItemOver(){
if (HM_KeepHilite) {
if (this.menu.currentItem && this.menu.currentItem != this && this.menu.currentItem.hasRollover) {
with(this.menu.currentItem.style){
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor
}
if(this.menu.currentItem.hasImageRollover)this.menu.currentItem.imgLyr.src = this.menu.currentItem.imageSrc;
}
}
if(HM_IE && event.srcElement.id == "HM_ImMore") return;
if(this.hasRollover) {
this.style.backgroundColor = this.tree.BGColorOver;
this.style.color = this.tree.FontColorOver;
if(this.hasImageRollover)this.imgLyr.src = this.imageSrcOver;
}

if(HM_StatusDisplayLink) status = this.linkText;
this.menu.currentItem = this;

if (this.menu.hasChildVisible) {
if(this.menu.visibleChild == this.child && this.menu.visibleChild.hasChildVisible)
this.menu.visibleChild.hideChildren(this);
else this.menu.hideChildren(this);
}

if (this.hasMore && !this.ClickStart) this.showChild();
}

function HM_f_ItemOut() {

if (HM_IE && (event.srcElement.contains(event.toElement)
|| (event.fromElement.tagName=="IMG" && (event.toElement && event.toElement.contains(event.fromElement)))))
return;
if ( (!HM_KeepHilite || ((this.tree.TopIsPermanent && (this.tree.treeParent==this)) && !this.menu.hasChildVisible)) && this.hasRollover) {
with(this.style) {
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor
}
if(this.hasImageRollover)this.imgLyr.src = this.imageSrc;
}
}

function HM_f_MoveTo(xPos,yPos) {
this.style.left = xPos + "px";
this.style.top = yPos + "px";
}

function HM_f_ShowIt(on) {
if (!(this.tree.TopIsPermanent && (this.tree.treeParent==this))) {
if(!this.hasParent || (this.hasParent && this.tree.TopIsPermanent && (this.tree.treeParent==this.parentMenu))) {
var IsVisible = (this.style.visibility == "visible");
if ((on && !IsVisible) || (!on && IsVisible))
eval(on ? this.tree.UponDisplay : this.tree.UponHide)
}
if(on) this.style.zIndex = ++HM_ZIndex;
this.style.visibility = (on) ? "visible" : "hidden";
}
if (HM_KeepHilite && this.currentItem && this.currentItem.hasRollover) {
with(this.currentItem.style){
backgroundColor = this.tree.BGColor;
color = this.tree.FontColor;
}
if(this.currentItem.hasImageRollover)this.currentItem.imgLyr.src = this.currentItem.imageSrc;
}
this.currentItem = null;
}

function HM_f_KeepInWindow() {
var ExtraSpace = 10;
var WindowLeftEdge = (HM_IE) ? document.body.scrollLeft : window.pageXOffset;
var WindowTopEdge = (HM_IE) ? document.body.scrollTop : window.pageYOffset;
var WindowWidth = (HM_IE) ? document.body.clientWidth : window.innerWidth;
var WindowHeight = (HM_IE) ? document.body.clientHeight : window.innerHeight;
var WindowRightEdge = (WindowLeftEdge + WindowWidth) - ExtraSpace;
var WindowBottomEdge = (WindowTopEdge + WindowHeight) - ExtraSpace;

var MenuLeftEdge = this.xPos;
var MenuRightEdge = MenuLeftEdge + this.offsetWidth;
var MenuBottomEdge = this.yPos + this.offsetHeight;

if (this.hasParent) {
var ParentLeftEdge = this.parentItem.oL;
}
if (MenuRightEdge > WindowRightEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetRight - this.offsetWidth;
}
else {
dif = MenuRightEdge - WindowRightEdge;
this.xPos -= dif;
}
this.xPos = Math.max(5,this.xPos);
}

if (MenuBottomEdge > WindowBottomEdge) {
dif = MenuBottomEdge - WindowBottomEdge;
this.yPos -= dif;
}

if (MenuLeftEdge < WindowLeftEdge) {
if (this.hasParent) {
this.xPos = ParentLeftEdge + this.tree.HorizOffsetLeft;
MenuRightEdge = this.xPos + this.offsetWidth;
if(MenuRightEdge > WindowRightEdge) this.xPos -= (MenuRightEdge - WindowRightEdge);
}
else {this.xPos = 5}
}
}

function HM_f_LinkIt() {
if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
else {
HM_f_HideAll();
location.href = this.linkText;
}
}

function HM_f_PopDown(menuname){
if (!HM_AreLoaded || !HM_AreCreated) return;
menuname = menuname.replace("elMenu",HM_MenuIDPrefix);
var MenuToHide = document.getElementById(menuname);
if(!MenuToHide)return;
MenuToHide.isOn = false;
if (!HM_ClickKill) MenuToHide.hideTop();
}

function HM_f_HideAll(callingmenu) {
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i].tree.startChild;
if(TopMenu == callingmenu)continue
TopMenu.isOn = false;
if (TopMenu.hasChildVisible) TopMenu.hideChildren();
TopMenu.showIt(false);
}
}

function HM_f_HideTree() {
HM_HideAllTimer = null;
if (HM_UserOverMenu) return;
if (this.hasChildVisible) this.hideChildren();
this.hideParents();
}

function HM_f_HideTop() {
TopMenuToHide = this;
(HM_ClickKill) ? TopMenuToHide.hideSelf() : (this.hideTimer =
setTimeout("TopMenuToHide.hideSelf()",HM_TopMilliSecondsVisible));
}

function HM_f_HideSelf() {
this.hideTimer = null;
if (!this.isOn && !HM_UserOverMenu) this.showIt(false);
}

function HM_f_HideParents() {
var TempMenu = this;
while(TempMenu.hasParent) {
TempMenu.showIt(false);
TempMenu.parentMenu.isOn = false;
TempMenu = TempMenu.parentMenu;
}
TempMenu.hideTop();
}

function HM_f_HideChildren(callingitem) {
var TempMenu = this.visibleChild;
while(TempMenu.hasChildVisible) {
TempMenu.visibleChild.showIt(false);
TempMenu.hasChildVisible = false;
TempMenu = TempMenu.visibleChild;
}
if((callingitem && (!callingitem.hasMore || this.visibleChild != callingitem.child)) || (!callingitem && !this.isOn)) {
this.visibleChild.showIt(false);
this.hasChildVisible = false;
}
}

function HM_f_CancelSelect(){return false}

function HM_f_PageClick() {
if (!HM_UserOverMenu && HM_CurrentMenu!=null && !HM_CurrentMenu.isOn) HM_f_HideAll();
}

popUp = HM_f_PopUp;
popDown = HM_f_PopDown;

function HM_f_ResizeHandler(){
var mouse_x_position, mouse_y_position;
for(var i=0; i<HM_TotalTrees; i++) {
var TopMenu = HM_a_TopMenus[i].tree.startChild;
if(TopMenu.style.visibility == "visible") {
TopMenu.oldLeft = TopMenu.xPos;
TopMenu.oldTop = TopMenu.yPos;
mouse_x_position = TopMenu.mouseX;
mouse_y_position = TopMenu.mouseY;
TopMenu.xPos = eval(TopMenu.tree.MenuLeft);
TopMenu.yPos = eval(TopMenu.tree.MenuTop);
if(TopMenu.xPos == null) TopMenu.xPos = TopMenu.xIntended;
if(TopMenu.yPos == null) TopMenu.yPos = TopMenu.yIntended;
if(!TopMenu.tree.TopIsPermanent) TopMenu.keepInWindow();
TopMenu.moveTo(TopMenu.xPos,TopMenu.yPos);
var TempMenu = TopMenu;
while(TempMenu.hasChildVisible) {
TempParent = TempMenu;
TempMenu = TempMenu.visibleChild;
TempMenu.xPos = TempParent.xPos + TempMenu.xDiff;
TempMenu.yPos = TempParent.yPos + TempMenu.yDiff;
if(!TopMenu.tree.TopIsPermanent || (TopMenu.tree.TopIsPermanent && !TopMenu.tree.PositionUnder))
TempMenu.keepInWindow();
TempMenu.moveTo(TempMenu.xPos,TempMenu.yPos);
}
}
}
HM_f_OtherResize();
}

HM_f_OtherResize = (window.onresize) ? window.onresize : new Function;
window.onresize = HM_f_ResizeHandler;

HM_f_OtherOnLoad = (window.onload) ? window.onload : new Function;
window.onload = function(){setTimeout("HM_f_StartIt()",10)};

//end


Zawartość skryptu Hm_pg.js:

<!--

HM_PG_MenuWidth = 150;
HM_PG_FontFamily = "Arial,sans-serif";
HM_PG_FontSize = 10;
HM_PG_FontBold = 0;
HM_PG_FontItalic = 0;
HM_PG_FontColor = "blue";
HM_PG_FontColorOver = "white";
HM_PG_BGColor = "#DDDDDD";
HM_PG_BGColorOver = "#FFCCCC";
HM_PG_ItemPadding = 3;

HM_PG_BorderWidth = 2;
HM_PG_BorderColor = "black";
HM_PG_BorderStyle = "solid";
HM_PG_SeparatorSize = 2;
HM_PG_SeparatorColor = "#d0ff00";

HM_PG_ImageSrc = "hm_more_black_right.gif";
HM_PG_ImageSrcLeft = "hm_more_black_left.gif";

HM_PG_ImageSrcOver = "hm_more_white_right.gif";
HM_PG_ImageSrcLeftOver = "hm_more_white_left.gif";

HM_PG_ImageSize = 5;
HM_PG_ImageHorizSpace = 0;
HM_PG_ImageVertSpace = 2;

HM_PG_KeepHilite = true;
HM_PG_ClickStart = 0;
HM_PG_ClickKill = false;
HM_PG_ChildOverlap = 20;
HM_PG_ChildOffset = 10;
HM_PG_ChildPerCentOver = null;
HM_PG_TopSecondsVisible = .5;
HM_PG_StatusDisplayBuild =0;
HM_PG_StatusDisplayLink = 0;
HM_PG_UponDisplay = null;
HM_PG_UponHide = null;
HM_PG_RightToLeft = false;

HM_PG_CreateTopOnly = 1;
HM_PG_ShowLinkCursor = 1;
HM_PG_NSFontOver = true;

//HM_a_TreesToBuild = [2];
//-->


Zawartość skryptu HM_Arrays.js:

HM_Array1 = [
[150],
["Experts","http://www.webreference.com/experts/",1,0,1],
["Contents","http://www.webreference.com/index2.html",1,0,0],
["Services","http://www.webreference.com/index2.html",1,0,1],
["About","http://www.webreference.com/about.html",1,0,0]
]

HM_Array1_1 = [
[],
["3-D Animation","http://www.webreference.com/3d/",1,0,0],
["Design","http://www.webreference.com/dlab/",1,0,0],
["HTML","http://www.webreference.com/html/",1,0,0],
["JavaScript","http://www.webreference.com/js/",1,0,0],
["Graphics","http://www.webreference.com/graphics/",1,0,0],
["DHTML","http://www.webreference.com/dhtml/",1,0,1],
["Perl","http://www.webreference.com/perl/",1,0,0],
["XML","http://www.webreference.com/xml/",1,0,0]
]

HM_Array1_3 = [
[],
["Features","http://www.webreference.com/articles.html",1,0,0],
["Forum","http://www.webreference.com/cgi-bin/Ultimate.cgi?action=intro",1,0,0],
["How-to","http://www.webreference.com/dev/",1,0,0],
["New","http://www.webreference.com/headlines/",1,0,0],
["Hot Sites","http://www.webreference.com/hot/",1,0,0]
]

HM_Array1_1_6 = [
[],
["Diner","http://www.webreference.com/dhtml/diner/",1,0,0],
["Dynomat","http://www.webreference.com/dhtml/dynomat/",1,0,0],
["Links","http://www.webreference.com/dhtml/links/",1,0,0]
]

HM_Array2 = [
[100, // menu width
"HM_f_CenterMenu('HM_Menu2')", // left_position
10, // top_position
"red", // font_color
"yellow", // mouseover_font_color
"yellow", // background_color
"black", // mouseover_background_color
"blue", // border_color
"green", // separator_color
1, // top_is_permanent
1, // top_is_horizontal
0, // tree_is_horizontal
1, // position_under
1, // top_more_images_visible
1, // tree_more_images_visible
"null", // evaluate_upon_tree_show
"null", // evaluate_upon_tree_hide
, // right-to-left
0], // display_on_click
["Experts","http://www.webreference.com/experts/",1,0,1],
["Contents","http://www.webreference.com/index2.html",1,0,0],
["Services","http://www.webreference.com/index2.html",1,0,1],
["About","http://www.webreference.com/about.html",1,0,0]
]

HM_Array2_1 = [
[],
["3-D Animation","http://www.webreference.com/3d/",1,0,0],
["Design","http://www.webreference.com/dlab/",1,0,0],
["HTML","http://www.webreference.com/html/",1,0,0],
["JavaScript","http://www.webreference.com/js/",1,0,0],
["Graphics","http://www.webreference.com/graphics/",1,0,0],
["DHTML","http://www.webreference.com/dhtml/",1,0,1],
["Perl","http://www.webreference.com/perl/",1,0,0],
["XML","http://www.webreference.com/xml/",1,0,0]
]

HM_Array2_3 = [
[],
["Features","http://www.webreference.com/articles.html",1,0,0],
["Forum","http://www.webreference.com/cgi-bin/Ultimate.cgi?action=intro",1,0,0],
["How-to","http://www.webreference.com/dev/",1,0,0],
["New","http://www.webreference.com/headlines/",1,0,0],
["Hot Sites","http://www.webreference.com/hot/",1,0,0]
]

HM_Array2_1_6 = [
[],
["Diner","http://www.webreference.com/dhtml/diner/",1,0,0],
["Dynomat","http://www.webreference.com/dhtml/dynomat/",1,0,0],
["Links","http://www.webreference.com/dhtml/links/",1,0,0]
]

HM_Array3 = [
[120, // menu width
200, // left_position
280, // top_position
"black", // font_color
"white", // mouseover_font_color
"white", // background_color
"black", // mouseover_background_color
"black", // border_color
"gray", // separator_color
0, // top_is_permanent
0, // top_is_horizontal
0, // tree_is_horizontal
1, // position_under
1, // top_more_images_visible
1, // tree_more_images_visible
"null", // evaluate_upon_tree_show
"null", // evaluate_upon_tree_hide
, // right-to-left
], // display_on_click
["Experts","http://www.webreference.com/experts/",1,0,1],
["Contents","http://www.webreference.com/index2.html",1,0,0],
["Services","http://www.webreference.com/index2.html",1,0,1],
["About","http://www.webreference.com/about.html",1,0,0]
]

HM_Array3_1 = [
[],
["3-D Animation","http://www.webreference.com/3d/",1,0,0],
["Design","http://www.webreference.com/dlab/",1,0,0],
["HTML","http://www.webreference.com/html/",1,0,0],
["JavaScript","http://www.webreference.com/js/",1,0,0],
["Graphics","http://www.webreference.com/graphics/",1,0,0],
["DHTML","http://www.webreference.com/dhtml/",1,0,1],
["Perl","http://www.webreference.com/perl/",1,0,0],
["XML","http://www.webreference.com/xml/",1,0,0]
]

HM_Array3_3 = [
[],
["Features","http://www.webreference.com/articles.html",1,0,0],
["Forum","http://www.webreference.com/cgi-bin/Ultimate.cgi?action=intro",1,0,0],
["How-to","http://www.webreference.com/dev/",1,0,0],
["New","http://www.webreference.com/headlines/",1,0,0],
["Hot Sites","http://www.webreference.com/hot/",1,0,0]
]

HM_Array3_1_6 = [
[],
["Diner","http://www.webreference.com/dhtml/diner/",1,0,0],
["Dynomat","http://www.webreference.com/dhtml/dynomat/",1,0,0],
["Links","http://www.webreference.com/dhtml/links/",1,0,0]
]

HM_Array4 = [
[120,
"mouse_x_position + 20",
"mouse_y_position + 20",
,,,,,,,,,,,,,,,
true], // display_on_click

["Experts","http://www.webreference.com/experts/",1,0,1],
["Contents","http://www.webreference.com/index2.html",1,0,0],
["Services","http://www.webreference.com/index2.html",1,0,0],
["About","http://www.webreference.com/about.html",1,0,0]
]

HM_Array4_1 = [
[],
["3-D Animation","http://www.webreference.com/3d/",1,0,0],
["Design","http://www.webreference.com/dlab/",1,0,0],
["HTML","http://www.webreference.com/html/",1,0,0],
["JavaScript","http://www.webreference.com/js/",1,0,0],
["Graphics","http://www.webreference.com/graphics/",1,0,0],
["DHTML","http://www.webreference.com/dhtml/",1,0,0],
["Perl","http://www.webreference.com/perl/",1,0,0],
["XML","http://www.webreference.com/xml/",1,0,0]
]




Skrypt do pobrania:

Po kliknięciu nastąpi transfer archiwum z plikiem tekstowym ze skryptem