<!--
var DXSavedOnLoad = window.onload;
loader = window;
loader.onload = startIt;

isLoaded = false;
NSresized = false;

isWin = (navigator.appVersion.indexOf("Win") != -1)
if (!isWin && !isMac) NSfontOver = showVisited = false;

mSecsVis = secondsVisible*1000;
//isRight = (window.navFrLoc && navFrLoc == "right");
isRight = false;

imgSuf = (isRight) ? ">"  : "ALIGN=RIGHT>";

imgStr = "<IMG SRC='" + imgSrc + "' WIDTH=" + imgSiz + " HEIGHT=" + imgSiz +" BORDER=0 VSPACE=2 " + imgSuf;
spStr = (isRight) ? "<SPACER TYPE=HORIZONTAL SIZE="+imgSiz+">" : "";

areCreated = false;
menuLoc = null;

// DX
var offset_left=0, offset_top=0;

function initVars() {
	if(areCreated) {
		for(i=1; i<topCount; i++) {
			cur = document.getElementById("elMenu"+i);
			clearTimeout(cur.hideTimer);
			cur.hideTimer=null;
		}
		clearTimeout(allTimer);
	}
	topCount = 1;
	areCreated = false;
	beingCreated = false;
	isOverMenu = false;
	currentMenu = null;
	allTimer = null;
}

initVars();

function NSunloaded(){
	isLoaded = false;
}

function NSloaded(e){
	if (e.target.name == mainFrName) {
		initVars();
		startIt();
	}
}

function IEunloaded() {
	initVars();
	isLoaded = false;
	setTimeout("keepTrack()",50)
}

function keepTrack() {
	if (menuLoc.document.readyState == "complete") {
		initVars();
		startIt();
	}
	else {
		setTimeout("keepTrack()",50);
	}
}

function startIt() {
	isLoaded = true;
	menuLoc = window;
	menuLoc.nav = nav = window;
	makeTop();
	if(DXSavedOnLoad)DXSavedOnLoad();
}

function makeTop(){
	beingCreated = true;
	while(eval("window.arMenu" + topCount)) {
		makeMenu(false,topCount);
		topCount++
	}
	areCreated = true;
	beingCreated = false;
}

function makeMenu(isChild,menuCount,parMenu,parItem) {
	menumm = makeElement("elMenu" + menuCount);
	menumm.array = eval("arMenu" + menuCount);

	menumm.setMenuTree = setMenuTree;
	menumm.setMenuTree(isChild,parMenu);
	menumm.itemStr = "";
	
	while (menumm.itemCount < menumm.maxItems) {
		menumm.itemCount++;
		itemName = "item" + menuCount + "_" + menumm.itemCount;

		arrayPointer = (isChild) ? (menumm.itemCount-1)*3 :((menumm.itemCount-1)*3)+9;
		dispText = menumm.array[arrayPointer];
		hasMore = menumm.array[arrayPointer + 2];
		htmStr = (hasMore) ? imgStr + dispText : dispText;
		w=menumm.menuWidth;
		if(NN)w=menumm.menuWidth-itemPad*2;
		menumm.itemStr += "<DIV ID=" + itemName + " style=\"width: "+w+";cursor: pointer; cursor: hand;zIndex: 2000\">" + htmStr + "</DIV>";

		if (hasMore) {
			makeMenu(true,menuCount + "_" + menumm.itemCount,menumm);
			menumm = menumm.parentMenu;
		}	
	}

	menumm.innerHTML = menumm.itemStr;

	itemColl = menumm.getElementsByTagName("DIV");
	for (i=0; i<itemColl.length; i++) {
		it = itemColl.item(i);
		it.setup = itemSetup;
		it.setup(i+1,menumm.array);
	}

	menumm.lastItem = itemColl.item(itemColl.length-1);
	menumm.setup(isChild,parMenu);
}

