// JavaScript Document

// Flyout Functions
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function showFlyout(thisObj,navPos) {
	var theFlyout = document.getElementById('Flyout');
	var theFlyoutBG = document.getElementById('Flyout_bg');
	var linkPosition = findPos(thisObj);
	var linkArr = eval('linkArr_' + navPos);
	// Hide Existing Flyout
	hideFlyout();
	// Set Flyout Position
	theFlyout.style.top = 93 + 'px';
	theFlyoutBG.style.top = 93 + 'px';
	theFlyout.style.left = 425 + 'px';
	theFlyoutBG.style.left = 425 + 'px';
	//Populate Flyout
	if (linkArr.length > 0) {
		theFlyout.innerHTML = '';
		for (i=0; i<linkArr.length; i++) {
			theFlyout.innerHTML = theFlyout.innerHTML + '<div>' + linkArr[i] + '</div>';	
		}
		// Show Flyout
		theFlyout.style.display = '';
		theFlyoutBG.style.height = theFlyout.offsetHeight + 'px';
		theFlyoutBG.style.display = '';
		//activeFlyout = setTimeout('hideFlyout()',flyoutDuration);
	}
}
function hideFlyout() {
	var theFlyout = document.getElementById('Flyout');
	var theFlyoutBG = document.getElementById('Flyout_bg');
	if (typeof(activeFlyout) != 'undefined') {
		clearTimeout(activeFlyout);
	}
	theFlyout.style.display = 'none';
	theFlyoutBG.style.display = 'none';
}