
afr_Version="5.0";

if(afr_Opera || afr_Konqueror) afr_IE = false;

afr_IE5M = afr_IE && afr_Mac;
afr_NS6 = (navigator.vendor == ("Netscape6") || navigator.product == ("Gecko"));

afr_IE5W = afr_IE && !afr_Mac;
afr_IEpos = !afr_NS6 || (parseInt(navigator.productSub)>=20010710);

afr_IsEarlyGecko = ((navigator.productSub)&&(parseInt(navigator.productSub)<20010726));

afr_IsSafari = (afr_Mac&&(afr_UserAgent.indexOf("Safari")!=-1));

if ((afr_Opera)&&(afr_BrowserVersion<7.1)) afr_PG_ScrollEnabled=0;

afr_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",        "black"],
	["BorderStyle",        "solid"],
	["SeparatorSize",      1,		"number"],
	["SeparatorColor",     "yellow"],
	["ImageDir",           afr_ScriptDir],
	["ImageSrc",           "afr_More_black_right.gif", "image"],
	["ImageSrcOver",       "", "image"],
	["ImageSrcLeft",       "afr_More_black_left.gif", "image"],
	["ImageSrcLeftOver",   "", "image"],
	["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"],
	["ScrollEnabled",      false,	"boolean"],
	["ScrollBarHeight",    16,      "number"],
	["ScrollBarColor",     "lightgrey"],
	["ScrollImgSrcTop",    "afr_More_black_top.gif", "image"],
	["ScrollImgSrcBot",    "afr_More_black_bot.gif", "image"],
	["ScrollImgWidth",     9,       "number"],
	["ScrollImgHeight",    5,       "number"],
	["ScrollBothBars",     false,   "boolean"],
	["ScrollHeightMin",    30,      "number"],
	["FramesEnabled",      false,   "boolean"],
	["FramesNavFramePos",  ""],
	["FramesMainFrameName","main"],
	["WindowPadding",      15,	"number"],
	["HighestMenuNumber",  100,	"number"],
	["ReloadInterval",     200,	"number"],
	["HoverTimeTop",       0,       "number"],
	["HoverTimeTree",      0,       "number"]
]

afr_MenuIDPrefix = "afr_Menu";
afr_ItemIDPrefix = "afr_Item";
afr_ArrayIDPrefix = "afr_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 afr_f_AssignParameters(paramarray){
	var ParamName = paramarray[0];
	var DefaultValue = paramarray[1];
	var FullParamName = "afr_" + ParamName;
	
	if (typeof eval("window.afr_PG_" + ParamName) == "undefined") {
		if (typeof eval("window.afr_GL_" + ParamName) == "undefined") {
			eval(FullParamName + "= DefaultValue");
		}
		else {
			eval(FullParamName + "= afr_GL_" + ParamName);
		}
	}
	else {
		eval(FullParamName + "= afr_PG_" + ParamName);
	}

	paramarray[0] = FullParamName;
	paramarray[1] = eval(FullParamName);
}

function afr_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;
		case "image":
			if (afr_ImageDir) valuenew = afr_ImageDir + valuenew;
			break;
	}

	return valuenew;
}

for (var i=0;i<afr_a_Parameters.length;i++) {
	afr_f_AssignParameters(afr_a_Parameters[i]);
	eval(afr_a_Parameters[i][0] + "= afr_f_EvalParameters("+ afr_a_Parameters[i][0] +",null,afr_a_Parameters[i][2])")
}

afr_ChildPerCentOver = (isNaN(parseFloat(afr_ChildPerCentOver))) ? null : parseFloat(afr_ChildPerCentOver)/100;

afr_ChildMilliSecondsVisible = afr_ChildSecondsVisible * 1000;

function afr_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.afr_a_TreesToBuild) {
	afr_a_TreesToBuild = [];
	for(i=1; i<=afr_HighestMenuNumber; i++){
		if(afr_f_ValidateArray(afr_ArrayIDPrefix + i)) afr_a_TreesToBuild[afr_a_TreesToBuild.length] = i;
	}
}

afr_Canvas = null;
afr_AreLoaded = false;
afr_UseMouseEnter = false;
afr_MenusTarget = window;
afr_FrameHasLoadHandler = false;
afr_a_AccessErrors = ["permission","access","security"];
afr_NavUnloaded = true;
afr_ReloadTimer=null;
afr_BeingCreated = false;
afr_BuildingMenu = false;
afr_LoadCheckDone = false;
afr_IsReloading = true;
afr_LastMenuID = "";
afr_a_ElementsCreated = [];
afr_TotalTrees = 0;
afr_CurrentTree = null;

function afr_f_StoreElement(el){
	if(afr_Opera) return;
	afr_a_ElementsCreated[afr_a_ElementsCreated.length] = el;
}

function afr_f_ClearElements() {
	afr_TO_El=afr_TO_El1=afr_TO_El2=afr_TO_El3=afr_TO_El4=afr_TO_El5=null;
	afr_CurrentMenu = null;
	afr_BuildMenu = null;
	afr_CurrentArray = null;
	if(afr_CurrentTree!=null) {
		if(!afr_Opera){
			afr_CurrentTree.treeParent = null;
			afr_CurrentTree.startChild = null;
		}
		afr_CurrentTree = null;
	}
	var Eclength = afr_a_ElementsCreated.length;
	for(var i=Eclength-1; i>=0; i--){
		var TempElement = afr_a_ElementsCreated[i];
		if(TempElement) {
			TempElement.parentMenu = null;
			TempElement.parentItem = null;
			TempElement.itemElement = null;
			TempElement.currentItem = null;
			TempElement.child = null;
			TempElement.siblingBelow = null;
			TempElement.imgLyr = null;
			TempElement.scrollParent = null;
			TempElement.scrollbarTop = null;
			TempElement.scrollbarBot = null;
			TempElement = null;
		}
		afr_a_ElementsCreated[i] = null;
	}

	if(!afr_Opera) {
		for(var i=0; i<afr_TotalTrees; i++) {
			if(afr_a_TopMenus[i]) {
				afr_a_TopMenus[i].tree.startChild = null;
				afr_a_TopMenus[i].tree.treeParent = null;
				afr_a_TopMenus[i] = null;
			}
		}
	}
	afr_TotalTrees = 0;
	afr_a_TopMenus = [];

	afr_a_ElementsCreated = [];
}

function afr_f_InitVars(){
	afr_f_ClearElements();
	afr_AreCreated=false;
	afr_UserOverMenu=false;
	afr_HideAllTimer=null;
	afr_ZIndex=5000;
	afr_ScrollTimer=null;
}

afr_f_InitVars();

if(afr_FramesEnabled){
	if((parent == self) || (!afr_FramesNavFramePos)){
		afr_FramesEnabled = false;
	}
}		

function afr_f_FrameLoad(){
	if(afr_IE5M&&afr_AreCreated) return true;
	afr_BeingCreated = true;
	afr_f_InitVars();
	afr_AreCreated = afr_f_StartIt();
	afr_IsReloading = false;
	afr_BeingCreated = false;
	return afr_AreCreated; 
}

function afr_f_InitIt(useframeload){
	if((typeof(afr_MenusTarget.document.body) == "undefined") || (afr_MenusTarget.document.body == null)) return false;
	if (afr_Opera) {
		afr_MenusTarget.Function.prototype.isFunction = true;
		afr_MenusTarget.Function.prototype.isString = false;
		afr_MenusTarget.String.prototype.isFunction = false;
		afr_MenusTarget.String.prototype.isString = true;
		afr_MenusTarget.String.prototype.isBoolean = false;
		afr_MenusTarget.String.prototype.isNumber = false;
		afr_MenusTarget.Number.prototype.isString = false;
		afr_MenusTarget.Number.prototype.isFunction = false;
		afr_MenusTarget.Number.prototype.isBoolean = false;
		afr_MenusTarget.Number.prototype.isNumber = true;
		afr_MenusTarget.Boolean.prototype.isString = false;
		afr_MenusTarget.Boolean.prototype.isFunction = false;
		afr_MenusTarget.Boolean.prototype.isBoolean = true;
		afr_MenusTarget.Boolean.prototype.isNumber = false;
		afr_MenusTarget.Array.prototype.itemValidation = false;
		afr_MenusTarget.Array.prototype.isArray = true;
	}
	afr_IECSS = (afr_IE && afr_MenusTarget.document.compatMode) ? afr_MenusTarget.document.compatMode ==  "CSS1Compat" : false;
	afr_IEDTD = (afr_IE && afr_MenusTarget.document.doctype) ? afr_MenusTarget.document.doctype.name.indexOf(".dtd")!=-1 : afr_IECSS;
	afr_IEnoDTD = (afr_IE) && !afr_IEDTD;
	afr_OperaQuirk = (afr_Opera && (afr_MenusTarget.document.compatMode != "CSS1Compat"));

	afr_UseMouseEnter = (typeof(afr_MenusTarget.document.body.onmouseenter) != "undefined");
	if(afr_IE || afr_Konqueror) afr_Canvas = afr_IECSS ? afr_MenusTarget.document.documentElement : afr_MenusTarget.document.body;
        if(afr_Opera) afr_Canvas = afr_MenusTarget.document.body;
	afr_AreLoaded = true;
	afr_NavUnloaded = false;
	if (afr_ClickKill) {
		afr_f_OtherMouseDown = (afr_MenusTarget.document.onmousedown) ? afr_MenusTarget.document.onmousedown : function() {return true;};
		afr_MenusTarget.document.onmousedown = function(){afr_f_PageClick();return afr_f_OtherMouseDown();}
	}
	else {
		afr_TopMilliSecondsVisible = afr_TopSecondsVisible * 1000;
	}

	var EventTarget = afr_IE ? afr_MenusTarget.document.body : afr_MenusTarget;
	afr_f_OtherResize = (EventTarget.onresize) ? EventTarget.onresize : function() {return true;};
	EventTarget.onresize = afr_f_ResizeHandler;
	if(afr_FramesEnabled) {
		afr_f_MainOtherOnUnload = (EventTarget.onunload) ? EventTarget.onunload : function() {return true;};
		EventTarget.onunload = afr_f_MainUnloadHandler;
	}
	return true;
}

