/**
 * fw_link 24OCT2000 Version 4.0
 * John Ahlquist, October 2000
 * Copyright (c) 2000 Macromedia, Inc.
 *
 * based on link.js
 * by gary smith, July 1997
 * Copyright (c) 1997-1999 Netscape Communications Corp.
 *
 * Netscape grants you a royalty free license to use or modify this
 * software provided that this copyright notice appears on all copies.
 * This software is provided "AS IS," without a warranty of any kind.
 */
function link(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh) {
	this.version = "990702 [link; link.js]";
	this.type = "link";
	this.linkWidth = mw;
	this.linkItemHeight = mh;
	this.fontSize = fs||12;
	this.fontWeight = "plain";
	this.fontFamily = fnt||"verdana,arial,helvetica,sans-serif";
	this.fontColor = fclr||"#000000";
	this.fontColorHilite = fhclr||"#ffffff";
	this.bgColor = "#555555";
	this.linkBorder = 1;
	this.linkItemBorder = 1;
	this.linkItemBgColor = bg||"#cccccc";
	this.linkLiteBgColor = "#ffffff";
	this.linkBorderBgColor = "#83949c";
	this.linkHiliteBgColor = bgh||"#000084";
	this.linkContainerBgColor = "#cccccc";
	this.childlinkIcon = "/images/bullet_submenu.gif";
	this.items = new Array();
	this.actions = new Array();
	this.childlinks = new Array();

	this.hideOnMouseOut = true;

	this.addlinkItem = addlinkItem;
	this.addlinkSeparator = addlinkSeparator;
	this.writelinks = writelinks;
	this.FW_showlink = FW_showlink;
	this.onlinkItemOver = onlinkItemOver;
	this.onlinkItemAction = onlinkItemAction;
	this.hidelink = hidelink;
	this.hideChildlink = hideChildlink;

	if (!window.links) window.links = new Array();
	this.label = label || "linkLabel" + window.links.length;
	window.links[this.label] = this;
	window.links[window.links.length] = this;
	if (!window.activelinks) window.activelinks = new Array();
}

function addlinkItem(label, action) {
	this.items[this.items.length] = label;
	this.actions[this.actions.length] = action;
}

function addlinkSeparator() {
	this.items[this.items.length] = "separator";
	this.actions[this.actions.length] = "";
	this.linkItemBorder = 0;
}

// For NS6. 
function FIND(item) {
	if (document.all) return(document.all[item]);
	if (document.getElementById) return(document.getElementById(item));
	return(false);
}

