﻿function PulseIt() {
    var str = "string";
    var doIt = false;
    if (pulse) {
        if (typeof (g_id) === str) {
            pulse.setPartnerId(g_id);
            doIt = true;
        }
        if (typeof (g_sid) === str) {
            pulse.setSite(g_sid);
            doIt = true;
        }
        if (typeof (g_prf) === str) {
            pulse.set("prf", g_prf);
            doIt = true;
        }
        if (typeof (g_pty) === str) {
            pulse.set("pty", g_pty);
            doIt = true;
        }
        if (typeof (g_pce) === str) {
            pulse.set("pce", g_pce);
            doIt = true;
        }
        if (typeof (g_onm) === str) {
            pulse.set("onm", g_onm);
            doIt = true;
        }
        if (typeof (g_ovl) === str) {
            pulse.set("ovl", g_ovl);
            doIt = true;
        }
        if (typeof (g_cids) != "undefined" && g_cids instanceof Array) {
            for (var i = 0; i < 5 && i < g_cids.length; i++) {
                pulse.add("cid", g_cids[i]);
                doIt = true;
            }
        }
        if (typeof (g_pids) != "undefined" && g_pids instanceof Array) {
            for (var i = 0; i < 5 && i < g_pids.length; i++) {
                pulse.add("pid", g_pids[i]);
                doIt = true;
            }
        }
        if (doIt) {
            pulse.pulse();
        }
    } 
}
$(document).ready(function() {
    PulseIt();
});
