function InIE()
{
	var wheretoforce = document.getElementsByTagName("div");
	for (var i=0; i<wheretoforce.length; i++)
	{
		if(wheretoforce[i].className=="linkalike" || wheretoforce[i].className=="nonlinkInIE"){
		wheretoforce[i].onmouseover=function()
		{
			this.className="nonlinkInIE";
		}
		wheretoforce[i].onmouseout=function()
		{
			this.className="linkalike";
		}}
	}
}
if (window.attachEvent)
	window.attachEvent("onload", InIE);

var xmlHttp

function home(Page)
{
	document.ajaxdata.page.value=Page
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Switch site mode to Simple")
		return
	}
	var url="ajax.php"
	url=url+"?show=home"
	url=url+"&page="+document.ajaxdata.page.value
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function page(Show)
{
	if (!(Show=="contact" || Show=="downloads" || Show=="faq" || Show == "rf" || Show=="pending" || Show=="videos"))
		return
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Switch site mode to Simple")
		return
	}
	var url="ajax.php?show="+Show
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function codes(Sys, Game)
{
	document.ajaxdata.sys.value=Sys
	document.ajaxdata.game.value=Game
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Switch site mode to Simple")
		return
	}
	var url="ajax.php?show=codes"
	url=url+"&sys="+document.ajaxdata.sys.value
	url=url+"&game="+document.ajaxdata.game.value
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=stateChanged
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function viewcodes(Sys, Game)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Switch site mode to Simple")
		return
	}
	var url="ajax.php?show=viewcodes"
	url=url+"&sys="+Sys
	url=url+"&game="+Game
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=ChangeCodes
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function listgames(Sys)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
	{
		alert ("Switch site mode to Simple")
		return
	}
	var url="ajax.php?show=listgames"
	url=url+"&sys="+Sys
	url=url+"&sid="+Math.random()
	xmlHttp.onreadystatechange=ChangeGames
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
}

function stateChanged()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("ajax").innerHTML=xmlHttp.responseText
		InIE(); //my function to make divs seem like links in IE
		minmax_stop(); //the previously included javascript hack for IE min/max height and width
	}
}

function ChangeGames()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("games").innerHTML=xmlHttp.responseText
		InIE(); //my function to make divs seem like links in IE
		minmax_stop(); //the previously included javascript hack for IE min/max height and width
	}
	else
	{
		document.getElementById("games").innerHTML="<BR>Loading Game List..."
		document.getElementById("codes").innerHTML=""
	}
}

function ChangeCodes()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		document.getElementById("games").innerHTML=""
		document.getElementById("codes").innerHTML=xmlHttp.responseText
		InIE(); //my function to make divs seem like links in IE
		minmax_stop(); //the previously included javascript hack for IE min/max height and width
	}
	else
	{
		document.getElementById("games").innerHTML="<BR>Loading Codes..."
	}
}

function GetXmlHttpObject()
{
	var objXMLHttp=null
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest()
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
	}
	return objXMLHttp
}
