var host = document.location.host;
var ext = [".pdf", ".doc", ".xls", ".ppt", ".mp3" ];

function autotag() {
	for (var i=0; i<document.links.length; i++ )
	{
		if (document.links[i].href.indexOf(host) == -1) 
		{
			//external link
			if (document.links[i].target == "_blank")
			{
				//If opening in new window, we don't want to use any delay
				//If we delay, link will open in popup, then after the delay open in the current window
				document.links[i].onclick = function() { return ntptLinkTag(this, -1); }; 
			}
			else
			{
				document.links[i].onclick = function() { return ntptLinkTag(this); }; 
			}

		}
		else
		{
			for (var j=0; j<ext.length; j++)
			{
				if (document.links[i].href.indexOf(ext[j]) > -1)
				{
					//non-HTML link
					if (document.links[i].target == "_blank")
					{
						document.links[i].onclick = function() { return ntptLinkTag(this, -1); };
					}
					else
					{					
						document.links[i].onclick = function() { return ntptLinkTag(this); };
					}
				}
			}
		}
	};
}


if(window.attachEvent) {
	window.attachEvent("onload", autotag ); //IE specific function, supported by IE5+
} else if(window.addEventListener) {
	window.addEventListener("load", autotag, true); //DOM 2.0 spec, supported by Mozilla
}