﻿
function AddGATracking(GaArray) {
    for (i = 0; i < GaArray.length; i++) {
        $("." + GaArray[i][0]).each(
            function (intIndex) {
                var Lbl = GaArray[i][3];
                if (Lbl == "custom-value") {
                    Lbl = $(this).val() == "" ? $(this).html() : $(this).val();
                }
                else if (Lbl == "custom-alt")
                    Lbl = $(this).attr("alt");
                else if (Lbl == "custom-title")
                    Lbl = $(this).attr("title");
                $(this).attr("onclick","_gaq.push(['_trackEvent','" + GaArray[i][1] + "','" + GaArray[i][2] + "','" + Lbl + "']);");
            });
    }
}