function afr_f_StartIt() {
	if(afr_AreCreated) return true;
	if(afr_FramesEnabled && afr_IE5M) return false;
	var AccessErrorFound = false;
	if(afr_FramesEnabled){
		TargetFrame = parent.frames[afr_FramesMainFrameName];
		if(typeof TargetFrame == "undefined"){
			afr_FramesEnabled = false;
		}
		else {
			afr_MenusTarget = TargetFrame;
			if(!afr_LoadCheckDone) {
				if(((afr_Konqueror)||(navigator.productSub)&&(parseInt(navigator.productSub)>=20020823))&&(!afr_IsSafari)) {
					var FrameEl=parent.document.getElementsByName(afr_FramesMainFrameName)[0];
					FrameEl.addEventListener('load',afr_f_FrameLoad,false);
					afr_FrameHasLoadHandler = true;
				} 
				else if(parent.afr_UseFrameLoad) {
					afr_FrameHasLoadHandler = true;
					parent.afr_f_LoadMenus = afr_f_FrameLoad;
				}
				afr_LoadCheckDone = true;
			}
		}
	}

	try{var TypeOfDocument = typeof(afr_MenusTarget.document);}
	catch(e){
		AccessErrorFound = afr_f_PermissionDenied(e);
	}
	if (AccessErrorFound) return false;
	else AccessErrorFound = false;

	if((afr_IE||afr_Opera) && (typeof(afr_MenusTarget.document) == "unknown")) return false;
	if((afr_IE||afr_Opera) && (afr_MenusTarget.document.readyState != "complete")) return false;

	try{
		var Initialized = afr_f_InitIt(afr_FrameHasLoadHandler);
	}
	catch(e){
		AccessErrorFound = afr_f_PermissionDenied(e);
	}
	if (AccessErrorFound || !Initialized) return false;
	afr_f_MakeTrees();
	afr_f_OtherOnLoad(); 
	return true;
}

function afr_f_GetMenu(menuid) {
	var TheMenu = null;
	if(!afr_f_DocumentCheck()) return TheMenu;
	if ((afr_MenusTarget) &&
	    (afr_MenusTarget.document)) {
		TheMenu = afr_MenusTarget.document.getElementById(menuid);
	}
	return TheMenu;
}

function afr_f_DocumentCheck() {
	var ErrorFound = false;
	var theDocument = null;
	try{
		var TypeOfDocument = typeof(afr_MenusTarget.document);
		if((afr_IE||afr_Opera)&&(typeof(afr_MenusTarget.document) == "unknown")) return false;
		if((afr_IE||afr_Opera)&&(afr_MenusTarget.document.readyState != "complete")) return false;
		theDocument = ((afr_MenusTarget)&&(afr_MenusTarget.document)) ? afr_MenusTarget.document : null;
		var DummyMenu = afr_MenusTarget.document.getElementById('afr_dummy_menu');
		if(theDocument) ErrorFound = false;
	}
	catch(e){
		ErrorFound = afr_f_PermissionDenied(e);
	}
	return (!ErrorFound);
}

function afr_f_ResetTopMenus() {
	afr_TotalTrees = 0;
	afr_a_TopMenus = [];
	for(var t=0; t<afr_a_TreesToBuild.length; t++) {
		var theMenu = afr_f_GetMenu(afr_MenuIDPrefix + afr_a_TreesToBuild[t]);
		if(theMenu) {
			afr_a_TopMenus[afr_TotalTrees] = theMenu.tree.treeParent;
			afr_TotalTrees++;
		}
	}
}

function afr_f_MakeTrees(){
	var TreeParams = null;
	var TreeHasChildren = false;
	var ItemArray = null;

	for(var t=0; t<afr_a_TreesToBuild.length; t++) {
		if(!afr_f_ValidateArray(afr_ArrayIDPrefix + afr_a_TreesToBuild[t])) continue;
		afr_CurrentArray = eval(afr_ArrayIDPrefix + afr_a_TreesToBuild[t]);

		TreeParams = afr_CurrentArray[0];
		TreeHasChildren = false;

		for(var i=1; i<afr_CurrentArray.length; i++) {
			ItemArray = afr_CurrentArray[i];
			if(ItemArray[ItemArray.length-1]) {TreeHasChildren = true; break}
		}
		afr_CurrentTree = {
			MenuWidth        : MenuWidth = afr_f_EvalParameters(TreeParams[0],afr_MenuWidth,"number"),
			MenuLeft         : MenuLeft = afr_f_EvalParameters(TreeParams[1],null,"delayed"),
			MenuTop          : MenuTop = afr_f_EvalParameters(TreeParams[2],null,"delayed"),
			ItemWidth        : MenuWidth - (afr_BorderWidth*2),
			FontColor        : afr_f_EvalParameters(TreeParams[3],afr_FontColor),
			FontColorOver    : afr_f_EvalParameters(TreeParams[4],afr_FontColorOver),
			BGColor          : afr_f_EvalParameters(TreeParams[5],afr_BGColor),
			BGColorOver      : afr_f_EvalParameters(TreeParams[6],afr_BGColorOver),
			BorderColor      : afr_f_EvalParameters(TreeParams[7],afr_BorderColor),
			SeparatorColor   : afr_f_EvalParameters(TreeParams[8],afr_SeparatorColor),
			TopIsPermanent   : ((MenuLeft == null) || (MenuTop == null)) ? false : afr_f_EvalParameters(TreeParams[9],false,"boolean"),
			TopIsHorizontal  : TopIsHorizontal = afr_f_EvalParameters(TreeParams[10],false,"boolean"),
			TreeIsHorizontal : TreeHasChildren ? afr_f_EvalParameters(TreeParams[11],false,"boolean") : false,
			PositionUnder    : (!TopIsHorizontal || !TreeHasChildren) ? false : afr_f_EvalParameters(TreeParams[12],false,"boolean"),
			TopImageShow     : TreeHasChildren ? afr_f_EvalParameters(TreeParams[13],true,"boolean")  : false,
			TreeImageShow    : TreeHasChildren ? afr_f_EvalParameters(TreeParams[14],true,"boolean")  : false,
			UponDisplay      : afr_f_EvalParameters(TreeParams[15],afr_UponDisplay,"delayed"),
			UponHide         : afr_f_EvalParameters(TreeParams[16],afr_UponHide,"delayed"),
			RightToLeft      : afr_f_EvalParameters(TreeParams[17],afr_RightToLeft,"boolean"),
			ClickStart	 : afr_f_EvalParameters(TreeParams[18],afr_ClickStart,"boolean"),
			TopIsVariableWidth  : afr_f_EvalParameters(TreeParams[19],false,"boolean"),
			TreeIsVariableWidth  : afr_f_EvalParameters(TreeParams[20],false,"boolean")
		}

		afr_BuildMenu = null;
		afr_f_MakeMenu(afr_a_TreesToBuild[t]);
		afr_a_TopMenus[afr_TotalTrees] = afr_CurrentTree.treeParent;
		afr_TotalTrees++;
		if(afr_CurrentTree.TopIsPermanent){
			with(afr_CurrentTree.treeParent) {
				afr_CurrentTree.treeParent.xPos = eval(afr_CurrentTree.MenuLeft);
				afr_CurrentTree.treeParent.yPos = eval(afr_CurrentTree.MenuTop);
				moveTo(afr_CurrentTree.treeParent.xPos,afr_CurrentTree.treeParent.yPos);
				style.zIndex = afr_ZIndex;
			}
			if(afr_IE5M||afr_Opera) {
				var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget)&&(afr_MenusTarget.document)) { var afr_TO_El = afr_MenusTarget.document.getElementById('"+afr_CurrentTree.treeParent.id+"'); ";
				TimeoutCommand += "if (afr_TO_El && afr_TO_El.fixSize) afr_TO_El.fixSize(true); }";
				setTimeout(TimeoutCommand,10);
			} 
			else afr_CurrentTree.treeParent.style.visibility = "visible";
		}
	}

	//if(afr_StatusDisplayBuild) window.status = afr_TotalTrees + " Hierarchical Menu Trees Created";
}

