// JavaScript Document

function popUp(URL)
{
	winpops=window.open(URL,"","width=200,height=125,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}


function popUp2(URL)
{
	winpops=window.open(URL,"","width=330,height=300,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function popRateGame(URL)
{
	winpops=window.open(URL,"","width=250,height=150,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function popUpFavorite(URL)
{
	winpops=window.open(URL,"","width=200,height=100,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}


function popComments(URL)
{
	winpops=window.open(URL,"","width=440,height=400,left=100,top=100,status=0,scrollbars=1,resizable=1,menubar=0,location=0,toolbar=0")
}


function popRecoverPassword(URL)
{
	winpops=window.open(URL,"","width=440,height=200,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function popReportGame(URL)
{
	winpops=window.open(URL,"","width=270,height=200,left=100,top=100,status=0,scrollbars=0,resizable=1,menubar=0,location=0,toolbar=0")
}

function MM_jumpMenu(targ,selObj,restore)
{
	//v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore)
		selObj.selectedIndex=0;
}


// Nannette Thacker http://www.shiningstar.net
function confirmDeleteMessage()
{
	var agree=confirm("Are you sure you wish to delete this message?");
	if (agree)
		return true ;
	else
		return false ;
}

function bookmark(url,title)
{
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		window.external.AddFavorite(url,title);
	} else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");
	} else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	}
}

function openclosecatbox( title )
{
	var x = document.getElementById( title );

	if( x.style.display == "none" )
	{
		x.style.display = "block";
		createCookie(title,"block",7)
	} else {
		x.style.display = "none";
		createCookie(title,"none",7)
	}
}

/** Cookie functions **/
/** credit: http://www.quirksmode.org/js/cookies.html **/
function createCookie(name,value,days)
{
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0)
			return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}
/** end cookie functions **/

/** ArcadeTown click counter **/
/*function atClick( gameid, clicktype )
{
	alert( gameid );
	alert( clicktype );

	// create an XML with the needed data
	if (window.XMLHttpRequest) {
		// code for Mozilla, etc.
		xmlhttp = new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		// code for IE
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
	}

	var theText = "";
	theText += "<arcadetownclick>";
	theText += "<gameid>" + gameid + "</gameid>";
	theText += "<clicktype>" + clicktype + "</clicktype>";
	theText += "</arcadetownclick>";

	if (window.ActiveXObject) {
		// code for IE
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	} else if (document.implementation && document.implementation.createDocument) {
		// code for Mozilla, Firefox, Opera, etc.
		xmlDoc = document.implementation.createDocument("","",null);
	}

	xmlDoc.loadXML( theText );
	alert( xmlDoc.xml );

	xmlHttp.open( "GET", "http://localhost/includes/at-click.php?drek=1", false );
	alert(2);
	xmlHttp.send( xmlDoc );
	alert(3);
//	document.write( xmlHttp.responseText );
	alert( xmlHttp.responseText );
}
*/