function setMenuTree(isChild,parMenu) {
	if (!isChild) {
		this.menuWidth = this.array[0] ? this.array[0] : menuWidth;
		this.menuLeft = this.array[1];
		this.menuTop = this.array[2];
		this.menuFontColor = this.array[3] ? this.array[3] : fntCol;
		this.menuFontOver = this.array[4] ? this.array[4] : overFnt;
		this.menuBGColor = this.array[5] ? this.array[5] : backCol;
		this.menuBGOver = this.array[6] ? this.array[6] : overCol;
		this.menuBorCol = this.array[7] ? this.array[7] : borCol;
		this.menuSeparatorCol = this.array[8] ? this.array[8] : separatorCol;
		this.treeParent = this;
		this.startChild = this;
	}
	else {
		this.menuWidth = parMenu.menuWidth;
		this.menuLeft = parMenu.menuLeft;
		this.menuTop = parMenu.menuTop;
		this.menuFontColor = parMenu.menuFontColor;
		this.menuFontOver = parMenu.menuFontOver;
		this.menuBGColor = parMenu.menuBGColor;
		this.menuBGOver = parMenu.menuBGOver;
		this.menuBorCol = parMenu.menuBorCol;
		this.menuSeparatorCol = parMenu.menuSeparatorCol;
		this.treeParent = parMenu.treeParent;
	}

	this.maxItems = (isChild) ? this.array.length/3 : (this.array.length-9)/3;
	this.hasParent = isChild;
    this.setup = menuSetup;
	this.itemCount = 0;
}

function makeElement(whichEl,whichWidth,whichParent,whichContainer) {
	el=document.createElement("DIV");
	with(el){
		id=whichEl;
		style.position="absolute";
		style.visibility="hidden";
		style.zIndex="2000";
	}
	document.body.appendChild(el);
	return el;
}

function itemSetup(whichItem,whichArray) {
	this.onmouseover = itemOver;
	this.onmouseout = itemOut;
	this.container =  this.parentNode;

	arrayPointer = (this.container.hasParent) ? (whichItem-1)*3 : ((whichItem-1)*3)+9;

	this.dispText = whichArray[arrayPointer];
	this.linkText = whichArray[arrayPointer + 1];
	this.hasMore = whichArray[arrayPointer + 2];

	if (this.hasMore) {
		this.child = document.getElementById("elMenu" + this.id.substr(4));
		this.child.parentMenu = this.container;
		this.child.parentItem = this;
	}

	if (this.linkText) {
		this.onclick = linkIt;
	}

	with (this.style) {
		padding = itemPad;
		if (isRight && !this.hasMore) paddingLeft = parseInt(padding)+imgSiz;
		color = this.container.menuFontColor;
		fontSize = fntSiz + "px";
		fontWeight = (fntBold) ? "bold" : "normal";
		fontStyle =	(fntItal) ? "italic" : "normal";
		fontFamily = fntFam;
		zIndex = 2000;
	

		borderBottomWidth = separator + "px";
		borderBottomColor = this.container.menuSeparatorCol;
		borderBottomStyle = "solid";
		backgroundColor = this.container.menuBGColor;

	}
}	

function menuSetup(hasParent,openCont,openItem) {
	this.onmouseover = menuOver;
	this.onmouseout = menuOut;
	
	this.showIt = showIt;
	this.keepInWindow = keepInWindow2;
	this.hideTree = hideTree
	this.hideParents = hideParents;
	this.hideChildren = hideChildren;
	this.hideTop = hideTop;
	this.hasChildVisible = false;
	this.isOn = false;
	this.hideTimer = null;

	this.childOverlap = (perCentOver != null) ? ((perCentOver/100) * this.menuWidth) : childOverlap;
	this.currentItem = null;
	this.hideSelf = hideSelf;
		
	if (hasParent) {
		this.hasParent = true;
		this.parentMenu = openCont;
	}
	else {
		this.hasParent = false;
	}

	with (this.style) {
		width = this.menuWidth;
		borderWidth = borWid;
		borderColor = this.menuBorCol;
		borderStyle = borSty;
	}

	this.lastItem.style.borderWidth=0;
	this.fullHeight = this.scrollHeight;
	this.showIt(false);
	this.onselectstart = cancelSelect;
	this.moveTo = moveTo;
	this.moveTo(0,0);
}

