

function addReferrerImage() {
    try {
        var l = '';
        if (document.referrer && document.referrer != "") {
            l = 'ref=' + escape(document.referrer);
        }

        if (document.URL && document.URL != "") {
            l = l + (l == '' ? '' : "&") + 'url=' + escape(document.URL);
        }

        if (navigator.userAgent && navigator.userAgent != "") {
            l = l + (l == '' ? '' : "&") + 'userAgent=' + escape(navigator.userAgent);
        }

        if (l != '') {
            document.write('<img width="1" height="1" src="/images/tr.gif?'+l+'">');
        }
    } catch (e) {
    }
}

function writeSupportContact(text, extraHTML) {
    writeContactLink("support", text, extraHTML);
}

function writeSalesContact(text, extraHTML) {
    writeContactLink("sales", text, extraHTML);
}

function writeInfoContact(text, extraHTML) {
    writeContactLink("info", text, extraHTML);
}

function writeContactLink(user, text, extraHTML) {
    var mt = "mailto:";
    var at = "@";
    var d1 = "papercut";
    var dot = ".";
    var d2 = "com";

    var e = user + at + d1 + dot + d2;
    var t = e;
    if (typeof(text) == "string" && text != "") {
        t = text
    }

    var html = '<a href="' + mt + e + '" ' + (extraHTML ? extraHTML : '') + ' >' + t + '</a>';
    //alert(html);
    document.write(html);
}

function downloadWindowForIE(uri) {
  if (navigator.userAgent.match(' MSIE ') != null) {
    window.open(uri, '_blank', 'width=100,height=100');
  }
}
