function rand()
{
var url = "ajax.php";

// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp2=new XMLHttpRequest();
		xmlhttp2.onreadystatechange = gameChange;
		xmlhttp2.open("GET", url, true);
		xmlhttp2.send(null);
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp2)
		{
			xmlhttp2.onreadystatechange = gameChange;
			xmlhttp2.open("GET", url, true);
			xmlhttp2.send();
		}
	}
}
function change(nr) {
document.getElementById("co").innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="550" height="400"><param name="movie" value="games/' + nr + '"><param name="quality" value="high"><param name="menu" value="true"><embed width="550" height="400" src="games/' + nr + '.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>';
document.getElementById("text").innerHTML = '&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot; width=&quot;550&quot; height=&quot;400&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.layoutcodes.net/games/games/' + nr + '.swf&quot;&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot;&gt;&lt;param name=&quot;menu&quot; value=&quot;true&quot;&gt;&lt;embed width=&quot;550&quot; height=&quot;400&quot; src=&quot;http://www.layoutcodes.net/games/games/' + nr + '.swf&quot; quality=&quot;high&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;a href=&quot;http://www.layoutcodes.net&quot;&gt;&lt;img src=&quot;http://img152.imageshack.us/img152/6075/games0vq.gif&quot;&gt;&lt;/a&gt;&nbsp;&lt;a href=&quot;http://www.layoutcodes.net&quot;&gt;Profile Games&lt;/a&gt;'
}
function gameChange()
{
if (xmlhttp2.readyState==4)
  {
  if (xmlhttp2.status==200)
    {


data = xmlhttp2.responseText;
process(data);
setTimeout("rand()", 9000);
  }
 
  }
}
function process(data) {
var arr = data.split(":"); //0=hits 1 = image 2 = name
document.getElementById("rand").innerHTML = "<span style=\"color:#2b7dd1\">Random Layout</span><br />" + "<a href=\"get.php?id=" + arr[3] + "\"><img src=\"thumbs/" + arr[1] + "\"></a><br />Name: " + arr[2] + "<br />Hits:"  + arr[0] + "";

}