function afr_f_SetItemProperties(itemidsuffix) {
	this.tree        = afr_CurrentTree;
	this.index       = afr_BuildMenu.itemCount - 1;
	this.isLastItem  = (afr_BuildMenu.itemCount == afr_BuildMenu.maxItems);
	this.array	 = afr_BuildMenu.array[afr_BuildMenu.itemCount];
	this.dispText    = this.array[0];
	this.linkText    = this.array[1];
	this.permHilite  = afr_f_EvalParameters(this.array[3],false,"boolean");
	this.hasRollover = (!this.permHilite && afr_f_EvalParameters(this.array[2],true,"boolean"));
	this.hasMore	 = afr_f_EvalParameters(this.array[4],false,"boolean") && afr_f_ValidateArray(afr_ArrayIDPrefix + itemidsuffix);
	this.childID	 = this.hasMore ? (afr_MenuIDPrefix + itemidsuffix) : null;
	this.child	 = null;

	if(afr_UseMouseEnter){
	 	this.onmouseenter  = afr_f_ItemOver;
		this.onmouseleave  = afr_f_ItemOut;
	}
	else {
	 	this.onmouseover = afr_f_ItemOver;
		this.onmouseout  = afr_f_ItemOut;
	}

	this.setItemStyle = afr_f_SetItemStyle;
	this.hoverChild   = afr_f_HoverChild;
	this.hoverTime = (this.menu == this.tree.startChild) ? afr_HoverTimeTop : afr_HoverTimeTree;

	this.showChild   = afr_f_ShowChild;
	this.showChildPosition = afr_f_ShowChildPosition;
	if(afr_IE5M) this.showChildDelay = afr_f_IE5MShowChildDelay;
	this.displayChild = afr_f_DisplayChild;
	this.ClickStart = (this.hasMore && this.tree.ClickStart && (this.tree.TopIsPermanent && (this.tree.treeParent==this.menu))) ? true : false;
	if(this.ClickStart) {
		this.linkText = "";
		this.onclick = this.hoverChild;
	}
	this.ChildOverlap = null;
}

function afr_f_MakeElement(menuid) {
	var MenuObject = afr_MenusTarget.document.createElement("DIV");
	afr_f_StoreElement(MenuObject);

        var MenuWidth  = ((afr_IEnoDTD || afr_OperaQuirk) ? afr_CurrentTree.MenuWidth : afr_CurrentTree.ItemWidth) + "px";
	with(MenuObject){
		id = menuid;
		with(style) {
			position = "absolute";
			visibility = "hidden";
			left = "-500px";
			top = "-2000px";
			width = MenuWidth;
		}
	}
	afr_MenusTarget.document.body.appendChild(MenuObject);
	afr_LastMenuID = menuid;

	if(afr_ScrollEnabled){
		MenuObject.scrollParent = MenuObject.appendChild(afr_MenusTarget.document.createElement("DIV"));

		with(MenuObject.scrollParent.style) {
			position = "absolute";
			top = "0px";
			width = MenuWidth;
		}
		MenuObject.scrollParent.top = 0;
		if(typeof document.onmousewheel != "undefined") MenuObject.onmousewheel = afr_f_DoWheelScroll;
	}
	else {
		MenuObject.scrollParent = MenuObject;
	}
	return MenuObject;
}

function afr_f_MakeMenu(menucount) {
	if(!afr_f_ValidateArray(afr_ArrayIDPrefix + menucount)) return false;
	afr_CurrentArray = eval(afr_ArrayIDPrefix + menucount);

	var NewMenu = afr_MenusTarget.document.getElementById(afr_MenuIDPrefix + menucount);
	if(!NewMenu){
		NewMenu = afr_f_MakeElement(afr_MenuIDPrefix + menucount);
		if(afr_BuildMenu) {
			NewMenu.parentMenu = afr_BuildMenu;
			NewMenu.parentItem = afr_BuildMenu.itemElement;
			NewMenu.parentItem.child = NewMenu;
			NewMenu.hasParent = true;
			NewMenu.isHorizontal = afr_CurrentTree.TreeIsHorizontal;
			NewMenu.showImage = afr_CurrentTree.TreeImageShow;
		}
		else {
			NewMenu.isHorizontal = afr_CurrentTree.TopIsHorizontal;
			NewMenu.showImage = afr_CurrentTree.TopImageShow;
			afr_CurrentTree.treeParent = afr_CurrentTree.startChild = NewMenu;
		}

		afr_BuildMenu = NewMenu;
		afr_BuildMenu.array = afr_CurrentArray;
		afr_BuildMenu.tree  = afr_CurrentTree;
		afr_BuildMenu.itemCount = 0;
		afr_BuildMenu.maxItems = afr_BuildMenu.array.length - 1;
		afr_BuildMenu.IsVariableWidth = ((afr_BuildMenu.hasParent && afr_CurrentTree.TreeIsVariableWidth) || (!afr_BuildMenu.hasParent && afr_CurrentTree.TopIsVariableWidth));
		afr_BuildMenu.showIt = afr_f_ShowIt;
		afr_BuildMenu.count = menucount;
		afr_BuildMenu.keepInWindow = afr_f_KeepInWindow;

		if(afr_UseMouseEnter){
		 	afr_BuildMenu.onmouseenter = afr_f_MenuOver;
			afr_BuildMenu.onmouseleave = afr_f_MenuOut;
		}
		else {
		 	afr_BuildMenu.onmouseover = afr_f_MenuOver;
			afr_BuildMenu.onmouseout = afr_f_MenuOut;
		}
    
		afr_BuildMenu.hideTree = afr_f_HideTree
		afr_BuildMenu.hideParents = afr_f_HideParents;
		afr_BuildMenu.hideChildren = afr_f_HideChildren;
		afr_BuildMenu.hideTop = afr_f_HideTop;
		afr_BuildMenu.hideSelf = afr_f_HideSelf;
		afr_BuildMenu.hasChildVisible = false;
		afr_BuildMenu.isOn = false;
		afr_BuildMenu.hideTimer = null;
		afr_BuildMenu.currentItem = null;
		afr_BuildMenu.setMenuStyle = afr_f_SetMenuStyle;
		afr_BuildMenu.sizeFixed = false;
		afr_BuildMenu.fixSize = afr_f_FixSize;
		afr_BuildMenu.scrollbarsCreated = false;
		afr_BuildMenu.enableScrolling = afr_f_EnableScrolling;
		afr_BuildMenu.createScrollbars = afr_f_CreateScrollbars;
		afr_BuildMenu.startScroll = afr_f_StartScroll;
		afr_BuildMenu.checkScroll = afr_f_CheckScroll;
		afr_BuildMenu.scrollbarsVisible = false;

		if(afr_IE) afr_BuildMenu.onselectstart = afr_f_CancelSelect;
		afr_BuildMenu.moveTo = afr_f_MoveTo;
		afr_BuildMenu.setMenuStyle();

		if(afr_IE5M && afr_ScrollEnabled && !afr_BuildMenu.isHorizontal && !(afr_CurrentTree.PositionUnder && afr_BuildMenu.parentMenu == afr_CurrentTree.treeParent) && !(afr_CurrentTree.TopIsPermanent && afr_BuildMenu == afr_CurrentTree.treeParent)) {
			afr_BuildMenu.createScrollbars();
		}
	}

	while (afr_BuildMenu.itemCount < afr_BuildMenu.maxItems) {
		afr_BuildMenu.itemCount++;
		afr_BuildMenu.itemElement = afr_MenusTarget.document.getElementById(afr_ItemIDPrefix + menucount + "_" + afr_BuildMenu.itemCount);

		if(!afr_BuildMenu.itemElement){
			//if(afr_StatusDisplayBuild) window.status = "Creating Hierarchical Menus: " + menucount + " / " + afr_BuildMenu.itemCount;
			afr_BuildMenu.itemElement = afr_f_MakeItemElement(menucount);
		}
		if(afr_BuildMenu.itemElement.hasMore && (!afr_CreateTopOnly || afr_AreCreated && afr_CreateTopOnly)) {
			MenuCreated = afr_f_MakeMenu(menucount + "_" + afr_BuildMenu.itemCount);
			if(MenuCreated) {
				afr_BuildMenu = afr_BuildMenu.parentMenu;
			}
		}
	}
	if(!afr_IE5M) afr_BuildMenu.fixSize();
	return afr_BuildMenu;
}

function afr_f_SetMenuStyle(){
	with(this.style) {
		borderWidth = afr_BorderWidth + "px";
		borderColor = afr_CurrentTree.BorderColor;
		borderStyle = afr_BorderStyle;
		overflow    = "hidden";
		cursor      = "default";
	}
}

