var stat = {
    sURL: "http://log.dahei.com/stat.htm",
    visit: function($, A, bk) {
        // 回调处理
        bk = bk || null;
        // 取当前点击节点
        var evt = window.event || (arguments.callee && arguments.callee.caller && arguments.callee.caller.arguments[0]);

        if (evt && typeof evt == 'object' && !bk) {
            try {
                // 操作延时回调
                var isTrigger = evt.isTrigger || false;
                var that = evt.srcElement || evt.target;
                var nodeName = that.nodeName && that.nodeName.toLowerCase();
                if (that && !isTrigger && nodeName && nodeName!='#document') {
                    // 存在触发节点，且非自动代码触发
                    // 添加统计
                    var _ = new Image();
                    _.src = this.sURL + "?app=" + $ + "&from=" + (A || 0) + "&r=" + Math.random();

                    var target = (that && that.getAttribute && that.getAttribute('target')) || '';
                    var href = (that && that.getAttribute && that.getAttribute('href')) || '';
                    // 检测是否为本窗口跳转
                    if (nodeName == 'a' && target != '_blank' && (!href || !/^\sjavascript:/.test(href))) {
                        bk = function() {
                            window.location = href;
                        };

                        if (typeof bk == 'function') setTimeout(function(){bk();}, 200);
                        return false;
                    } else {
                        return true;
                    }
                } else {
                    // 自动代码触发无效
                }
            } catch (unknowE) {
                //
            }
        } else {
            // 添加统计
            var _ = new Image();
            _.src = this.sURL + "?app=" + $ + "&from=" + (A || 0) + "&r=" + Math.random();

            if (typeof bk == 'function') setTimeout(function(){bk();}, 200);
            return false;
        }
    }
}
