	function createAjaxObj(){
		var httprequest=false;
		if (window.XMLHttpRequest){ // if Mozilla, Safari etc
			httprequest=new XMLHttpRequest()
			if (httprequest.overrideMimeType)
				httprequest.overrideMimeType('text/xml')
		}
		else if (window.ActiveXObject){ // if IE
		try {
			httprequest=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e){
			try{
				httprequest=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){}
			}
		}
		return httprequest;
	}

	var ao=new Object()
	ao.basedomain="http://"+window.location.hostname;
	ao.obj=createAjaxObj();
	ao.filetype="txt";
	
	ao.getAjaxRequest=function(url, parameters, callbackfunc, filetype){
		ao.obj=createAjaxObj(); //recreate ajax object to defeat cache problem in IE
		if(parameters != "") {
			parameters = parameters + "&"
		}
		var parameters = parameters + "anticache="+new Date().getTime();
		if (this.obj){
			this.filetype=filetype;
			this.obj.onreadystatechange=callbackfunc;
			this.obj.open('GET', url+"?"+parameters, true);
			this.obj.send(null);
		}
	}
	function output_scores() {
		var myao = ao.obj;
		if (myao.readyState == 4) {
			if (myao.status==200 || window.location.href.indexOf("http")==-1){
				document.getElementById('c_scores_content').innerHTML = myao.responseText;
			}
			else if (myao.status==404) {
				document.getElementById('c_scores_content').innerHTML = "Snitch Cast Not Found.";
			}
			else if (myao.status>500) {
				document.getElementById('c_scores_content').innerHTML = "Server Error " + myao.status + ".";
			}
			setTimeout("do_scores()", 10000);
		}
	}
	
	setTimeout("do_scores()", 1000);

	function popup_snitchcast(gameid) {
		scSnitchCast = window.open("snitchcast/index.asp?gid="+gameid,'SnitchCast','scrollbars=no,status=no,width=300,height=400,resizable=no');
	}
	
	function popup_sharptracker(gameid) {
		scSharpTracker = window.open("snitchcast/sharptracker.asp?gid="+gameid,'SharpTracker','scrollbars=no,status=no,width=300,height=400,resizable=no');
	}
	
