function openPopup(index, parent) {
	retainPopup();
	
	if (PopupElement.style.visibility == "visible" && PopupElement.activeIndex == index)
		return;

	PopupElement.style.visibility = "hidden";
	PopupElement.style.top = 75;
	PopupElement.style.left = DocumentElement.offsetLeft+parent.offsetLeft-1;
	PopupElement.activeIndex = index;
	
	if (index < popupObj.length) {
		var popupContent = "<TABLE cellSpacing=0 cellPadding=0 border=0 width=\"100%\">";
		
		for(var i = 0;i < popupObj[index].length;i ++)
			popupContent += "<TR onMouseOver=\"this.style.backgroundColor='#DCDEE3';\" onMouseOut=\"this.style.backgroundColor='transparent';\"><TD class=\"POPUP\" width=\"100%\" noWrap"+(popupObj[index][i][2] ? " style=\"cursor: hand;\" onMouseOver=\"openSubPopup("+(popupObj[index][i][2]-1)+", this);\" onmouseOut=\"closeSubPopup();\"" : "")+">&nbsp;"+(popupObj[index][i][2] ? "" : "<A hRef=\""+unescape(popupObj[index][i][1])+"\" class=\"POPUP\">")+unescape(popupObj[index][i][0])+(popupObj[index][i][2] ? "" : "</A>")+"</TD><TD class=\"POPUP\">"+(popupObj[index][i][2] ? "<IMG src=\"interface/_popup_arrow.gif\" width=4 height=9 hSpace=2 border=0>" : "&nbsp;")+"</TD></TR>";
	
		popupContent += "</TABLE>";

		if (popupAllowFilters) {
			PopupElement.filters[0].apply();
			PopupElement.filters[0].motion = "forward";
		}
		
		PopupElement.rows(0).cells(0).innerHTML = popupContent;
		PopupElement.style.visibility = "visible";
		
		if (popupAllowFilters)
			PopupElement.filters[0].play();
	}
}

function closePopup() {
	PopupElement.timeout = window.setTimeout("if (popupAllowFilters) { PopupElement.filters[0].apply();PopupElement.filters[0].motion='reverse'; } PopupElement.style.visibility='hidden';SubPopupElement.style.visibility='hidden';if (popupAllowFilters) PopupElement.filters[0].play();", 600);
}

function retainPopup() {
	if (PopupElement.timeout)
		window.clearTimeout(PopupElement.timeout);
}

function openSubPopup(index, parent) {
	retainSubPopup();
	
	if (SubPopupElement.style.visibility == "visible" && SubPopupElement.activeIndex == index)
		return;
	
	SubPopupElement.style.visibility = "hidden";
	
	if (index < popupObj.length) {
		var popupContent = "<TABLE cellSpacing=0 cellPadding=0 border=0 width=\"100%\">";
		
		for(var i = 0;i < popupObj[index].length;i ++)
			popupContent += "<TR onMouseOver=\"this.style.backgroundColor='#DCDEE3';\" onMouseOut=\"this.style.backgroundColor='transparent';\"><TD class=\"POPUP\" width=\"100%\" noWrap>&nbsp;<A hRef=\""+unescape(popupObj[index][i][1])+"\" class=\"POPUP\">"+unescape(popupObj[index][i][0])+"</A></TD></TR>";
	
		popupContent += "</TABLE>";

		if (popupAllowFilters) {
			SubPopupElement.filters[0].apply();
			SubPopupElement.filters[0].motion = "forward";
		}
		
		SubPopupElement.rows(0).cells(0).innerHTML = popupContent;
		SubPopupElement.style.visibility = "visible";
		SubPopupElement.style.left = parseInt(PopupElement.style.left)+PopupElement.clientWidth;
		SubPopupElement.style.top = parseInt(PopupElement.style.top)+parent.offsetTop+2;
		SubPopupElement.activeIndex = index;

		if (popupAllowFilters)
			SubPopupElement.filters[0].play();
	}
}

function closeSubPopup() {
	SubPopupElement.timeout = window.setTimeout("closePopup();if (popupAllowFilters) { SubPopupElement.filters[0].apply();SubPopupElement.filters[0].motion='reverse'; } SubPopupElement.style.visibility='hidden';if (popupAllowFilters) SubPopupElement.filters[0].play();", 600);
}

function retainSubPopup() {
	if (SubPopupElement.timeout) {
		window.clearTimeout(SubPopupElement.timeout);
	
		retainPopup();
	}
}

function window.onload() {
	if (popupAllowFilters) {
		ImageElement.filters[0].apply();
		ImageElement.style.visibility = "visible";
		ImageElement.filters[0].play();
		
		if (document.all("QuicklinkElement"))
			window.setInterval("QuicklinkElement.filters[0].apply();if (typeof(QuicklinkElement.pos) == 'undefined')QuicklinkElement.pos=0;QuicklinkElement.rows(0).cells(QuicklinkElement.pos).style.display='none';QuicklinkElement.pos++;if(QuicklinkElement.pos >= QuicklinkElement.rows(0).cells.length)QuicklinkElement.pos=0;QuicklinkElement.rows(0).cells(QuicklinkElement.pos).style.display='block';QuicklinkElement.filters[0].play();", 8000);
	}
}