function popUp(menuName,menu_el,e){
	if (!isLoaded) return;
	find_pos(menu_el);
	linkEl = (NN) ? e.target : event.srcElement;
	if (!beingCreated && !areCreated) startIt();
	linkEl.menuName = menuName;	
	popMenu(e);
}

function popMenu(e){
	if (!isLoaded || !areCreated) return true;

	eType = (NN) ? e.type : event.type;
	hideAll();

	linkEl = (NN) ? e.target : event.srcElement;
	
	currentMenu = document.getElementById(linkEl.menuName);
	currentMenu.hasParent = false;
	currentMenu.treeParent.startChild = currentMenu;
	
//	xPos = offset_left-currentMenu.menuWidth+1;
	xPos = offset_left-10;
	yPos = currentMenu.menuTop+offset_top-1;

	// adjusting first menu
	if(currentMenu.id=="elMenu1")
		xPos-=14;
/*
	currentMenu.moveTo(xPos,yPos);
	currentMenu.keepInWindow();
*/
	currentMenu.keepInWindow(xPos,yPos);
	currentMenu.moveTo(parseInt(xPos),parseInt(currentMenu.style.top));
	
	
	currentMenu.isOn = true;
	currentMenu.showIt(true);

	return false;
}

function menuOver(e) {
	this.isOn = true;
	isOverMenu = true;
	currentMenu = this;
	if (this.hideTimer) clearTimeout(this.hideTimer);
}

function menuOut() {
	if (IE) {
		theEvent = menuLoc.event;
		if (theEvent.srcElement.contains(theEvent.toElement)) return;
	}
	this.isOn = false;
	isOverMenu = false;

	menuLoc.status = "";
	if (!clickKill) allTimer = setTimeout("currentMenu.hideTree()",10);  
}

function itemOver(){
	if (keepHilite) {
		if (this.container.currentItem && this.container.currentItem != this) {
			this.container.currentItem.style.backgroundColor=this.container.menuBGColor;
			this.container.currentItem.innerHTML=this.container.currentItem.htmStr;
			this.container.currentItem.color=this.container.menuFontColor;
		}
	}

	this.style.backgroundColor=this.container.menuBGOver;
	this.style.color=this.container.menuFontOver;

	menuLoc.status = this.linkText;

	this.container.currentItem = this;

	if (this.container.hasChildVisible) {
		this.container.hideChildren(this);
	}

	if (this.hasMore) {
		horOffset = (isRight) ? (this.container.childOverlap - this.container.menuWidth) : (this.container.menuWidth - this.container.childOverlap);
		horOffset+=itemPad-1;
		
		this.childX = parseInt(this.container.style.left) + this.container.menuWidth+1;// + horOffset;
		this.childY = parseInt(this.container.offsetTop) + childOffset + this.offsetTop;

//		this.child.keepInWindow();
//		this.child.moveTo(this.childX,this.childY);

		this.child.keepInWindow(this.childX,this.childY);
		this.child.moveTo(parseInt(this.child.style.left),parseInt(this.child.style.top));

		this.container.hasChildVisible = true;
		this.container.visibleChild = this.child;
		this.child.showIt(true);
	}
}

function itemOut() {
	if(!keepHilite){
		this.style.backgroundColor=this.container.menuBGColor;
		this.style.color=this.container.menuFontColor;
	}
	if (!isOverMenu && !clickKill)
		allTimer = setTimeout("currentMenu.hideTree()",10); 
}

function moveTo(xPos,yPos) {
	this.style.left = xPos;
	this.style.top = yPos;
}

