$(function(){
	var tnguid=null;
	if ( document&&document.cookie&&(res=document.cookie.match(/tnguid=([a-zA-Z0-9\-]{36})/))) {
		tnguid=res[1];
	} else { 
		tnguid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }).toUpperCase();
		document.cookie="tnguid="+escape(tnguid)+"; path=/";
	}

	$.ajax( { async: true, type: "POST", url: "/tracker/view.php", data: { ua: navigator.userAgent, location: ""+window.location, guid: tnguid } } );
	$("a img").parent().click(function(){
		$.ajax( { async: true, type: "POST", url: "/tracker/click.php", data: { ua: navigator.userAgent, href: $(this).attr("href"), location: ""+window.location, guid: tnguid } } );
		return true;
	});
});

