//	Games.Tracking.js: Gameplay tracking functions
var x = false;
var t0 = new Date;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try { x = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {
	try { x = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (E) { x = false; }
}
@end @*/

if (!x && typeof XMLHttpRequest != 'undefined') x = new XMLHttpRequest();

function SendTime(nID) {
	if (!reloading) {
		if (x && nID) {
			var t1 = new Date;
			var t = t1 - t0;

			x.open("GET","/games/WriteTime.asp?timeSpent=" + t + "&gameID=" + nID,true);
			x.send(null);
		}

		window.open("/gamepad/play/games/ThanksForPlaying.asp?gameID=" + nID,"ThanksForPlaying","width=550,height=400");
	}
}