function showIt(on) {
	this.style.visibility=(on) ? "visible" : "hidden";
	
	if (keepHilite && this.currentItem){
		this.currentItem.style.backgroundColor=this.menuBGColor;
		this.currentItem.style.color=this.menuFontColor;
	}
	this.currentItem = null;
}

function keepInWindow() {
	scrBars = 20;
	botScrBar = (isFrames && navFrLoc=="bottom") ? (borWid*2) : scrBars;
	rtScrBar = (isFrames && navFrLoc=="right") ? (borWid*2) : scrBars;

	winWidth=menuLoc.document.body.clientWidth;
	if(!winWidth)
		winWidth=document.getElementsByTagName('body')[0].offsetWidth;
	scrollLeft=menuLoc.document.body.scrollLeft;
	if(!scrollLeft)
		scrollLeft=0;
	
   	winRight = (scrollLeft + winWidth) - rtScrBar;
	rightPos = parseInt(this.style.left) + this.menuWidth;
		
	if (rightPos > winRight) {
		if (this.hasParent) {
			parentLeft = parseInt(this.parentMenu.style.left);
			newLeft = ((parentLeft - this.menuWidth) + this.childOverlap);
			newLeft-=itemPad-1;
			this.style.left = newLeft;
		}
		else {
			dif = rightPos - winRight;
			this.style.left = parseInt(this.style.left)-dif;
		}
	}
	
	scrollTop = menuLoc.document.body.scrollTop;
	if(!scrollTop)
		scrollTop=0;
	winHeight=menuLoc.document.body.clientHeight;
	if(!winHeight)
		winHeight=menuLoc.document.body.clientHeight;
	winBot = (scrollTop + winHeight) - botScrBar;
	botPos = parseInt(this.style.top) + this.fullHeight;

	if (botPos > winBot) {
		dif = botPos - winBot;
		this.style.top = parseInt(this.style.top)-dif;
	}
		
	winLeft = menuLoc.document.body.scrollLeft;
	leftPos = parseInt(this.style.left);

	if (leftPos < winLeft) {
		if (this.hasParent) {
			parentLeft = parseInt(this.parentMenu.style.left);
			newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
			this.style.left = newLeft;
		}
		else {
			this.style.left = 5;
		}
	}
}

function keepInWindow2(x,y) {
	scrBars = 20;
	botScrBar = (isFrames && navFrLoc=="bottom") ? (borWid*2) : scrBars;
	rtScrBar = (isFrames && navFrLoc=="right") ? (borWid*2) : scrBars;

	winWidth=menuLoc.document.body.clientWidth;
	if(!winWidth)
		winWidth=document.getElementsByTagName('body')[0].offsetWidth;
	scrollLeft=menuLoc.document.body.scrollLeft;
	if(!scrollLeft)
		scrollLeft=0;
	
   	winRight = (scrollLeft + winWidth) - rtScrBar;
	rightPos = x + this.menuWidth;

	if (rightPos > winRight) {
		if (this.hasParent) {
			parentLeft = parseInt(this.parentMenu.style.left);
			newLeft = ((parentLeft - this.menuWidth) + this.childOverlap);
			newLeft-=itemPad-1;
			this.style.left = newLeft;
		}
		else {
			dif = rightPos - winRight;
			this.style.left = x-dif;
		}
	}
	else
		this.style.left = x;
	
	scrollTop = menuLoc.document.body.scrollTop;
	if(!scrollTop)
		scrollTop=0;
	winHeight=menuLoc.document.body.clientHeight;
	if(!winHeight)
		winHeight=menuLoc.document.body.clientHeight;
	winBot = (scrollTop + winHeight) - botScrBar;
	botPos = y + this.fullHeight;

	if (botPos > winBot) {
		dif = botPos - winBot;
		this.style.top = y-dif;
	}else
		this.style.top=y;
		
	winLeft = menuLoc.document.body.scrollLeft;
	leftPos = x;

	if (leftPos < winLeft) {
		if (this.hasParent) {
			parentLeft = parseInt(this.parentMenu.style.left);
			newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
			this.style.left = newLeft+2;
		}
		else {
			this.style.left = 5;
		}
	}
}

