// autoga v1.1 - copyright 2010 authdl - authdl@gmail.com
function get_ir() {
    var dcs = document.cookie;
    var gasor = /utmcsr=\(?(.+?)\)?\|/i.exec(dcs);
    var gacpn = /utmccn=\(?(.+?)\)?\|/i.exec(dcs);
    var ir = gasor[1] + ' - ' + gacpn[1];
    return ir;
}
function gapv(ppv) {
    if (ppv != '') { _gaq.push(['_trackPageview', ppv]); }
    else { _gaq.push(['_trackPageview']); }
}
function gair() {
    var dcs = document.cookie;
    if (!dcs.match(/__utma=/)) {
        _gaq.push(function() { _gaq.push(['_setCustomVar', 1, 'Initial Referrer', get_ir(), 1]); });
        _gaq.push(function() { _gaq.push(['_trackEvent', 'Initial Referrer', get_ir()]); });
    }
}
$(document).ready(function() {
    var gadld_flag = true;
    try { gadld_flag = gadld_on; }
    catch(e) {}
    var gasl_flag = true;
    try { gasl_flag = gasl_on; }
    catch(e) {}
    var gasl = '#ShareThis a';
    if (gasl_flag) {
        try { gasl_ex = gasl; }
        catch(e) {}
    }
    if (gadld_flag) {
        $('a[href]').filter(function() {
            return this.href.match('(\.pdf|\.doc|\.docx|\.xls|\.xlsx|\.csv|\.ppt|\.pptx)');
        }).click(function() {
            var dld_result = /\/([a-z0-9-_]+\.(pdf|doc|docx|xls|xlsx|csv|ppt|pptx))$/i.exec(this.href);
            _gaq.push(['_trackPageview', '/download/' + dld_result[1]]);
        });
    }
    if (gasl_flag) {
        $(gasl_ex).click(function() {
            if ($(this).attr('rel') == undefined) {
                var sl_out = /^http:\/\/(.+)\//i.exec(this.href);
                var sl_result = sl_out[1]
            }
            else { var sl_result = $(this).attr('rel'); }
            _gaq.push(['_trackPageview', '/share/' + sl_result]);
        });
    }
});