function writelinks(container) {
	if (window.triedToWritelinks) return;

	if (!container && document.layers) {
		window.delayWritelinks = this.writelinks;
		var timer = setTimeout('delayWritelinks()', 250);
		container = new Layer(100);
		clearTimeout(timer);
	} else if (document.all || document.hasChildNodes) {
		document.writeln('<SPAN ID="linkContainer"></SPAN>');
		container = FIND("linkContainer");
	}

	window.fwHidelinkTimer = null;
	if (!container) return;	
	window.triedToWritelinks = true; 
	container.isContainer = true;
	container.links = new Array();
	for (var i=0; i<window.links.length; i++) 
		container.links[i] = window.links[i];
	window.links.length = 0;
	var countlinks = 0;
	var countItems = 0;
	var top = 0;
	var content = '';
	var lrs = false;
	var theStat = "";
	var tsc = 0;
	if (document.layers) lrs = true;
	for (var i=0; i<container.links.length; i++, countlinks++) {
		var link = container.links[i];
		if (link.bgImageUp) {
			link.linkBorder = 0;
			link.linkItemBorder = 0;
		}
		if (lrs) {
			var linkLayer = new Layer(100, container);
			var lite = new Layer(100, linkLayer);
			lite.top = link.linkBorder;
			lite.left = link.linkBorder;
			var body = new Layer(100, lite);
			body.top = link.linkBorder;
			body.left = link.linkBorder;
		} else {
			content += ''+
			'<DIV ID="linkLayer'+ countlinks +'" STYLE="position:absolute;z-index:1;left:10;top:'+ (i * 100) +';visibility:hidden;">\n'+
			'  <DIV ID="linkLite'+ countlinks +'" STYLE="position:absolute;z-index:1;left:'+ link.linkBorder +';top:'+ link.linkBorder +';visibility:hide;" onMouseOut="mouseoutlink();">\n'+
			'	 <DIV ID="linkFg'+ countlinks +'" STYLE="position:absolute;left:'+ link.linkBorder +';top:'+ link.linkBorder +';visibility:hide;">\n'+
			'';
		}
		var x=i;
		for (var i=0; i<link.items.length; i++) {
			var item = link.items[i];
			var childlink = false;
			var defaultHeight = link.fontSize+6;
			var defaultIndent = link.fontSize;
			if (item.label) {
				item = item.label;
				childlink = true;
			}
			link.linkItemHeight = link.linkItemHeight || defaultHeight;
			link.linkItemIndent = link.linkItemIndent || defaultIndent;
			var itemProps = 'font-family:' + link.fontFamily +';font-weight:' + link.fontWeight + ';fontSize:' + link.fontSize + ';';
			if (link.fontStyle) itemProps += 'font-style:' + link.fontStyle + ';';
			if (document.all) 
				itemProps += 'font-size:' + link.fontSize + ';" onMouseOver="onlinkItemOver(null,this);" onClick="onlinkItemAction(null,this);';
			else if (!document.layers) {
				itemProps += 'font-size:' + link.fontSize + 'px;'; // zilla wants 12px.
			}
			var l;
			if (lrs) {
				l = new Layer(800,body);
			}
			var dTag	= '<DIV ID="linkItem'+ countItems +'" STYLE="position:absolute;left:0;top:'+ (i * link.linkItemHeight) +';'+ itemProps +'">';
			var dClose = '</DIV>'
			if (link.bgImageUp) {
				link.linkBorder = 0;
				link.linkItemBorder = 0;
				dTag	= '<DIV ID="linkItem'+ countItems +'" STYLE="background:url('+link.bgImageUp+');position:absolute;left:0;top:'+ (i * link.linkItemHeight) +';'+ itemProps +'">';
				if (document.layers) {
					dTag = '<LAYER BACKGROUND="'+link.bgImageUp+'" ID="linkItem'+ countItems +'" TOP="'+ (i * link.linkItemHeight) +'" style="' + itemProps +'">';
					dClose = '</LAYER>';
				}
			}
			var textProps = 'position:absolute;left:' + link.linkItemIndent + ';top:1;';
			if (lrs) {
				textProps +=itemProps;
				dTag = "";
				dClose = "";
			}

			var dText	= '<DIV ID="linkItemText'+ countItems +'" STYLE="' + textProps + 'color:'+ link.fontColor +';">'+ item +'&nbsp</DIV>\n<DIV ID="linkItemHilite'+ countItems +'" STYLE="' + textProps + 'top:1;color:'+ link.fontColorHilite +';visibility:hidden;">'+ item +'&nbsp</DIV>';
			if (item == "separator") {
				content += ( dTag + '<DIV ID="linkSeparator'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n<DIV ID="linkSeparatorLite'+ countItems +'" STYLE="position:absolute;left:1;top:2;"></DIV>\n' + dClose);
			} else if (childlink) {
				content += ( dTag + dText + '<DIV ID="childlink'+ countItems +'" STYLE="position:absolute;left:0;top:3;"><IMG SRC="'+ link.childlinkIcon +'"></DIV>\n' + dClose);
			} else {
				content += ( dTag + dText + dClose);
			}
			if (lrs) {
				l.document.open("text/html");
				l.document.writeln(content);
				l.document.close();	
				content = '';
				theStat += "-";
				tsc++;
				if (tsc > 50) {
					tsc = 0;
					theStat = "";
				}
				status = theStat;
			}
			countItems++;  
		}
		if (lrs) {
			// focus layer
			var focusItem = new Layer(100, body);
			focusItem.visiblity="hidden";
			focusItem.document.open("text/html");
			focusItem.document.writeln("&nbsp;");
			focusItem.document.close();	
		} else {
		  content += '	  <DIV ID="focusItem'+ countlinks +'" STYLE="position:absolute;left:0;top:0;visibility:hide;" onClick="onlinkItemAction(null,this);">&nbsp;</DIV>\n';
		  content += '   </DIV>\n  </DIV>\n</DIV>\n';
		}
		i=x;
	}
	if (document.layers) {		
		container.clip.width = window.innerWidth;
		container.clip.height = window.innerHeight;
		container.onmouseout = mouseoutlink;
		container.linkContainerBgColor = this.linkContainerBgColor;
		for (var i=0; i<container.document.layers.length; i++) {
			proto = container.links[i];
			var link = container.document.layers[i];
			container.links[i].linkLayer = link;
			container.links[i].linkLayer.link = container.links[i];
			container.links[i].linkLayer.link.container = container;
			var body = link.document.layers[0].document.layers[0];
			body.clip.width = proto.linkWidth || body.clip.width;
			body.clip.height = proto.linkHeight || body.clip.height;
			for (var n=0; n<body.document.layers.length-1; n++) {
				var l = body.document.layers[n];
				l.link = container.links[i];
				l.linkHiliteBgColor = proto.linkHiliteBgColor;
				l.document.bgColor = proto.linkItemBgColor;
				l.saveColor = proto.linkItemBgColor;
				l.onmouseover = proto.onlinkItemOver;
				l.onclick = proto.onlinkItemAction;
				l.action = container.links[i].actions[n];
				l.focusItem = body.document.layers[body.document.layers.length-1];
				l.clip.width = proto.linkWidth || body.clip.width + proto.linkItemIndent;
				l.clip.height = proto.linkItemHeight || l.clip.height;
				if (n>0) l.top = body.document.layers[n-1].top + body.document.layers[n-1].clip.height + proto.linkItemBorder;
				l.hilite = l.document.layers[1];
				if (proto.bgImageUp) l.background.src = proto.bgImageUp;
				l.document.layers[1].isHilite = true;
				if (l.document.layers[0].id.indexOf("linkSeparator") != -1) {
					l.hilite = null;
					l.clip.height -= l.clip.height / 2;
					l.document.layers[0].document.bgColor = proto.bgColor;
					l.document.layers[0].clip.width = l.clip.width -2;
					l.document.layers[0].clip.height = 1;
					l.document.layers[1].document.bgColor = proto.linkLiteBgColor;
					l.document.layers[1].clip.width = l.clip.width -2;
					l.document.layers[1].clip.height = 1;
					l.document.layers[1].top = l.document.layers[0].top + 1;
				} else if (l.document.layers.length > 2) {
					l.childlink = container.links[i].items[n].linkLayer;
					l.document.layers[2].left = l.clip.width -13;
					l.document.layers[2].top = (l.clip.height / 2) -4;
					l.document.layers[2].clip.left += 3;
					l.link.childlinks[l.link.childlinks.length] = l.childlink;
				}
			}
			body.document.bgColor = proto.bgColor;
			body.clip.width  = l.clip.width +proto.linkBorder;
			body.clip.height = l.top + l.clip.height +proto.linkBorder;
			var focusItem = body.document.layers[n];
			focusItem.clip.width = body.clip.width;
			focusItem.link = l.link;
			focusItem.top = -30;
            focusItem.captureEvents(Event.MOUSEDOWN);
            focusItem.onmousedown = onlinkItemDown;
			link.document.bgColor = proto.linkBorderBgColor;
			var lite = link.document.layers[0];
			lite.document.bgColor = proto.linkLiteBgColor;
			lite.clip.width = body.clip.width +1;
			lite.clip.height = body.clip.height +1;
			link.clip.width = body.clip.width + (proto.linkBorder * 3) ;
			link.clip.height = body.clip.height + (proto.linkBorder * 3);
		}
	} else {
		if ((!document.all) && (container.hasChildNodes)) {
			container.innerHTML=content;
		} else {
			container.document.open("text/html");
			container.document.writeln(content);
			container.document.close();	
		}
		if (!FIND("linkLayer0")) return;
		var linkCount = 0;
		for (var x=0; x<container.links.length; x++) {
			var linkLayer = FIND("linkLayer" + x);
			container.links[x].linkLayer = "linkLayer" + x;
			linkLayer.link = container.links[x];
			linkLayer.link.container = "linkLayer" + x;
			linkLayer.style.zIndex = 1;
		    var s = linkLayer.style;
			s.top = s.pixelTop = -300;
			s.left = s.pixelLeft = -300;

			var link = container.links[x];
			link.linkItemWidth = link.linkWidth || link.linkIEWidth || 140;
			linkLayer.style.backgroundColor = link.linkBorderBgColor;
			var top = 0;
			for (var i=0; i<container.links[x].items.length; i++) {
				var l = FIND("linkItem" + linkCount);
				l.link = container.links[x];
				if (l.addEventListener) { // ns6
					l.style.width = link.linkItemWidth;	
					l.style.height = link.linkItemHeight;
					l.style.top = top;
					l.addEventListener("mouseover", onlinkItemOver, false);
					l.addEventListener("click", onlinkItemAction, false);
					l.addEventListener("mouseout", mouseoutlink, false);
				} else { //ie
					l.style.pixelWidth = link.linkItemWidth;	
					l.style.pixelHeight = link.linkItemHeight;
					l.style.pixelTop = top;
				}
				top = top + link.linkItemHeight+link.linkItemBorder;
				l.style.fontSize = link.fontSize;
				l.style.backgroundColor = link.linkItemBgColor;
				l.style.visibility = "inherit";
				l.saveColor = link.linkItemBgColor;
				l.linkHiliteBgColor = link.linkHiliteBgColor;
				l.action = container.links[x].actions[i];
				l.hilite = FIND("linkItemHilite" + linkCount);
				l.focusItem = FIND("focusItem" + x);
				l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
				var childItem = FIND("childlink" + linkCount);
				if (childItem) {
					l.childlink = container.links[x].items[i].linkLayer;
					childItem.style.pixelLeft = childItem.style.left = link.linkItemWidth -11;
					childItem.style.pixelTop = childItem.style.top =(link.linkItemHeight /2) -4;
					//childItem.style.pixelWidth = 30 || 7;
					//childItem.style.clip = "rect(0 7 7 3)";
					l.link.childlinks[l.link.childlinks.length] = l.childlink;
				}
				var sep = FIND("linkSeparator" + linkCount);
				if (sep) {
					sep.style.clip = "rect(0 " + (link.linkItemWidth - 3) + " 1 0)";
					sep.style.width = sep.style.pixelWidth = link.linkItemWidth;	
					sep.style.backgroundColor = link.bgColor;
					sep = FIND("linkSeparatorLite" + linkCount);
					sep.style.clip = "rect(1 " + (link.linkItemWidth - 3) + " 2 0)";
					sep.style.width = sep.style.pixelWidth = link.linkItemWidth;	
					sep.style.backgroundColor = link.linkLiteBgColor;
					l.style.height = l.style.pixelHeight = link.linkItemHeight/2;
					l.isSeparator = true
					top -= (link.linkItemHeight - l.style.pixelHeight)
				} else {
					l.style.cursor = "hand"
				}
				linkCount++;
			}
			link.linkHeight = top-1;
			var lite = FIND("linkLite" + x);
			var s = lite.style;
			s.height = s.pixelHeight = link.linkHeight +(link.linkBorder * 2);
			s.width = s.pixelWidth = link.linkItemWidth + (link.linkBorder * 2);
			s.backgroundColor = link.linkLiteBgColor;

			var body = FIND("linkFg" + x);
			s = body.style;
			s.height = s.pixelHeight = link.linkHeight + link.linkBorder;
			s.width = s.pixelWidth = link.linkItemWidth + link.linkBorder;
			s.backgroundColor = link.bgColor;

			s = linkLayer.style;
			s.width = s.pixelWidth  = link.linkItemWidth + (link.linkBorder * 4);
			s.height = s.pixelHeight  = link.linkHeight+(link.linkBorder*4);
		}
	}
	if (document.captureEvents) {	
		document.captureEvents(Event.MOUSEUP);
	}
	if (document.addEventListener) {	
		document.addEventListener("mouseup", onlinkItemOver, false);
	}
	if (document.layers && window.innerWidth) {
		window.onresize = NS4resize;
		window.NS4sIW = window.innerWidth;
		window.NS4sIH = window.innerHeight;
	}
	document.onmouseup = mouseuplink;
	window.fwWrotelink = true;
	status = "";
}

function NS4resize() {
	if (NS4sIW < window.innerWidth || 
		NS4sIW > window.innerWidth || 
		NS4sIH > window.innerHeight || 
		NS4sIH < window.innerHeight ) 
	{
		window.location.reload();
	}
}

function onlinkItemOver(e, l) {
	FW_clearTimeout();
	l = l || this;
	a = window.ActivelinkItem;
	if (document.layers) {
		if (a) {
			a.document.bgColor = a.saveColor;
			if (a.hilite) a.hilite.visibility = "hidden";
			if (a.link.bgImageOver) {
				a.background.src = a.link.bgImageUp;
			}
			a.focusItem.top = -100;
			a.clicked = false;
		}
		if (l.hilite) {
			l.document.bgColor = l.linkHiliteBgColor;
			l.zIndex = 1;
			l.hilite.visibility = "inherit";
			l.hilite.zIndex = 2;
			l.document.layers[1].zIndex = 1;
			l.focusItem.zIndex = this.zIndex +2;
		}
		if (l.link.bgImageOver) {
			l.background.src = l.link.bgImageOver;
		}
		l.focusItem.top = this.top;
		l.link.hideChildlink(l);
	} else if (l.style && l.link) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.link.bgImageUp) {
				a.style.background = "url(" + a.link.bgImageUp +")";;
			}
		} 
		if (l.isSeparator) return;
		l.style.backgroundColor = l.linkHiliteBgColor;
		l.zIndex = 1;  // magic IE 4.5 mac happy doohicky.	jba
		if (l.link.bgImageOver) {
			l.style.background = "url(" + l.link.bgImageOver +")";
		}
		if (l.hilite) {
			l.style.backgroundColor = l.linkHiliteBgColor;
			l.hilite.style.visibility = "inherit";
		}
		l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;
		l.focusItem.style.zIndex = l.zIndex +1;
		l.link.hideChildlink(l);
	} else {
		return; // not a link - magic IE 4.5 mac happy doohicky.  jba
	}
	window.ActivelinkItem = l;
}