function linkIt() {
//3.07 added colon (:)
	if (this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
	else menuLoc.location.href = this.linkText;
}

function popDown(menuName){
	if (!isLoaded || !areCreated) return;
	whichEl = document.getElementById(menuName);
	whichEl.isOn = false;
	whichEl.hideTop();
}

function hideAll() {
	for(i=1;i<topCount; i++) {
		temp = document.getElementById("elMenu"+i);
		with(temp.startChild){
			isOn = false;
			if (hasChildVisible) hideChildren();
			showIt(false);
//			moveTo(0,0);
		}
	}	
}

function hideAll2() {
	for(i=1;i<topCount; i++) {
		temp = document.getElementById("elMenu"+i);
		with(temp.startChild){
			isOn = false;
			if (hasChildVisible) hideChildren();
			showIt(false);
			moveTo(0,0);
		}
	}	
}

function hideTree() { 
	allTimer = null;
	if (isOverMenu) return;
	if (this.hasChildVisible) {
		this.hideChildren();
	}
	this.hideParents();
}

//3.07 added check for existence of hideSelf() method:
function hideTop() {
	whichTop = this;
	this.hideTimer = setTimeout("if(whichTop.hideSelf)whichTop.hideSelf()",mSecsVis);
}

function hideSelf() {
	this.hideTimer = null;
	if (!this.isOn && !isOverMenu) { 
		this.showIt(false);
//		this.moveTo(0,0);
	}
}

function hideParents() {
	tempMenu = this;
	while (tempMenu.hasParent) {
		tempMenu.showIt(false);
		tempMenu.moveTo(0,0);
		tempMenu.parentMenu.isOn = false;		
		tempMenu = tempMenu.parentMenu;
	}
	tempMenu.hideTop();
}

function hideChildren(item) {
	tempMenu = this.visibleChild;
	while (tempMenu.hasChildVisible) {
		tempMenu.visibleChild.showIt(false);
//		tempMenu.visibleChild.moveTo(0,0);
		tempMenu.hasChildVisible = false;
		tempMenu = tempMenu.visibleChild;
	}

	if (!this.isOn || !item.hasMore || this.visibleChild != this.child) {
		this.visibleChild.showIt(false);
		this.hasChildVisible = false;
//		this.visibleChild.moveTo(0,0);
	}
}

function cancelSelect(){return false}

function reDo(){
	if (loader.innerWidth==origWidth && loader.innerHeight==origHeight) return;
	initVars();
	NSresized=true;
	menuLoc.location.reload();
}

function clicked() {
	if (!isOverMenu && currentMenu!=null && !currentMenu.isOn) {
		whichEl = currentMenu;
		whichEl.hideTree();
	}
}

//window.onerror = handleErr;
window.onresize = hideAll2;

function handleErr(){
	arAccessErrors = ["permission","access"];
	mess = arguments[0].toLowerCase();
	found = false;
	for (i=0;i<arAccessErrors.length;i++) {
		errStr = arAccessErrors[i];
		if (mess.indexOf(errStr)!=-1) found = true;
	}
	return found;
}

// DX
function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
//		curleft = obj.offsetWidth+7;
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x+obj.width;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	var printstring = '';
	curtop = obj.parentNode.offsetHeight;
	if (obj.offsetParent)
	{
		if(OP)
			curtop+=itemPad*2;
		while (obj.offsetParent)
		{
			printstring += ' element ' + obj.tagName + ' has ' + obj.offsetTop;
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}


function find_pos(el){
	offset_left=findPosX(el);
	offset_top=findPosY(el);
}
//-->