function afr_f_MakeItemElement(menucount) {
	if((afr_IE5M)&&(afr_FramesEnabled)) {
		var htmlString = "<div id='"+afr_ItemIDPrefix+menucount+"_"+afr_BuildMenu.itemCount+"' style='position:absolute; visibility:inherit'>Item</div>";
		afr_BuildMenu.scrollParent.insertAdjacentHTML('BeforeEnd',htmlString);
		var ItemElement = afr_MenusTarget.document.getElementById(afr_ItemIDPrefix+menucount+"_"+afr_BuildMenu.itemCount);
	}
	else {
		var ItemElement = afr_MenusTarget.document.createElement("DIV");
		ItemElement.id = afr_ItemIDPrefix + menucount + "_" + afr_BuildMenu.itemCount;
		ItemElement.style.position = "absolute";
		ItemElement.style.visibility = "inherit";
		afr_BuildMenu.scrollParent.appendChild(ItemElement);
	}

	afr_f_StoreElement(ItemElement);

	ItemElement.menu = afr_BuildMenu;
	ItemElement.childTimer = null;
	ItemElement.setItemProperties = afr_f_SetItemProperties;
	ItemElement.setItemProperties(menucount + "_" + afr_BuildMenu.itemCount);
	ItemElement.siblingBelow = ItemElement.previousSibling;
	if(ItemElement.linkText && !ItemElement.ClickStart) {
		ItemElement.onclick = afr_f_LinkIt;
		if(afr_ShowLinkCursor)ItemElement.style.cursor = (afr_NS6 || afr_Konqueror) ? "pointer" : "hand";
	}
	var FullPadding  = (afr_ItemPadding*2) + afr_ImageSize + afr_ImageHorizSpace;

	ItemElement.hasImage = (ItemElement.hasMore && afr_BuildMenu.showImage);
	if(ItemElement.hasImage) {
		var ImageElement = afr_MenusTarget.document.createElement("IMG");

		afr_f_StoreElement(ImageElement);

		ItemElement.imageSrc = afr_CurrentTree.RightToLeft ? afr_ImageSrcLeft : afr_ImageSrc;
		if(!afr_CurrentTree.RightToLeft) {
			ItemElement.hasImageRollover = (afr_ImageSrcOver&&(afr_ImageSrcOver!=afr_ImageSrc));
		}
		else {
			ItemElement.hasImageRollover = (afr_ImageSrcLeftOver&&(afr_ImageSrcLeftOver!=afr_ImageSrcLeft));
		}
		if(ItemElement.hasImageRollover) {
			ItemElement.imageSrcOver = afr_CurrentTree.RightToLeft ? afr_ImageSrcLeftOver : afr_ImageSrcOver;
			if(!ItemElement.imageSrcOver) ItemElement.imageSrcOver = ItemElement.imageSrc;
			if(ItemElement.permHilite) ItemElement.imageSrc = ItemElement.imageSrcOver;
		}

		with(ImageElement){
			if(ItemElement.imageSrc) src = ItemElement.imageSrc;
			removeAttribute("height");
			hspace = (!afr_CurrentTree.RightToLeft && afr_IE5W) ? afr_ItemPadding : 0;
			vspace = 0;
			width = afr_ImageSize;
			with(style) {
				position = "absolute";
				top = (afr_ItemPadding + afr_ImageVertSpace) + "px";
				if(afr_CurrentTree.RightToLeft) {
					left = (afr_ItemPadding + afr_ImageHorizSpace) + "px";
				}
			}
		}
		ItemElement.imgLyr = ImageElement;
	}
	ItemElement.innerHTML = ItemElement.dispText;
	if(ImageElement) ItemElement.insertBefore(ImageElement,ItemElement.firstChild);
	ItemElement.setItemStyle();
	return ItemElement;
}

function afr_f_SetItemStyle() {
	with(this.style){
		backgroundColor = (this.permHilite) ? afr_CurrentTree.BGColorOver : afr_CurrentTree.BGColor;
		color = (this.permHilite) ? afr_CurrentTree.FontColorOver : afr_CurrentTree.FontColor;
		padding = afr_ItemPadding +"px";
		font = ((afr_FontBold) ? "bold " : "normal ") + afr_FontSize + "pt " + afr_FontFamily;
		fontStyle = (afr_FontItalic) ? "italic" : "normal";
		if(afr_IE) overflow = "hidden";

		if((this.menu.showImage && (!this.menu.IsVariableWidth || (this.menu.IsVariableWidth && this.tree.RightToLeft && !this.menu.isHorizontal))) || (this.menu.IsVariableWidth && this.imgLyr)) {
			var FullPadding  = (afr_ItemPadding*2) + afr_ImageSize + afr_ImageHorizSpace;
			if (afr_CurrentTree.RightToLeft) paddingLeft = FullPadding + "px";
			else paddingRight = FullPadding + "px";
		}
		if(!this.isLastItem) {
			var SeparatorString = afr_SeparatorSize + "px solid " + this.tree.SeparatorColor;
			if (this.menu.isHorizontal) borderRight = SeparatorString;
			else borderBottom = SeparatorString;
		}

		if(this.menu.isHorizontal){
			top = "0px";
			if(!this.menu.IsVariableWidth) {
				if(afr_IEnoDTD || afr_OperaQuirk){
					if(this.isLastItem) width = (afr_CurrentTree.MenuWidth - afr_BorderWidth - afr_SeparatorSize) + "px";
					else width = (afr_CurrentTree.MenuWidth - afr_BorderWidth) + "px";
					left = (this.index * (afr_CurrentTree.MenuWidth - afr_BorderWidth)) + "px";
				}
				else {
					width = (afr_CurrentTree.MenuWidth - afr_BorderWidth - parseInt(paddingLeft) - parseInt(paddingRight) - afr_SeparatorSize) + "px";
					left = ((this.index * parseInt(width)) + ((afr_SeparatorSize * this.index)))  + ((parseInt(paddingLeft) + parseInt(paddingRight)) * this.index) + "px";
				}
				var LeftAndWidth = parseInt(left) + parseInt(width);
		                this.menu.style.width = LeftAndWidth + ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth * 2) : (parseInt(paddingLeft) + parseInt(paddingRight))) + "px"
			}
		}
		else {
			left = "0px";
			if(!this.menu.IsVariableWidth) {
				if(afr_IEnoDTD || afr_OperaQuirk) width = afr_CurrentTree.ItemWidth + "px";
				else width = (afr_CurrentTree.ItemWidth - (parseInt(paddingLeft) + parseInt(paddingRight))) + "px";
			}
		}
	}
}

