var uA = navigator.userAgent.toLowerCase();
var version = navigator.appVersion;
var coll = "";
var styleObj = "";
var isIE = (uA.indexOf("msie") != -1);
var isMac = (uA.indexOf("mac") != -1);
var isWin = (uA.indexOf("win") != -1);
var isAOL = (uA.indexOf("aol") != -1);
var isNetscape = (navigator.appName.indexOf("Netscape") != -1);
var isGecko = (uA.indexOf("gecko") != -1);
var isIEMac = (isMac && isIE);
var isIEWin = (isIE && isWin);
var isIEMac5 = (isIEMac && (version.indexOf("5.") != -1))

function getStyle(id)
{
	var theStyle;
	
	if( isNetscape && (!isGecko))
	{
		theStyle = eval("document." + id);
	}
	if ( isIE )
	{
		theStyle = eval("document.all." + id + ".style");
	}
	if ( isGecko )
	{
		theStyle = document.getElementById(id).style;
	}
	
	return theStyle;
}

if (isIE )
{
	coll = "all."
	styleObj = ".style"
}

// only used by Netscape4 in reviewproblems.js
function getObject(obj)
{
	var theObj;

	if (typeof obj == "string")
	{
		theObj = eval("document." + coll + obj + styleObj);
	} else {
		theObj = obj;
	}
	
	return theObj;
}

function show(id)
{
	var theStyle = getStyle(id);
	theStyle.visibility = "visible";
}

function hide(id)
{
	var theStyle = getStyle(id);
	theStyle.visibility = "hidden";
}

function writeObj(id, string)
{
 	var theObj;

	if( isNetscape && (!isGecko))
	{
		theObj = eval("document." + id);
		theObj.document.open();
    		theObj.document.write(string);
    		theObj.document.close();
	}
	if ( isIE )
	{
		theObj = eval("document.all." + id);
		theObj.innerHTML = string;
	}
	if ( isGecko )
	{
		theObj = document.getElementById(id);
		theObj.innerHTML = string;
	}
}
