var Live = {
	
	Data:0,
	
	Get:function(url){
		//if(Live.Req == 0){
			try{
				R = new XMLHttpRequest();
			}
			catch(e){
				try{
					R = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e){
					try{
						R = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (failed){
						R = 0;
					}
				}
			}
			R.open("GET", url, true);
			R.onreadystatechange = function(){
				switch(R.readyState) {
				case 4:
					if(R.status!=200) {
						alert("Fehler:"+R.status+", Text:" + R.statusText);
					}else{
						// Die Antwort wird gespeichert und weiter verarbeitet
						Live.Data = R.responseText;
					}
				break;
				default:
					return false;
				break;
				}
			};
			R.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			R.send(null);
		//}
	},
	
	Refresh:function(){
		if(document.getElementById("liveview")){
			var l = document.getElementById("liveview");
			var url = "http://www.browsergame-ads.de/request/liveview.php?live=on";
			Live.Get(url);
			if(Live.Data != 0){
				var func = new Function("return "+Live.Data);
				var obj = func();
				l.innerHTML = obj.live;
				Live.Data = 0;
			}
			window.setTimeout("Live.Refresh()", 1000);
		}
	}
	
}

//window.setTimeout("Live.Refresh()", 999);
window.onload = new Function("Live.Refresh(); return false;");
