function trackLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=anchors.length-1; i>=0; i--) {
		var anchor = anchors[i];
		if (	typeof(anchor.href) != 'undefined' &&
			anchor.href.length > 0 &&
			anchor.href != '#'
		) {
			anchor.onclick = function() {
				log(document.location, this);
			}
                }
        }
}

function log(location, aObj) {
	var href = aObj.href;
	var name = aObj.name;
	if (name.search(/kt.+/) != -1) {
		var postData = 'href=' + escape(href) + '&properties=' + name;
		var AJAX = null;
		if (window.XMLHttpRequest) {
			AJAX = new XMLHttpRequest();
		} else {
			AJAX = new ActiveXObject("Microsoft.XMLHTTP");
		}
		if (AJAX == null) {
			return false;
		} else {
			AJAX.open("POST", "http://www.klick-tipps.net/?type=9812", false);
			AJAX.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			AJAX.setRequestHeader("Content-Length", postData.length);
			AJAX.setRequestHeader("Connection", "close");
			AJAX.send(postData);
		}
	}
}