function afr_f_FixSize(makevis){
	var Items = this.scrollParent.childNodes;
	var ItemCount = Items.length;
	var TempItem;

	if(this.isHorizontal) {
		if(this.IsVariableWidth) {
			for(var i=0; i<ItemCount; i++) {
				TempItem = Items[i];
				TempItem.realWidth = (afr_IE) ? TempItem.scrollWidth : TempItem.offsetWidth;
				if (isNaN(TempItem.realWidth)) TempItem.realWidth=TempItem.offsetWidth;
				if(afr_IE5M) TempItem.realWidth += (parseInt(TempItem.style.paddingLeft) + parseInt(TempItem.style.paddingRight))
		                if(afr_IEnoDTD || afr_OperaQuirk){
					if(afr_OperaQuirk){
						TempItem.style.width = (TempItem.realWidth) + "px";
					} 
					else {
						if(TempItem.isLastItem) TempItem.style.width = (TempItem.realWidth) + "px";
						else TempItem.style.width = (TempItem.realWidth + afr_SeparatorSize) + "px";
					}
					TempItem.style.left = (TempItem.index ? parseInt(TempItem.siblingBelow.style.left) + parseInt(TempItem.siblingBelow.style.width) : 0) + "px";
				}
				else { 
					if(TempItem.hasImage && !afr_CurrentTree.RightToLeft) {
			                        if(!afr_IECSS && !afr_Opera) TempItem.realWidth += afr_ItemPadding;
					}
					TempItem.realWidth -= (parseInt(TempItem.style.paddingLeft) + parseInt(TempItem.style.paddingRight));
 					if(!afr_IECSS && !afr_IE5M && !TempItem.isLastItem)  TempItem.realWidth -= afr_SeparatorSize;
					TempItem.allowableWidth = TempItem.tree.ItemWidth - (parseInt(TempItem.style.paddingLeft) + parseInt(TempItem.style.paddingRight));
					TempItem.style.width = Math.min(TempItem.allowableWidth,TempItem.realWidth) + "px";
					TempItem.style.left = (TempItem.index ? (parseInt(TempItem.siblingBelow.style.left) + TempItem.siblingBelow.offsetWidth) : 0) + "px";
				}
				if(TempItem.isLastItem) {
					LeftAndWidth = parseInt(TempItem.style.left) + parseInt(TempItem.style.width);
					this.style.width = this.scrollParent.style.width = LeftAndWidth + ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth * 2) : (parseInt(TempItem.style.paddingLeft) + parseInt(TempItem.style.paddingRight))) + "px";
				}
			}
		}

		var MaxItemHeight = 0;
		for(var i=0; i<ItemCount; i++) {
			TempItem = Items[i];
			if(TempItem.index) {
				var SiblingHeight = TempItem.siblingBelow.offsetHeight - ((afr_IEnoDTD || afr_OperaQuirk) ? 0 : (afr_ItemPadding * 2));
				MaxItemHeight = Math.max(MaxItemHeight,SiblingHeight);
			}
			else {
				MaxItemHeight = TempItem.offsetHeight - ((afr_IEnoDTD || afr_OperaQuirk) ? 0 : (afr_ItemPadding * 2));
			}
		}
		for(var i=0; i<ItemCount; i++) {
			TempItem = Items[i];
			TempItem.style.height = MaxItemHeight +"px";
			if(TempItem.imgLyr) {
				if(this.tree.RightToLeft){
					TempItem.imgLyr.style.left = (afr_ItemPadding + afr_ImageHorizSpace) + "px";
				}
				else {
					TempItem.imgLyr.style.left = (TempItem.offsetWidth - ((TempItem.isLastItem ? 0 : afr_SeparatorSize) + (afr_IEnoDTD ? afr_IE5M ? afr_ItemPadding : afr_ItemPadding * 2 : afr_IECSS ? afr_ItemPadding * 2 : afr_ItemPadding) + afr_ImageHorizSpace + afr_ImageSize)) + "px";
				}
			}
		}
		this.style.height = this.scrollParent.style.height = MaxItemHeight + ((afr_IEnoDTD || afr_OperaQuirk) ? afr_BorderWidth * 2 : (afr_ItemPadding * 2)) + "px";
	}
	else {
		if(this.IsVariableWidth) {
			var MaxItemWidth = 0;
			for(var i=0; i<ItemCount; i++) {
				TempItem = Items[i];
				TempItem.realWidth = (afr_IE) ? TempItem.scrollWidth : TempItem.offsetWidth;
				if (isNaN(TempItem.realWidth)) TempItem.realWidth=TempItem.offsetWidth;
				if(afr_IE5M) TempItem.realWidth += (parseInt(TempItem.style.paddingLeft) + parseInt(TempItem.style.paddingRight))
		                if(!afr_IEnoDTD && !afr_OperaQuirk) {
					TempItem.realWidth -= ((parseInt(TempItem.style.paddingRight) + parseInt(TempItem.style.paddingLeft)))
				}
				MaxItemWidth = i ? Math.max(MaxItemWidth,TempItem.realWidth) : TempItem.realWidth;
				if(MaxItemWidth==TempItem.realWidth) var TempWidest = TempItem;
			}
			for(var i=0; i<ItemCount; i++) {
				Items[i].style.width = TempWidest.realWidth + "px";
				if(!afr_IEnoDTD && !afr_OperaQuirk) {
					if(Items[i].imgLyr&&!TempWidest.imgLyr) {
						Items[i].style.width = (TempWidest.realWidth - afr_ImageSize - afr_ImageHorizSpace - afr_ItemPadding) + "px";
					}
					else {
						Items[i].style.paddingLeft = TempWidest.style.paddingLeft;
						Items[i].style.paddingRight = TempWidest.style.paddingRight;
					}
				}
			}
			this.style.width = this.scrollParent.style.width = (Items[0].offsetWidth +  ((afr_IEnoDTD || afr_OperaQuirk) ? afr_BorderWidth * 2 : 0)) + "px";
		}
		for(var i=0; i<ItemCount; i++) {
			var TempItem = Items[i];
			if (TempItem.index) {
				var SiblingHeight =(TempItem.siblingBelow.offsetHeight);
				TempItem.style.top = parseInt(TempItem.siblingBelow.style.top) + SiblingHeight + "px";
			}
			else TempItem.style.top = "0px";

			if(TempItem.imgLyr) {
				if(this.tree.RightToLeft){
					TempItem.imgLyr.style.left = (afr_ItemPadding + afr_ImageHorizSpace) + "px";
				}
				else {
					TempItem.imgLyr.style.left = (TempItem.offsetWidth - ((afr_IEnoDTD ? afr_IE5M ? afr_ItemPadding : afr_ItemPadding*2 :  afr_IECSS ? afr_ItemPadding * 2 : afr_ItemPadding) + afr_ImageHorizSpace + afr_ImageSize)) + "px";
				}
			}
		}
		this.style.height = this.scrollParent.style.height = parseInt(TempItem.style.top) + (afr_IE5W ? TempItem.scrollHeight : TempItem.offsetHeight) + ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth * 2) : 0) + "px";
	}
	this.origHeight = this.style.height;
	if(afr_IE5M && this.scrollbarsCreated) {
		with(this.scrollbarTop.style){
			width = (parseInt(this.style.width) - (afr_IEnoDTD ? (afr_BorderWidth * 2) : 0)) + "px";
			height = (afr_ScrollBarHeight - (afr_IEnoDTD ? 0 : (afr_BorderWidth * 2))) + "px";
		}
		with(this.scrollbarTop.firstChild.style){
			top = ((afr_ScrollBarHeight - (afr_BorderWidth * 2) - afr_ScrollImgHeight)/2) + "px";
			left = ((parseInt(this.scrollbarTop.style.width) - afr_ScrollImgWidth)/2)+"px";
		}

		with(this.scrollbarBot.style){
			width = (parseInt(this.style.width) - (afr_IEnoDTD ? (afr_BorderWidth * 2) : 0)) + "px";
			height = (afr_ScrollBarHeight - (afr_IEnoDTD ? 0 : (afr_BorderWidth * 2))) + "px";
		}
		with(this.scrollbarBot.firstChild.style){
			top = ((afr_ScrollBarHeight - (afr_BorderWidth * 2) - afr_ScrollImgHeight)/2) + "px";
			left = ((parseInt(this.scrollbarBot.style.width) - afr_ScrollImgWidth)/2)+"px";
		}
	}
	this.sizeFixed = true;
	if(makevis)this.style.visibility = "visible";
}

function afr_menuUp(menuname,e){
	if(!afr_NS6 && !afr_Opera) e = event;

	if(!afr_AreLoaded) return;
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;

	if(!afr_BeingCreated && !afr_AreCreated){
		if(afr_FrameHasLoadHandler) return;
		if(!afr_f_FrameLoad()) return;
	}

	menuname = menuname.replace("amenu",afr_MenuIDPrefix);
	var TempMenu = afr_MenusTarget.document.getElementById(menuname);
	if(!TempMenu) {
		if (!afr_Opera||afr_FrameHasLoadHandler) return;
		if(afr_BeingCreated||!afr_AreCreated) return;
		if(!afr_f_FrameLoad()) return;
		TempMenu = afr_MenusTarget.document.getElementById(menuname);
		if(!TempMenu) return;
	}
	if (TempMenu.tree.ClickStart) {
		var ClickElement = (afr_NS6) ? e.target : e.srcElement;
		if(afr_NS6) {
			while(ClickElement.tagName==null){
				ClickElement = ClickElement.parentNode;
			}
		}
		var OnClickFunction = "return afr_menuMenu(event,'" + menuname + "');"
		ClickElement.onclick = new Function("event",OnClickFunction);
	}
	else afr_menuMenu(e,menuname);
}

function afr_menuMenu(e,menuname){
	if (!afr_AreLoaded || !afr_AreCreated) return true;
	if (afr_IsReloading||!afr_f_DocumentCheck()) return true;
	if(afr_IE) e = event;
	var TempMenu = afr_MenusTarget.document.getElementById(menuname);
	if(!TempMenu) return true;
	afr_CurrentMenu = TempMenu;
	if (afr_CurrentMenu.tree.ClickStart && e.type != "click") return true;
	var mouse_x_position, mouse_y_position;
	afr_f_HideAll();
	afr_CurrentMenu.hasParent = false;
	afr_CurrentMenu.tree.startChild = afr_CurrentMenu;

	if(!afr_FramesEnabled){
		mouse_x_position = (afr_NS6) ? e.pageX : (e.clientX + afr_Canvas.scrollLeft);
		mouse_y_position = (afr_NS6) ? e.pageY : (e.clientY + afr_Canvas.scrollTop);
	}
	else {
		switch (afr_FramesNavFramePos) {
			case "top":
				mouse_x_position = (afr_NS6) ? (e.pageX-window.pageXOffset) + afr_MenusTarget.pageXOffset : (e.clientX + afr_Canvas.scrollLeft);
				mouse_y_position = (afr_NS6) ? afr_MenusTarget.pageYOffset : afr_Canvas.scrollTop;
				break;
			case "bottom":
				mouse_x_position = (afr_NS6) ? (e.pageX-window.pageXOffset)+afr_MenusTarget.pageXOffset : (e.clientX + afr_Canvas.scrollLeft);
				mouse_y_position = (afr_NS6) ? afr_MenusTarget.pageYOffset+afr_MenusTarget.innerHeight : (afr_Canvas.scrollTop + afr_Canvas.clientHeight);
				break;
			case "right":
				mouse_x_position = (afr_NS6) ? (afr_MenusTarget.pageXOffset+afr_MenusTarget.innerWidth) : (afr_Canvas.scrollLeft+afr_Canvas.clientWidth);
				mouse_y_position = (afr_NS6) ? (e.pageY-window.pageYOffset)+afr_MenusTarget.pageYOffset : (e.clientY + afr_Canvas.scrollTop);
				break;
			case "left":
			default:
				mouse_x_position = (afr_NS6) ? afr_MenusTarget.pageXOffset : afr_Canvas.scrollLeft;
				mouse_y_position = (afr_NS6) ? (e.pageY-window.pageYOffset) + afr_MenusTarget.pageYOffset : (e.clientY + afr_Canvas.scrollTop);
				break;
		}
	}
	afr_CurrentMenu.mouseX = mouse_x_position;
	afr_CurrentMenu.mouseY = mouse_y_position;

	afr_CurrentMenu.xIntended = afr_CurrentMenu.xPos = (afr_CurrentMenu.tree.MenuLeft!=null) ? eval(afr_CurrentMenu.tree.MenuLeft) : mouse_x_position;
	afr_CurrentMenu.yIntended = afr_CurrentMenu.yPos = (afr_CurrentMenu.tree.MenuTop!=null)  ? eval(afr_CurrentMenu.tree.MenuTop)  : mouse_y_position;
	if(afr_IE5M && !afr_CurrentMenu.sizeFixed) afr_CurrentMenu.fixSize(false);
	if(afr_CurrentMenu.scrollbarsCreated) {
		afr_CurrentMenu.style.height = afr_CurrentMenu.origHeight;
		afr_CurrentMenu.checkScroll();
	}

	afr_CurrentMenu.keepInWindow();
	afr_CurrentMenu.moveTo(afr_CurrentMenu.xPos,afr_CurrentMenu.yPos);
	afr_CurrentMenu.isOn = true;

	if((afr_IE5M) || (afr_NS6)){
		var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget)&&(afr_MenusTarget.document)) { var afr_TO_El1 = afr_MenusTarget.document.getElementById('"+afr_CurrentMenu.id+"'); ";
		TimeoutCommand += "if (afr_TO_El1 && afr_TO_El1.isOn && afr_TO_El1.showIt) afr_TO_El1.showIt(true); }";
		setTimeout(TimeoutCommand,10);
	}
	else {
		afr_CurrentMenu.showIt(true);
	}

	return false;
}

