function GoodTableWidth(extra)
{
	return window.innerWidth - 30 + extra;
}

function stripperella()
{
	// out damn spots! err, damn ads!
	if (document.getElementById && document.getElementsByTagName)
	{
		var alldivs = document.getElementsByTagName("div");
		for (var i = 0; i < alldivs.length; i++)
		{
			if (alldivs[i].id.indexOf("aws") != -1)
				alldivs[i].style.visibility = "hidden";
		}	
	}
	else if (document.layers)
	{
		//alert("using document.layers (a good browser!)");
		for (var i = 0; i < document.layers.length; i++)
		{
			if (document.layers[i].id.indexOf("aws") != -1)
				document.layers[i].style.visibility = "hide";
		}
	}
	if (document.all)
	{
		//alert("using document.all (IE)");
		for (var i = 0; i < document.all.length; i++)
		{
			if (document.all[i].id.indexOf("aws") != -1)
				document.all[i].style.visibility = "hidden";
		}
	}
}

// thanks, Apple :-) (http://developer.apple.com/internet/webcontent/dynamicforms.html)
function getStyleObject(objectId) {
	// check W3C DOM, then MSIE 4, then NN 4.
	//
	if(document.getElementById && document.getElementById(objectId))
		return document.getElementById(objectId).style;
	else if (document.all && document.all(objectId))
		return document.all(objectId).style;
	else if (document.layers && document.layers[objectId])
		return document.layers[objectId];
	else
		return false;
}

function popupMenuOpen(name)
{
	//close all other menus
	for (var i = 0; i < divList.length; i++)
		popupMenuClose(divList[i]);
	
	if (name != "none")
		var styleObject = getStyleObject(name);
	if (styleObject)
		styleObject.visibility = "visible";
	
}

function popupMenuClose(name)
{
	var styleObject = getStyleObject(name);
	if (styleObject)
		styleObject.visibility = "hidden";
}

function writeBody(which)
{
	document.write(pages[which]);
}

function quickredirect()
{
	var page = document.location.search.slice(4,document.location.search.length);
	if (page == "")
		window.location = window.location + "?at=home";
}


// return int from lower to upper
function rand(lo, hi)
{
	return parseInt(((hi-lo) * Math.random()) + lo);
}


