// JavaScript Document

var ff = document.getElementById && !document.all;
var oSelTab, tabPopupBoxContainer, tabPopupBox;

function showTabPopupBox(oTab) {
	tabPopupBoxContainer = document.getElementById("tabPopupBoxContainer");
	tabPopupBox = document.getElementById("tabPopupBox");
	if(typeof(tabPopupBoxContainer) == 'undefined' || tabPopupBoxContainer == null)
		return false;
	if(typeof(tabPopupBox) == 'undefined' || tabPopupBox == null)
		return false;
	tabPopupBox.innerHTML = "<img src='images/tab_" + oTab.id + ".png' width='120' height='60' alt='' />";
	tabPopupBox.height = tabPopupBox.offsetHeight;
	tabPopupBoxContainer.style.height = parseInt(tabPopupBox.height) + "px";
	tabPopupBoxContainer.style.left = parseInt(oTab.offsetParent.offsetLeft, 10) + parseInt(oTab.offsetLeft, 10) + "px";
	tabPopupBoxContainer.style.top = parseInt(oTab.offsetParent.offsetTop, 10) + 18 + "px";
	tabPopupBoxContainer.style.visibility = "visible";
	tabPopupBox.style.top = tabPopupBox.height * (-1) + "px";
	oSelTab = oTab;
	dropstart = setInterval("dropinv2()", 20);
}

function dropinv2() {
	var scroll_top = ff ? window.pageYOffset : truebody().scrollTop;
	if(parseInt(tabPopupBox.style.top) < 0) {
		tabPopupBoxContainer.style.top =  parseInt(oSelTab.offsetParent.offsetTop, 10) + 18 + "px";
		tabPopupBox.style.top = parseInt(tabPopupBox.style.top) + 15 + "px";
	}
	else {
		clearInterval(dropstart);
		tabPopupBox.style.top = 0;
	}
}

function hideTabPopupBox() {
	if(window.dropstart)
		clearInterval(dropstart);
	if(typeof(tabPopupBoxContainer) != 'undefined' && tabPopupBoxContainer != null)
		tabPopupBoxContainer.style.visibility = "hidden";
}

function truebody() {
	return (document.compatMode && document.compatMode!="BackCompat") ? document.documentElement : document.body;
}