function afr_f_MenuOver() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if(!this.tree.startChild){this.tree.startChild = this}
	if(this.tree.startChild == this) afr_f_HideAll(this)
	this.isOn = true;
	afr_UserOverMenu = true;
	afr_CurrentMenu = this;
	if (this.hideTimer) clearTimeout(this.hideTimer);
}

function afr_f_MenuOut() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if(afr_IE && afr_MenusTarget.event.srcElement.contains(afr_MenusTarget.event.toElement)) return;

	this.isOn = false;
	afr_UserOverMenu = false;
	if(afr_StatusDisplayLink) window.status = "";

	var Items = this.scrollParent.childNodes;
	var ItemCount = Items.length;
	var TempItem;
	for(var i=0;i<ItemCount;i++){
		TempItem = Items[i];
		clearTimeout(TempItem.childTimer);
		TempItem.childTimer = null;
	}
	if(!afr_ClickKill) {
		clearTimeout(afr_HideAllTimer);
		afr_HideAllTimer = null;
		var TimeoutCommand = "var afr_MenuOutMenuToHide = afr_f_GetMenu('" + this.id + "'); if (afr_MenuOutMenuToHide && afr_MenuOutMenuToHide.hideTree) afr_MenuOutMenuToHide.hideTree()";
		afr_HideAllTimer = setTimeout(TimeoutCommand,afr_ChildMilliSecondsVisible);
	}
}

function afr_f_ShowChildPosition() {
	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 - (afr_BorderWidth);
	}
	else {
		if(this.ChildOverlap==null) {
			this.DistanceToRightEdge = parseInt(this.style.width);
			if(!afr_IEnoDTD && !afr_OperaQuirk) this.DistanceToRightEdge += (parseInt(this.style.paddingLeft)+parseInt(this.style.paddingRight)) + ((this.menu.isHorizontal && !this.isLastItem) ? afr_SeparatorSize : 0);
			if (!this.menu.isHorizontal || (this.menu.isHorizontal && this.isLastItem)) this.DistanceToRightEdge += afr_BorderWidth;
			this.DistanceToLeftEdge = (!this.menu.isHorizontal || (this.menu.isHorizontal && this.index==0)) ? afr_BorderWidth : afr_SeparatorSize;
			this.ChildOverlap = (parseInt((afr_ChildPerCentOver != null) ? (afr_ChildPerCentOver  * this.DistanceToRightEdge) : afr_ChildOverlap));
		}
		if(afr_IE5M) {
			this.oL = parseInt(this.menu.style.left) - afr_ItemPadding;
			this.oL += this.offsetLeft;
			this.oT = parseInt(this.menu.style.top) - afr_ItemPadding;
			this.oT += this.offsetTop;
			if(afr_ScrollEnabled) {
				this.oT += this.menu.scrollParent.top;
				if(afr_ScrollBothBars && this.menu.scrollbarsVisible) this.oT += afr_ScrollBarHeight;
			}
		}
		else {
			this.oL = (afr_IEpos) ? parseInt(this.menu.style.left) + afr_BorderWidth : 0;
			this.oL += this.offsetLeft;
			this.oT = (afr_IEpos) ? parseInt(this.menu.style.top) : -afr_BorderWidth;
			this.oT += this.offsetTop;
			if(afr_ScrollEnabled && afr_IEpos) {
				this.oT += this.menu.scrollParent.top;
				if(afr_ScrollBothBars && this.menu.scrollbarsVisible) this.oT += afr_ScrollBarHeight;
			}

		}
		if(this.tree.RightToLeft) {
			this.child.xPos = ((this.oL - this.DistanceToLeftEdge) + this.ChildOverlap) - this.child.offsetWidth;
		}
		else {		
			this.child.xPos = (this.oL + this.DistanceToRightEdge) - this.ChildOverlap;
		}
		this.child.yPos = this.oT + afr_ChildOffset + afr_BorderWidth;
	}

	if(!this.tree.PositionUnder || this.menu!=this.tree.treeParent) {
		if(this.child.scrollbarsCreated) {
			this.child.style.height = this.child.origHeight;
		}
		this.child.keepInWindow();
	}	
	this.child.moveTo(this.child.xPos,this.child.yPos);
}

function afr_f_IE5MShowChildDelay() {
	this.child.fixSize(false);
	this.showChildPosition();

	var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget)&&(afr_MenusTarget.document)) { var afr_TO_El2 = afr_MenusTarget.document.getElementById('"+this.id+"'); ";
	TimeoutCommand += "if (afr_TO_El2 && afr_TO_El2.displayChild) afr_TO_El2.displayChild(); }";
	setTimeout(TimeoutCommand,10);
}

function afr_f_ShowChild(){
	if(afr_BeingCreated||afr_BuildingMenu||afr_IsReloading||!afr_f_DocumentCheck()) return;
	afr_BuildingMenu=true;
	if(!this.child) {
	   	afr_CurrentTree = this.tree;
	   	afr_BuildMenu = this.menu;
	   	afr_BuildMenu.itemElement = this;
	   	this.child = afr_f_MakeMenu(this.menu.count + "_"+(this.index+1));
	   	this.tree.treeParent = this.menu;
	   	this.tree.startChild = this.menu;
	   	afr_CurrentTree = this.tree;
	}
	afr_BuildingMenu=false;

	if(this.menu.style.visibility == "hidden") return;

	if(afr_IE5M && !this.child.sizeFixed) {
		var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget)&&(afr_MenusTarget.document)) { var afr_TO_El3 = afr_MenusTarget.document.getElementById('"+this.id+"'); ";
		TimeoutCommand += "if (afr_TO_El3 && afr_TO_El3.showChildDelay) afr_TO_El3.showChildDelay(); }";
		setTimeout(TimeoutCommand,10);
	}
	else {
		this.showChildPosition();

		if((afr_IE5M) || (afr_NS6)){
			var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget)&&(afr_MenusTarget.document)) { var afr_TO_El4 = afr_MenusTarget.document.getElementById('"+this.id+"'); ";
			TimeoutCommand += "if (afr_TO_El4 && afr_TO_El4.displayChild) afr_TO_El4.displayChild(); }";
			setTimeout(TimeoutCommand,10);
		}
		else {
			this.displayChild();
		}
	}
}

function afr_f_DisplayChild(){
	if ((this.menu.currentItem == this)&&(this.menu.isOn)) {
		this.menu.hasChildVisible = true;
		this.menu.visibleChild = this.child;
		this.child.showIt(true);
	}
}

function afr_f_ItemOver(){
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	var ItemMenu = this.menu;

	if (afr_KeepHilite) {
		if (ItemMenu.currentItem && ItemMenu.currentItem != this && ItemMenu.currentItem.hasRollover) {
			with(ItemMenu.currentItem.style){
				backgroundColor = this.tree.BGColor;
				color = this.tree.FontColor
			}
			if(ItemMenu.currentItem.hasImageRollover) ItemMenu.currentItem.imgLyr.src = ItemMenu.currentItem.imageSrc;
		}
		if(ItemMenu != this.tree.startChild){
			var ParentMenu = ItemMenu.parentMenu;
			if (ParentMenu.currentItem && ParentMenu.currentItem.hasRollover) {
				with(ParentMenu.currentItem.style){
					backgroundColor = this.tree.BGColor;
					color = this.tree.FontColor
				}
				if(ParentMenu.currentItem.hasImageRollover) ParentMenu.currentItem.imgLyr.src = ParentMenu.currentItem.imageSrc;
			}
			var ParentItem = ItemMenu.parentItem;
			if(ParentItem.hasRollover) {
				ParentItem.style.backgroundColor = this.tree.BGColorOver;
				ParentItem.style.color = this.tree.FontColorOver;
				if(ParentItem.hasImageRollover) ParentItem.imgLyr.src = ParentItem.imageSrcOver;
			}
			ParentMenu.currentItem = ParentItem;
		}
	}
	if(this.hasRollover) {
		this.style.backgroundColor = this.tree.BGColorOver;
		this.style.color = this.tree.FontColorOver;
		if(this.hasImageRollover) this.imgLyr.src = this.imageSrcOver;
	}

	if(afr_StatusDisplayLink) window.status = "http://www.iesronda.org"+this.linkText;
	ItemMenu.currentItem = this;
	
	var Items = ItemMenu.scrollParent.childNodes;
	var ItemCount = Items.length;
	var TempItem;
	for(var i=0;i<ItemCount;i++){
		TempItem = Items[i];
		clearTimeout(TempItem.childTimer);
		TempItem.childTimer = null;
	}
	
	var TimeoutCommand = "if ((afr_f_DocumentCheck())&&(afr_MenusTarget) && (afr_MenusTarget.document)) { var afr_TO_El5 = afr_MenusTarget.document.getElementById('"+this.id+"'); ";
	TimeoutCommand += "if (afr_TO_El5 && afr_TO_El5.hoverChild) afr_TO_El5.hoverChild(true); }";
	this.childTimer = setTimeout(TimeoutCommand,this.hoverTime);
}

