
function showPopOver(event, url, width, height, left, top){
	var target = document.getElementById("popover_bg");
	
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
			var winW = window.innerWidth;
			var winH = window.innerHeight;
			var subtract = 17;
			var subtractH = 0;
		}
		if (navigator.appName.indexOf("Microsoft")!=-1) {
			var winW = document.body.offsetWidth;
			var winH = document.body.offsetHeight;
			var subtract = 0;
			var subtractH = -104;
		}
	}
	target.style.minWidth = winW - subtract + "px";
	target.style.minHeight = winH - subtractH + "px";
	target.style.display = "block";
	target.style.zIndex = 11000;
	
	var target = document.getElementById("popover");
	target.style.left = left + "px";
	target.style.top = top + "px";
	target.style.minWidth = width + "px";
	target.style.minHeight = height + "px";
	target.style.display = "block";
	target.style.zIndex = 12001;
	
	window.popFrame.location.href = url;
}

function closePopOver(){
	var target = document.getElementById("popover");
	target.style.left = "0px";
	target.style.top = "0px";
	target.style.minWidth = "10px";
	target.style.minHeight = "10px";
	target.style.display = "none";
	
	var target = document.getElementById("popover_bg");
	target.style.minWidth = "10px";
	target.style.minHeight = "10px";
	target.style.display = "none";
	
}

function resizeFrame(){
	
	if(document.getElementById){
		oHeight = document.getElementById('menuWin').offsetHeight;
		oWidth = document.getElementById('menuWin').offsetWidth;
		if (navigator.appName=="Netscape") {
			oWidth = oWidth + 200;
		}
		if(oWidth > 820){
			oWidth = 800;
		}
	}else if (document.layers){
		oHeight = document.layers['menuWin'].clip.height;
		oWidth = document.layers['menuWin'].clip.width;
	}
	
	if(oHeight < 80){
		oHeight = 80;
	}
	if(oWidth < 150){
		oWidth = 150;
	}
	
	var elementname = "popFrame";
	var iframeElement = parent.document.getElementById(elementname);
	
	iframeElement.style.height = oHeight + "px";
	iframeElement.style.width = oWidth + "px";
	
	var elementname = "popover";
	var iframeElement = parent.document.getElementById(elementname);
	iframeElement.style.height = oHeight + "px";
	iframeElement.style.width = oWidth + "px";
	
}

function checkThisPos(event, text){
	var source = document.getElementById(event);
	
	var srcX = findPosX(source);
	var srcY = findPosY(source);
	
	showInfoPane(event, srcX+180, srcY, 500, 200, text);
}

function showInfoPane(event, x, y, height, width, text){
	var source = document.getElementById(event);
	var target = document.getElementById("info_pane");
	
	target.style.minWidth = width + "px";
	target.style.minHeight = height + "px";
	target.style.left = x + "px";
	target.style.top = y + "px";
	target.style.display = "block";
	target.style.zIndex = 11000;
	target.innerHTML = decodeURI(text);
}

function closeInfoPane(){
	var target = document.getElementById("info_pane");
	target.style.left = "0px";
	target.style.top = "0px";
	target.style.minWidth = "10px";
	target.style.minHeight = "10px";
	target.style.display = "none";
	target.innerHTML = "";
}

function findPosX(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
		} while (obj = obj.offsetParent);
		return curleft;
	}
}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		do {
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return curtop;
	}
}

function navMouseOver(event, color){
	swapBgColor(event, color);
}

function swapBgColor(event, color){
	var target = document.getElementById(event);
	target.style.backgroundColor = color;
}
