﻿
var mydt;
function getgmt() {
    var dt = new Date();
    var tzone = dt.getTimezoneOffset();
    var gmtfh = (tzone >= 0) ? "0" : "1";
    tzone = (tzone >= 0) ? tzone : -tzone;
    var gmthour = tzone / 60;
    var gmtmin = tzone % 60;
    gmthour = (gmthour >= 10) ? gmthour : "0" + gmthour;
    gmtmin = (gmtmin >= 10) ? gmtmin : "0" + gmtmin;
    gmt = gmtfh + "" + gmthour + "" + gmtmin;
    return gmt;
}

function getkeyword() {
    var urlnow = document.referrer;
    if (urlnow.indexOf("google") >= 0) {
        urlnow = decodeURIComponent(urlnow);
    }
    else if (urlnow.indexOf("baidu") >= 0) {
        urlnow = decodeURIComponent(urlnow);
    }
    else {
        urlnow = "";
    }
    return urlnow;
}

function getFatherPage() {
    var urlnow = document.referrer;
    return urlnow;
}


function tradelog(to_uid, from_uid, trade_id, kind) {
    d = new Date();
    if (document.images) {
        (new Image()).src = "http://click.bmindex.com/account.aspx?" + "&to_uid=" + to_uid + "&from_uid=" + from_uid + "&trade_id=" + trade_id + "&kind=" + kind + "&keyword=" + escape(getkeyword()) + "&fatherPage=" + escape(getFatherPage());
    }
    return true;
}

function companylog(to_uid, from_uid, kind) {
    d = new Date();
    if (document.images) {
        (new Image()).src = "http://click.bmindex.com/account.aspx?" + "&to_uid=" + to_uid + "&from_uid=" + from_uid + "&kind=" + kind + "&keyword=" + escape(getkeyword()) + "&fatherPage=" + escape(getFatherPage());
    }
    return true;
}