
function resizeFrame() {
	var intHeight = parseInt(document.body.clientHeight, 10);
	var intWidth = parseInt(document.body.clientWidth, 10);
	if (navigator.userAgent.indexOf("Gecko") != -1)
	{
		intHeight = parseInt(window.innerHeight, 10);
		intWidth = parseInt(window.innerWidth, 10);
	}

	document.getElementById("main").style.height = intHeight - 30; //30 for IE correction...
	document.getElementById("main").style.width = intWidth;

	if (document.getElementById("divAjaxBanner"))
		document.getElementById("divAjaxBanner").style.width = intWidth - 330;
}

// ========= news page functions ==============
function openNewsItem(recid)
{
	top.location = "http://www.lostluggagestudios.com/forums/viewtopic.php?t=" + recid;
}

// ======== top menu functions =============
var strInMenu;
var menuTimeout = 500;
var objOldMenu;

var objOldParent;

function doOver(objParent, strName)
{
	clearTimeout(strInMenu);
	handleOut();

	var objDiv = document.getElementById("menu_"+ strName);
	objDiv.style.top = document.getElementById("main").style.top;
	objDiv.style.left = objParent.style.left;
	objDiv.style.visibility = "visible";
	objOldMenu = objDiv;

	objParent.style.color = "gray";
	objOldParent = objParent;
}

function doOut()
{
	clearTimeout(strInMenu);
	strInMenu = setTimeout("handleOut()", menuTimeout);
}

function doMenuOver()
{
	clearTimeout(strInMenu);
}

function doMenuOut()
{
	clearTimeout(strInMenu);
	strInMenu = setTimeout("handleOut()", menuTimeout);
}

function handleOut()
{
	if (objOldMenu != null)
	{
		objOldMenu.style.visibility = "hidden";
		objOldMenu = null;
		objOldParent.style.color = "black";
		objOldParent = null;
	}
}


// =============== Main page rotating banner ===================
var aryBannerList;
var currentBannerIndex = 0;

function startBannerRotation(bannerlist)
{
	aryBannerList = bannerlist.split(',');
	getBanner();
}

function getBanner()
{
	currentBannerIndex++;
	if (currentBannerIndex >= aryBannerList.length)
		currentBannerIndex = 1; //this skips the leading -1 entry

	//Make Ajax call to get the banner data
	cbaUpdateElement('divAjaxBanner', 'getBanner.php?id='+ aryBannerList[currentBannerIndex]);

	//set up the next round!
	setTimeout("getBanner()", 10000);
}

