var
	isIE = document.all?1:0,
	isSF = navigator.userAgent.indexOf('Safari')>=0,
	hitinit = 0, hitEl = null;

function hitInit() {
	if(hitinit++)return;
	var l,linkz = document.getElementsByTagName("a");
	for(var x=0;l=linkz[x];x++)if(!l.onclick){l.onclick=(isSF||isIE)?hitClickW:hitClick;if(!isIE)l.onmousedown=hitDown}
	//hitView()
}
function zona(ele){
	ele = $(ele);
	var old ='';
	var insere = false;
	var results = new Array();
	ele.ancestors().each(function(el){
 		if(el.readAttribute('log')!== null )
		{
			 results.push(el.readAttribute('log'));
		}
		
		});

	old = results.join('-');
	if(old.indexOf('skip')==-1 && (ele.readAttribute('href').indexOf('sapo.pt') != -1 || ele.readAttribute('href').indexOf('.') ==-1  ) )
	{
		return old;
	}

return '';
}
function hU(u){return u.replace(/&/g,'%26').replace(/=/g,'%3D').replace(/#/g,'%23').replace(/;/g,'%3B')}
function hitDown(e){if((e?e:event).button==1){this.onmouseup=hitUp;hitEl=this}}
function hitUp(e){if(hitEl==this)(isSF||isIE)?hitFireW(e,this):hitFire(e,this);hitEl=null}
function hitMCoords(e){return "M="+(isIE?((event.clientX+document.body.scrollLeft)+"x"+(event.clientY+document.body.scrollTop)):(e.pageX+"x"+e.pageY))}
function hitSSize(){return "S="+screen.width+"x"+screen.height}
function hitURL(e,l){return "/hit.php?U="+hU(l.href)+"&"+hitMCoords(e)+"&"+hitSSize(e)+"&R="+hU(location.href)+"&Z="+zona(l)}
function hitClick(e,l){if(!l)l=this;(new Image).src=hitURL(e,l);return true}
function hitClickW(e,l){if(!l)l=this;var i=(new Image);i.onerror=function(){location.href=l.href};i.src=hitURL(e,l);return false}
//function hitView(){return false;(new Image).src="/hit.php?U="+hU(location.href)+"&"+hitSSize()+"&R="+hU(document.referrer)+"&T=v"}
isIE?attachEvent("onload",hitInit):addEventListener("load",hitInit,false);

