
lastTimeClick = 0;

document.onmousedown = function (e) {
		//alert('click');
		/*if(!confirm(p  + ' : ' +e[p]))
			break;
		*/


		var myDate=new Date();
		var tim = myDate.getTime();

		if(tim - lastTimeClick >=1000) {

			lastTimeClick = tim;
			var posx = 0;
			var posy = 0;
			if (!e) var e = window.event;
			if (e.pageX || e.pageY)
			{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY)
			{
				posx = e.clientX + document.body.scrollLeft;
				posy = e.clientY + document.body.scrollTop;
			}

			topLeftElement = gid('global');

			posx -= findPosX(topLeftElement);
			posy -= findPosY(topLeftElement);
			
			/**
				On arrondi au pixel "pair"
				Censer diminuer le temps de traitement pour la restitution
			*/
			posx = posx %2 ? posx+1 : posx;
			posy = posy %2 ? posy+1 : posy;
			
			if(window.XMLHttpRequest) // Firefox
				var http = new XMLHttpRequest();
			else if(window.ActiveXObject) // Internet Explorer
				var http = new ActiveXObject("Microsoft.XMLHTTP");
			else { // XMLHttpRequest non supporté par le navigateur
				return true;
			}

			http.open("GET", '/saveclick.php?x='+posx+'&y='+posy+'&url='+window.location, false);

			http.send(null);
		}
		return true;

}