function afr_f_HoverChild(onover){
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	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.ClickStart && (onover!=true)) || (this.hasMore && !this.ClickStart)) this.showChild();
}

function afr_f_ItemOut() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if(this.hasRollover){
		with(this.style) {
			backgroundColor = this.tree.BGColor;
			color = this.tree.FontColor
		}
		if(this.hasImageRollover) this.imgLyr.src = this.imageSrc;
	}
}

function afr_f_MoveTo(xPos,yPos) {
	this.style.left = xPos + "px";
	this.style.top = yPos + "px";
}

function afr_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 = ++afr_ZIndex;
		this.style.visibility = (on) ? "visible" : "hidden";
	}
	if (afr_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 afr_f_KeepInWindow() {
	var ExtraSpace     = (afr_IE||afr_IsSafari) ? 0 : afr_WindowPadding;
	var WindowLeftEdge = (afr_IE) ? afr_Canvas.scrollLeft   : afr_MenusTarget.pageXOffset;
	var WindowTopEdge  = (afr_IE) ? afr_Canvas.scrollTop    : afr_MenusTarget.pageYOffset;
	var WindowWidth    = (afr_IE) ? afr_Canvas.clientWidth  : afr_MenusTarget.innerWidth;
	var WindowHeight   = (afr_IE) ? afr_Canvas.clientHeight : afr_MenusTarget.innerHeight;

	var WindowRightEdge  = (WindowLeftEdge + WindowWidth) - ExtraSpace;
	var WindowBottomEdge = (WindowTopEdge + WindowHeight) - ExtraSpace;
	var MenuLeftEdge = this.xPos;
	var MenuRightEdge = MenuLeftEdge + this.offsetWidth;

	if(this.yPos < WindowTopEdge) this.yPos = WindowTopEdge; 

	var MenuBottomEdge = this.yPos + parseInt(this.origHeight);
	MenuBottomEdge += (afr_IEnoDTD || afr_OperaQuirk) ? 0 : (afr_BorderWidth * 2);
	if (this.hasParent) {
		var ParentLeftEdge = this.parentItem.oL;
	}
	if (MenuRightEdge > WindowRightEdge) {
		if (this.hasParent) {
			this.xPos = ((ParentLeftEdge - this.parentItem.DistanceToLeftEdge) + this.parentItem.ChildOverlap) - this.offsetWidth;
		}
		else {
			var dif = MenuRightEdge - WindowRightEdge;
			this.xPos -= dif;
		}
		this.xPos = Math.max(0,this.xPos);
	}

	if (MenuBottomEdge > WindowBottomEdge) {
		var dif = MenuBottomEdge - WindowBottomEdge;
		this.yPos -= dif;
	}

	if (MenuLeftEdge < WindowLeftEdge) {
		if (this.hasParent) {
			this.xPos = (ParentLeftEdge + this.parentItem.DistanceToRightEdge) - this.parentItem.ChildOverlap;
			MenuRightEdge = this.xPos + this.offsetWidth;
			if(MenuRightEdge > WindowRightEdge) this.xPos -= (MenuRightEdge - WindowRightEdge);
		}
		else {this.xPos = 0}
	}
	if(afr_ScrollEnabled) {
		if(this.yPos < WindowTopEdge) {
			this.enableScrolling(WindowTopEdge);
		}
		else if(this.scrollbarsCreated){
			if(!afr_IE5W){
				if(parseInt(this.origHeight) < WindowHeight) this.style.height = this.origHeight;
			}
			this.checkScroll();
		}
	}
}

function afr_f_LinkIt() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
	else {
		afr_f_HideAll();
		if ((!afr_Opera)||(afr_MenusTarget.location.href != this.linkText)) {
			afr_MenusTarget.location.href = this.linkText;
		}
	}
}

function afr_menuDown(menuname){
	if (!afr_AreLoaded || !afr_AreCreated) return;
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	menuname = menuname.replace("amenu",afr_MenuIDPrefix);
	var MenuToHide = afr_MenusTarget.document.getElementById(menuname);
	if(!MenuToHide)return;
	if(afr_UserOverMenu&&(afr_CurrentMenu==MenuToHide)) return;
	MenuToHide.isOn = false;
	if (!afr_ClickKill) MenuToHide.hideTop();
}

function afr_f_HideAll(callingmenu) {
	clearTimeout(afr_HideAllTimer);
	afr_HideAllTimer = null;
	if(afr_Opera) afr_f_ResetTopMenus();
	for(var i=0; i<afr_TotalTrees; i++) {
		var TopMenu = afr_a_TopMenus[i].tree.startChild;
		if(TopMenu == callingmenu)continue;
		TopMenu.isOn = false;
		if (TopMenu.hasChildVisible) TopMenu.hideChildren();
		TopMenu.showIt(false);
	}    
}

function afr_f_HideTree() { 
	afr_HideAllTimer = null;
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if(afr_UserOverMenu) return;
	if(this.hasChildVisible) this.hideChildren();
	this.hideParents();
}

function afr_f_HideTop() {
	var TimeoutCommand = "var afr_TopMenuToHide = afr_f_GetMenu('" + this.id + "'); if (afr_TopMenuToHide && afr_TopMenuToHide.hideSelf) afr_TopMenuToHide.hideSelf()";
	(afr_ClickKill) ? this.hideSelf() : (this.hideTimer = setTimeout(TimeoutCommand,afr_TopMilliSecondsVisible));
}

function afr_f_HideSelf() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	this.hideTimer = null;
	if (!this.isOn && !afr_UserOverMenu) this.showIt(false);
}

function afr_f_HideParents() {
	var TempMenu = this;
	while(TempMenu.hasParent) {
		TempMenu.showIt(false);
		TempMenu.parentMenu.isOn = false;        
		TempMenu = TempMenu.parentMenu;
	}
	TempMenu.hideTop();
}

function afr_f_HideChildren(callingitem,forced) {
	var TempMenu = this.visibleChild;
	while(TempMenu.hasChildVisible) {
		TempMenu.visibleChild.showIt(false);
		TempMenu.hasChildVisible = false;
		TempMenu = TempMenu.visibleChild;
	}
	if(forced || ((callingitem && (!callingitem.hasMore || this.visibleChild != callingitem.child)) || (!callingitem && !this.isOn))) {
		this.visibleChild.showIt(false);
		this.hasChildVisible = false;
	}
}

function afr_f_CancelSelect(){return false}

function afr_f_PageClick() {
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if (!afr_UserOverMenu && afr_CurrentMenu!=null && !afr_CurrentMenu.isOn) afr_f_HideAll();
}

function afr_f_EnableScrolling(topedge){
	var ExtraSpace = (afr_IE||afr_IsSafari) ? 0 : afr_WindowPadding;
	if (!afr_FramesEnabled || afr_FramesNavFramePos != "top") {
		this.yPos = (topedge + ExtraSpace);
		var edgesOffset = (ExtraSpace * 2);
	} 
	else {
		this.yPos = topedge;
		var edgesOffset = ExtraSpace;
	}
	var WindowHeight = (afr_IE) ? afr_Canvas.clientHeight : afr_MenusTarget.innerHeight;
	var BorderHeightAdjust=(afr_IEnoDTD || afr_OperaQuirk) ? 0 : (afr_BorderWidth * 2);
	this.style.height = (Math.max(WindowHeight,((afr_ScrollBarHeight*2)+afr_ScrollHeightMin)) - edgesOffset - BorderHeightAdjust) + "px";
	if(!this.scrollbarsCreated) this.createScrollbars();
	this.checkScroll();
}

function afr_f_CreateScrollbars(){
	var TopScrollElement = afr_MenusTarget.document.createElement("DIV");

	with(TopScrollElement.style){
		position = "absolute";
		top = -(afr_BorderWidth) + "px";
		width = (parseInt(this.style.width) - ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth * 2) : 0)) + "px";
		height = (afr_ScrollBarHeight - ((afr_IEnoDTD || afr_OperaQuirk) ? 0 : (afr_BorderWidth * 2))) + "px";
		visibility = "hidden";
		backgroundColor = afr_ScrollBarColor;
		textAlign = "center";
		zIndex = 10000;
		var BorderString = (afr_BorderWidth + "px " + this.tree.BorderColor + " " + afr_BorderStyle);
		borderBottom = BorderString;
		borderTop = BorderString;
	}

	var ImageElement = afr_MenusTarget.document.createElement("IMG");
	with(ImageElement.style){
		position = "absolute";
		top = ((afr_ScrollBarHeight - (afr_BorderWidth * 2) - afr_ScrollImgHeight)/2) + "px";
		visibility = "inherit";
		left = ((parseInt(TopScrollElement.style.width) - afr_ScrollImgWidth)/2)+"px";
	}
	TopScrollElement.appendChild(ImageElement);
	var BottomScrollElement = TopScrollElement.cloneNode(true);
	if(afr_ScrollImgSrcBot) BottomScrollElement.firstChild.src = afr_ScrollImgSrcBot;
	if(afr_ScrollImgSrcTop) TopScrollElement.firstChild.src = afr_ScrollImgSrcTop;

	this.appendChild(TopScrollElement);
	this.appendChild(BottomScrollElement);

	TopScrollElement.menu = this;
	this.scrollbarTop = TopScrollElement;
	this.scrollbarTop.onmousedown = function(){afr_CurrentMenu=this.menu;return this.menu.startScroll(true)};

	BottomScrollElement.menu = this;
	this.scrollbarBot = BottomScrollElement;
	this.scrollbarBot.onmousedown = function(){afr_CurrentMenu=this.menu;return this.menu.startScroll(false)};

	this.scrollbarsCreated = true;
}

