/**
 * Run after loading
 */

function addLoadEvent(func) {
  	var oldonload = window.onload;
	  	if (typeof window.onload != 'function') {
	    	window.onload = func;
	  	} else {
	    	window.onload = function() {
		      	oldonload();
		      	func();
	    	}
  		}
}

function xmlhttpPOST(strURL) {
    var http = false;
	if(navigator.appName == "Microsoft Internet Explorer") {
	  http = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
	  http = new XMLHttpRequest();
	}
	http.open("POST", location.protocol + "//" + location.host + "/iWP_jsLogging/" , true);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	http.send(strURL);
}

addLoadEvent(function() {
	if (log_key != "") {
		var strURL =  "K=" + log_key + "&W=" + screen.width + "&H=" + screen.height + "&CD=" + screen.colorDepth;
		xmlhttpPOST(strURL);
	}
});

