var indexulinks = document.getElementsByTagName("a");
for(i = 0; i < indexulinks.length; i++) {
    if (indexulinks[i].name != '' && (indexulinks[i].name.indexOf("link") != -1 || indexulinks[i].name.indexOf("cat") != -1)) {
        indexulinks[i].onclick = indexu_click;
        indexulinks[i].oncontextmenu = indexu_click;
    }
}

function indexu_click() {
    
    // IndexU tracking
    if (document.images) {
        img = new Image();
        img.src = "trackclick.php?id=" + this.name;
        var date = new Date();
        do {
            var curDate = null;
            curDate = new Date();
        }
        while(curDate-date < 300);
        date = null;
        curDate = null;
    }
    
    // Google Analytics tracking (-DJM)
    if (this.name.substring(0, 5) == "link_") {
        var category = "Click website link";
        var action = "Listing " + this.name.substring(5);
        try {
            pageTracker._trackEvent(category, action);
            if (!this.target) {
                setTimeout('document.location = "' + this.href + '"', 100)
                return false;
            }
        }
        catch(err){}
    }
    
    return true;
    
}

