﻿/* base.js */
var G={w:window,d:document,g:navigator.product=='Gecko',start:new Date(),
init:function(){for(var n in G)if(G[n].init)G[n].init()},
set:function(a,b){for(var o in b)a[o]=b[o];return a},
next:function(a){setTimeout(a,0)},
time:function(a){return (a||new Date()).getTime()},
create:function(a,b,c,d){var o=(d||G.d).createElement(a);G.set(o,b);G.set(o.style,c);return o},
append:function(a,b,c,d){var o=b.tagName?b:G.create(b,c,d);a.appendChild(o)},
_:function(){return G.w.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP')},
load:function(a,b){var o=G._();o.open('GET',a,false);o.send(null);return b?o.responseText:o.responseXML},
get:function(a){return G.load(a,1)},
xml:function(a){
	if(G.g)return new DOMParser().parseFromString(a,'text/xml')
	var o=new ActiveXObject('Microsoft.XMLDOM');o.async=false;o.loadXML(a);return o
},
string:function(a,b){
	if(G.g){
		if(b){var o=new XSLTProcessor();o.importStylesheet(b);a=o.transformToFragment(a,G.d)}
		return new XMLSerializer().serializeToString(a)
	}
	return b?a.transformNode(b):a.xml
},
text:function(a){return (a.text)?a.text:a.textContent}
},
$=function(a,b){return (b||G.d).getElementById(a)},
$$=function(a,b){return (b||G.d).getElementsByTagName(a)},
$a=function(a,b){return a.getAttribute(b)}
//G.w.onload=G.init

function sendfeedback(url,data) {
        if (window.XMLHttpRequest){ // if Mozilla, Safari etc or IE7
		requestobj = new XMLHttpRequest();
		if (requestobj.overrideMimeType) requestobj.overrideMimeType('text/xml');
	}
	else if (window.ActiveXObject){ // if IE, not IE7
		try {
			requestobj = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				requestobj = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				return false;
			}
		}
	}
//	var url="http://www.giplt.nl/adventurefeedback.php";
//	data="location="+document.getElementById("feedback1").value+"&command="+document.getElementById("feedback2").value;
	requestobj.open('POST', url, true);
	requestobj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	requestobj.setRequestHeader("Content-length", data.length);
	requestobj.setRequestHeader("Connection", "close");
	requestobj.send(data);
	return true;
}
