/*var DEBUGGATAGS=false;
var hrefs=document.getElementsByTagName("a");

for(var i=0; i < hrefs.length; i++)
{
	var current_href = hrefs[i];
	try
	{
		var tracker = getTracker(current_href);
		if (tracker == null)
			continue;
		if (current_href.addEventListener)
			current_href.addEventListener("click",tracker,true);
		else if (current_href.attachEvent)
			current_href.attachEvent("onclick",tracker);
	}
	catch(err){}
}

function getTracker(href)
{
	if (href.hostname.length == 0)
	{
		if (href.toString().match(/^mailto:/i))
			return trackmailto;
		return null;
	}
	if ((location.host != href.hostname)
		|| (href.pathname.match(/\.(doc|pdf|xls|ppt|zip|txt|rar|exe|wma|mov|avi|wmv|mp3)$/)))
		return trackfiles;
	return null;
}

function trackfiles(array_element){
	var sourceElement = getSourceElement(array_element);
	var file_path="";
	var destination_host=(sourceElement)?sourceElement.hostname:this.hostname;
	
	if (!destination_host || destination_host == null || destination_host.length == 0)
		return;
	
	destination_host = removeHttpFromUrl(destination_host);
	
	if(location.host!=destination_host){
		file_path="/virtual/exlink/"+cleanURL(window.location,true)+'/'+destination_host;
		file_path=file_path+((sourceElement)?"/"+cleanURL(sourceElement.pathname,false):this.pathname);
		file_path=cleanAssetsFilePath(file_path);
	} else {
		file_path=((sourceElement)?"/"+sourceElement.pathname:this.pathname);
		file_path=cleanAssetsFilePath(file_path);
		var file_details=file_path.split('/');
		file_path=cleanURL(window.location,true)+'/'+file_details[(file_details.length-1)];
		file_path=(("/virtual/download/")+file_path);
	}
	
	AlertDebugGatag(file_path);
	pageTracker._trackPageview(file_path);
	
	function getSourceElement(element)
	{
		var sourceElement = element.srcElement;
		if (sourceElement)
			return (sourceElement.tagName == "A")? sourceElement: sourceElement.parentNode; //bug in IE with link containing images
	}
}

function AlertDebugGatag(path)
{
	if (DEBUGGATAGS)
		alert("EUFES Acceptance Test for Google Analytics (don't panic):\r\n\r\n" + path);
}

function trackmailto(array_element){
	var email=((array_element.srcElement)?array_element.srcElement.href:this.href).substring(7);
	var url=cleanURL(window.location,true);
	var mail_path='/virtual/mailto/'+url+'/'+email;
	AlertDebugGatag(mail_path);
	pageTracker._trackPageview(mail_path);
}
function cleanURL(url,end)
{
	var url=url.toString();
	var urlLen=url.length;
	
	if(end)
	{
		if(url.charAt((urlLen-1))=='/') 
			url=url.substring(0,(urlLen-1));
	} 
	else if (url.charAt(0)=='/')
		url=url.substring(1,urlLen);
	
	return removeHttpFromUrl(url);
}

function removeHttpFromUrl(url)
{
	return url.replace(/^http[s]?:\/\//, "");
}

function cleanAssetsFilePath(filePath)
{
	if(filePath.indexOf("/assets/content/")>=0)
		filePath = filePath.replace(/_[A-F0-9]{32}\./,".");
		
	return filePath;
}*/