function afr_f_StartScroll(up){
	afr_f_StopScroll();
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	if (this.hasChildVisible) this.hideChildren(false,true);
	afr_MenusTarget.document.onmouseup = afr_f_StopScroll;
	afr_ScrollTimer = setInterval("afr_f_DoScroll(" + up + ",10)",20);
	return false;
}

function afr_f_StopScroll(){
	clearInterval(afr_ScrollTimer);
	afr_ScrollTimer=null;
}

function afr_f_DoScroll(up,incr){
	if(afr_IsReloading||!afr_f_DocumentCheck()) {afr_f_StopScroll(); return;}
	var ScrollEl = afr_CurrentMenu.scrollParent;
	if(up){
		ScrollEl.top += incr;
	}
	else{
		ScrollEl.top -= incr;
	}
	afr_CurrentMenu.checkScroll();
}

function afr_f_CheckScroll(){
	var ScrollEl = this.scrollParent;
	var MenuHeight = parseInt(this.style.height);
	var ScrollHeight = parseInt(ScrollEl.style.height);
	var HeightDiff = MenuHeight - ScrollHeight;
	var ScrollTopOffset = afr_ScrollBothBars ? (afr_ScrollBarHeight - afr_BorderWidth) : 0;

	if(!HeightDiff){
		this.scrollbarBot.style.visibility = "hidden";
		this.scrollbarTop.style.visibility = "hidden";
		this.scrollbarsVisible = false;
		ScrollEl.top = 0;
		ScrollEl.style.top = ScrollEl.top +  "px";
		return;
	}
	if(afr_ScrollBothBars) HeightDiff -= (ScrollTopOffset*2);
	if(ScrollEl.top <= (HeightDiff)) {
		ScrollEl.top = HeightDiff;
		afr_f_StopScroll();
		this.scrollbarBot.style.top = (MenuHeight - ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth) : -(afr_BorderWidth)) - afr_ScrollBarHeight) + "px";
		if(!afr_ScrollBothBars) this.scrollbarBot.style.visibility = "hidden";
	}
	else {
		this.scrollbarBot.style.top = (MenuHeight - ((afr_IEnoDTD || afr_OperaQuirk) ? (afr_BorderWidth) : -(afr_BorderWidth)) - afr_ScrollBarHeight) + "px";
		this.scrollbarBot.style.visibility = "inherit";
		if(afr_ScrollBothBars){
			this.scrollbarTop.style.visibility = "inherit";
			this.scrollbarsVisible = true;
		}
	}
	if(ScrollEl.top >= 0) {
		ScrollEl.top = 0;
		afr_f_StopScroll();
		if(!afr_ScrollBothBars) this.scrollbarTop.style.visibility = "hidden";
	}
	else {
		this.scrollbarTop.style.visibility = "inherit";
		if(afr_ScrollBothBars){
			this.scrollbarBot.style.visibility = "inherit";
			this.scrollbarsVisible = true;
		}
	}
	ScrollEl.style.top = (ScrollEl.top + ScrollTopOffset) + "px";
}

function afr_f_DoWheelScroll(){
	if(!this.scrollbarsCreated) return;
	var ScrollUp = (afr_MenusTarget.event.wheelDelta == 120);
	afr_f_DoScroll(ScrollUp,this.currentItem.offsetHeight);
	return false;
}

function afr_f_PermissionDenied(e){
	if(afr_IE){
		var ErrorMessage = e.description;
	} else {
		var ErrorMessage = (afr_IsEarlyGecko) ? "Access Denied" :
                                   (typeof(e)=="object") ? e.message : e;
	}
	var AccessErrorFound = false;
	for (var i=0; i<afr_a_AccessErrors.length; i++) {
		if (ErrorMessage.toLowerCase().indexOf(afr_a_AccessErrors[i])!=-1) {
			AccessErrorFound = true;
			break;
		}
	}
	return AccessErrorFound;
}

function afr_f_ResizeHandler(){
	if(afr_IsReloading||!afr_f_DocumentCheck()) return;
	var mouse_x_position, mouse_y_position;
	if(afr_Opera) afr_f_ResetTopMenus();
	for(var i=0; i<afr_TotalTrees; i++) {
		var TopMenu = afr_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) {
				if(TopMenu.scrollbarsCreated) TopMenu.checkScroll();
				TopMenu.style.height = TopMenu.scrollParent.style.height;
				TopMenu.keepInWindow();
			}

			TopMenu.moveTo(TopMenu.xPos,TopMenu.yPos);
			var TempMenu = TopMenu;
			while(TempMenu.hasChildVisible) {
				TempParent = TempMenu;
				TempMenu = TempMenu.visibleChild;
				TempItem = TempMenu.parentItem;
				TempItem.showChild();
			}
		}
	}
	return afr_f_OtherResize();
}

function afr_f_NavUnloadHandler(){
	afr_NavUnloaded = true;
	afr_IsReloading = true;
	clearTimeout(afr_ReloadTimer);
	afr_ReloadTimer = null;
	afr_f_ClearElements();
	return afr_f_NavOtherOnUnload();
}

function afr_f_MainUnloadHandler(){
	afr_IsReloading = true;
	if(!afr_Opera) afr_f_InitVars();
	afr_f_MainOtherOnUnload();
	if(afr_NavUnloaded) return;
	if(!afr_FrameHasLoadHandler) {
		if(afr_IE||afr_Opera) afr_f_IEMainUnloadHandler();
		else afr_f_NSMainUnloadHandler();
	}
}

function afr_f_IEMainUnloadHandler() {
	clearTimeout(afr_ReloadTimer);
	afr_ReloadTimer = null;
	afr_ReloadTimer = setTimeout("afr_f_IEKeepTrack()",afr_ReloadInterval);
}

function afr_f_NSMainUnloadHandler(){
	clearTimeout(afr_ReloadTimer);
	afr_ReloadTimer = null;
	afr_ReloadTimer = setTimeout("afr_f_NSKeepTrack()",afr_ReloadInterval);
}

function afr_f_MenuExists(menuid) {
	if (!menuid) return false;
	try{
		if ((afr_MenusTarget) &&
		    (afr_MenusTarget.document) &&
		    (afr_MenusTarget.document.getElementByID)) {
			return (afr_MenusTarget.document.getElementByID(menuid)) ? true : false;
		}
	}
	catch(e){
		if(afr_f_PermissionDenied(e)) return false;
	}
}

function afr_f_NSKeepTrack() {
        if(afr_NavUnloaded) return true;
	try{
		if ((typeof(afr_MenusTarget.document) != "object") ||
		    (afr_f_MenuExists(afr_LastMenuID))) {
			clearTimeout(afr_ReloadTimer);
			afr_ReloadTimer = null;
			afr_ReloadTimer = setTimeout("afr_f_NSKeepTrack()",afr_ReloadInterval);
		}
		else {
			var TargetDocumentBody = afr_MenusTarget.document.body;
			afr_f_FrameLoad();
		}
	}
	catch(e){
		afr_IsReloading = false;
		if(afr_f_PermissionDenied(e)) return true;
	}
}

function afr_f_IEKeepTrack() {
        if(afr_NavUnloaded) return true;
	try{var typeOfDocumentBody = typeof(afr_MenusTarget.document)}
	catch(e){
		afr_IsReloading = false;
		if(afr_f_PermissionDenied(e)) return true;
	}
	if (typeof(afr_MenusTarget.document) != "unknown") {
		if ((afr_MenusTarget.document.readyState != "complete") ||
		    (afr_f_MenuExists(afr_LastMenuID))) {
			clearTimeout(afr_ReloadTimer);
			afr_ReloadTimer = null;
			afr_ReloadTimer = setTimeout("afr_f_IEKeepTrack()",afr_ReloadInterval);
		}
		else afr_f_FrameLoad();
	} else afr_IsReloading = false;
}

afr_LoadElement = (afr_FramesEnabled) ? (afr_NS6) ? parent : parent.document.body : window;
afr_f_OtherOnLoad = (afr_LoadElement.onload) ? afr_LoadElement.onload : function() {return true;};
afr_LoadElement.onload = function(){setTimeout("afr_f_FrameLoad()",10)};

if(!afr_Opera) {
	afr_f_NavOtherOnUnload = (window.onunload) ? window.onunload : function() {return true;};
	window.onunload = afr_f_NavUnloadHandler;
}

popUp = afr_menuUp;
popDown = afr_menuDown;

//end