function onlinkItemAction(e, l) {
	l = window.ActivelinkItem;
	if (!l) return;
	hideActivelinks();
	if (l.action) {
		eval("" + l.action);
	}
	window.ActivelinkItem = 0;
}

function FW_clearTimeout()
{
	if (fwHidelinkTimer) clearTimeout(fwHidelinkTimer);
	fwHidelinkTimer = null;
	fwDHFlag = false;
}
function FW_startTimeout()
{
	fwStart = new Date();
	fwDHFlag = true;
	fwHidelinkTimer = setTimeout("fwDoHide()", 1000);
}

function fwDoHide()
{
	if (!fwDHFlag) return;
	var elapsed = new Date() - fwStart;
	if (elapsed < 1000) {
		fwHidelinkTimer = setTimeout("fwDoHide()", 1100-elapsed);
		return;
	}
	fwDHFlag = false;
	hideActivelinks();
	window.ActivelinkItem = 0;
}

function FW_showlink(link, x, y, child) {
	if (!window.fwWrotelink) return;
	FW_clearTimeout();
	if (document.layers) {
		if (link) {
			var l = link.linkLayer || link;
			l.left = 1;
			l.top = 1;
			hideActivelinks();
			if (this.visibility) l = this;
			window.Activelink = l;
		} else {
			var l = child;
		}
		if (!l) return;
		for (var i=0; i<l.layers.length; i++) { 			   
			if (!l.layers[i].isHilite) 
				l.layers[i].visibility = "inherit";
			if (l.layers[i].document.layers.length > 0) 
				FW_showlink(null, "relative", "relative", l.layers[i]);
		}
		if (l.parentLayer) {
			if (x != "relative") 
				l.parentLayer.left = x || window.pageX || 0;
			if (l.parentLayer.left + l.clip.width > window.innerWidth) 
				l.parentLayer.left -= (l.parentLayer.left + l.clip.width - window.innerWidth);
			if (y != "relative") 
				l.parentLayer.top = y || window.pageY || 0;
			if (l.parentLayer.isContainer) {
				l.link.xOffset = window.pageXOffset;
				l.link.yOffset = window.pageYOffset;
				l.parentLayer.clip.width = window.Activelink.clip.width +2;
				l.parentLayer.clip.height = window.Activelink.clip.height +2;
				if (l.parentLayer.linkContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.linkContainerBgColor;
			}
		}
		l.visibility = "inherit";
		if (l.link) l.link.container.visibility = "inherit";
	} else if (FIND("linkItem0")) {
		var l = link.linkLayer || link;	
		hideActivelinks();
		if (typeof(l) == "string") {
			l = FIND(l);
		}
		window.Activelink = l;
		var s = l.style;
		s.visibility = "inherit";
		if (x != "relative") 
			s.left = s.pixelLeft = x || (window.pageX + document.body.scrollLeft) || 0;
		if (y != "relative") 
			s.top = s.pixelTop = y || (window.pageY + document.body.scrollTop) || 0;
		l.link.xOffset = document.body.scrollLeft;
		l.link.yOffset = document.body.scrollTop;
	}
	if (link) {
		window.activelinks[window.activelinks.length] = l;
	}
}

function onlinkItemDown(e, l) {
	var a = window.ActivelinkItem;
	if (document.layers) {
		if (a) {
			a.eX = e.pageX;
			a.eY = e.pageY;
			a.clicked = true;
		}
    }
}

function mouseuplink(e)
{
	hidelink(true, e);
	hideActivelinks();
	return true;
}

function mouseoutlink()
{
	hidelink(false, false);
	return true;
}


function hidelink(mouseup, e) {
	var a = window.ActivelinkItem;
	if (a && document.layers) {
		a.document.bgColor = a.saveColor;
		a.focusItem.top = -30;
		if (a.hilite) a.hilite.visibility = "hidden";
		if (mouseup && a.action && a.clicked && window.Activelink) {
 			if (a.eX <= e.pageX+15 && a.eX >= e.pageX-15 && a.eY <= e.pageY+10 && a.eY >= e.pageY-10) {
				setTimeout('window.Activelink.link.onlinkItemAction();', 2);
			}
		}
		a.clicked = false;
		if (a.link.bgImageOver) {
			a.background.src = a.link.bgImageUp;
		}
	} else if (window.Activelink && FIND("linkItem0")) {
		if (a) {
			a.style.backgroundColor = a.saveColor;
			if (a.hilite) a.hilite.style.visibility = "hidden";
			if (a.link.bgImageUp) {
				a.style.background = "url(" + a.link.bgImageUp +")";;
			}
		}
	}
	if (!mouseup && window.Activelink) {
		if (window.Activelink.link) {
			if (window.Activelink.link.hideOnMouseOut) {
				FW_startTimeout();
			}
			return(true);
		}
	}
	return(true);
}

function PxToNum(pxStr)
{ // pxStr == 27px, we want 27.
	if (pxStr.length > 2) {
		n = Number(pxStr.substr(0, pxStr.length-2));
		return(n);
	}
	return(0);
}

function hideChildlink(hcmLayer) {
	FW_clearTimeout();
	var l = hcmLayer;
	for (var i=0; i < l.link.childlinks.length; i++) {
		var theLayer = l.link.childlinks[i];
		if (document.layers) {
			theLayer.visibility = "hidden";
		} else {
			theLayer = FIND(theLayer);
			theLayer.style.visibility = "hidden";
		}
		theLayer.link.hideChildlink(theLayer);
	}

	if (l.childlink) {
		var childlink = l.childlink;
		if (document.layers) {
			l.link.FW_showlink(null,null,null,childlink.layers[0]);
			childlink.zIndex = l.parentLayer.zIndex +1;
			childlink.top = l.top + l.parentLayer.top + l.link.linkLayer.top + l.link.linkItemHeight/3;
			if (childlink.left + childlink.clip.width > window.innerWidth) {
				childlink.left = l.parentLayer.left - childlink.clip.width + l.link.linkLayer.left + 15;
				l.link.container.clip.left -= childlink.clip.width;
			} else {
				childlink.left = l.parentLayer.left + l.parentLayer.clip.width  + l.link.linkLayer.left -5;
			}
			var w = childlink.clip.width+childlink.left-l.link.container.clip.left;
			if (w > l.link.container.clip.width)  
				l.link.container.clip.width = w;
			var h = childlink.clip.height+childlink.top-l.link.container.clip.top;
			if (h > l.link.container.clip.height) l.link.container.clip.height = h;
			l.document.layers[1].zIndex = 0;
			childlink.visibility = "inherit";
		} else if (FIND("linkItem0")) {
			childlink = FIND(l.childlink);
			var linkLayer = FIND(l.link.linkLayer);
			var s = childlink.style;
			s.zIndex = linkLayer.style.zIndex+1;
			if (document.all) { // ie case.
				s.pixelTop = l.style.pixelTop + linkLayer.style.pixelTop + l.link.linkItemHeight/3;
				s.left = s.pixelLeft = (linkLayer.style.pixelWidth) + linkLayer.style.pixelLeft -5;
			} else { // zilla case
				var top = PxToNum(l.style.top) + PxToNum(linkLayer.style.top) + l.link.linkItemHeight/3;
				var left = (PxToNum(linkLayer.style.width)) + PxToNum(linkLayer.style.left) -5;
				s.top = top;
				s.left = left;
			}
			childlink.style.visibility = "inherit";
		} else {
			return;
		}
		window.activelinks[window.activelinks.length] = childlink;
	}
}

function hideActivelinks() {
	if (!window.activelinks) return;
	for (var i=0; i < window.activelinks.length; i++) {
		if (!activelinks[i]) continue;
		if (activelinks[i].visibility && activelinks[i].link) {
			activelinks[i].visibility = "hidden";
			activelinks[i].link.container.visibility = "hidden";
			activelinks[i].link.container.clip.left = 0;
		} else if (activelinks[i].style) {
			var s = activelinks[i].style;
			s.visibility = "hidden";
			s.left = -200;
			s.top = -200;
		}
	}
	if (window.ActivelinkItem) {
		hidelink(false, false);
	}
	window.activelinks.length = 0;
}



