//this javascript check if the link is an external link and apply the tracker code

function isMp3DownloadLink(className){
	var bIsMp3Link = false;
	
	if (className == 'mp3-download') {
		bIsMp3Link = true;
	}

	return bIsMp3Link;
}

//the main function
function checkMp3Download(){
	var a = document.getElementsByTagName("a");
	
	for (var i=0;i<a.length;i++){
		
		if(isMp3DownloadLink(a[i].className)){

			a[i].onclick = function(){
				// track Mp3 download event
				pageTracker._trackEvent('Downloads', 'MP3', this.rel);
				
			}
		}
	};
	
}

//load the function on DOM ready or window load

//prototype
Event.observe(window, 'load', checkMp3Download);
