window.onload = applyEvents;
function applyEvents()
{
if (!(document.getElementById && document.getElementsByTagName))
{
return;
}
var links = document.getElementsByTagName("a");
var link;
for (var i = 0; i < links.length; i++)
{
link = links[i];
if (link.href != "" && (((link.host == location.host || link.hostname == location.host) && link.hash.search(/^#[0-9]+[ap]?$/) != -1) ||
(link.name.search(/^[0-9]+[ap]?$/) != -1)))
{
link.onclick = trackClick;
}
}
}
var imgSrc = "";
var imgT;
function trackClick(e)
{
var e = (typeof e != "undefined")? e : event;
imgT = new Image(1, 1);
if (this.hash && this.hash != "")
{
imgSrc = "http://www.multylinks.net/click/link/" + this.hash.replace(/[#a]/, "") + "/";
imgT.src = imgSrc;
}
else if (this.name && this.name != "")
{
imgSrc = "http://www.multylinks.net/click/link/" + this.name + "/";
imgT.src = imgSrc;
}
return true;
}
window.onunload = function ()
{
if (imgSrc != "" && !imgT.complete)
{
imgT = new Image(1, 1);
imgT.src = imgSrc;
}
}
