﻿///////////////////////////////////////////////////////////////////////

function Marquee() {
    var List = new Array();
    List[0] = '<a href="#" class="alink_red">严正声明：坚决维护绿色和谐网络环境，禁止从事违法交易&nbsp;2011-07-12</a>';
    List[1] = '<a href="#AddFavorite">一夜情伊甸园，致力于打造最专业的同城一夜情网站！&nbsp;2011-06-18</a>';

    var marqueeInterval = new Array();
    var marqueeId = 0;
    var marqueeDelay = 2000;
    var marqueeHeight = 26;
    var marqueeBox = null;
    this.init = function (target) {
        if ($(target).length<1) {
            return;
        }
        marqueeBox = $('<div id="_marqueeBox" style="overflow:hidden;height:' + marqueeHeight + 'px">');
        var str = List[0];
        var $this = this;
        $(marqueeBox).appendTo($(target));
        $(marqueeBox).bind("mouseover", function () {
            clearInterval(marqueeInterval[0]);
        });
        $(marqueeBox).bind("mouseout", function () {
            marqueeInterval[0] = setInterval($this.start, marqueeDelay)
        });
        $(marqueeBox).html('<div>' + str + '</div>');
        marqueeId++;
        marqueeInterval[0] = setInterval(this.start, marqueeDelay);
    }
    this.start = function () {

        var str = List[marqueeId];
        marqueeId++;
        if (marqueeId >= List.length) marqueeId = 0;
        if ($(marqueeBox).children().length == 1) {
            var nextLine = document.createElement('div');
            nextLine.innerHTML = str;
            $(marqueeBox).append(nextLine);
        }
        else {
            var _childs = $(marqueeBox).children();
            if (_childs.length > 0) {
                $(_childs[0]).html(str);
                $(marqueeBox).append(_childs[0]);
                $(marqueeBox).scrollTop(0);
            }
        }
        clearInterval(marqueeInterval[1]);
        //marqueeInterval[1] = setInterval(this.scroll, 10);
    }
    this.add = function (line) {
        List.push( line);
    }
    this.scroll = function () {
        var top = $(marqueeBox).scrollTop();
        $(marqueeBox).scrollTop(top + 1);
        if ($(marqueeBox).scrollTop() % marqueeHeight == marqueeHeight) {
            clearInterval(marqueeInterval[1]);
        }
    }
    return this;
}


///////////////////////////////////////////POP/////////////////////////
var _currentPOP = null;
var $MARQUEE = null;
var ua = navigator.userAgent;
var $IE = (navigator.appName == "Microsoft Internet Explorer");
var $IE5 = $IE && (ua.indexOf("MSIE 5") != -1);
var $IE5_0 = $IE && (ua.indexOf("MSIE 5.0") != -1);
var $Gecko = ua.indexOf("Gecko") != -1;
var $Safari = ua.indexOf("Safari") != -1;
var $Opera = ua.indexOf("Opera") != -1;
var $Mac = ua.indexOf("Mac") != -1;
var $NS7 = ua.indexOf("Netscape/7") != -1;
var $NS71 = ua.indexOf("Netscape/7.1") != -1;
if ($Opera) {
    $IE = true;
    $Gecko = false;
    $Safari = false
}
if ($IE5) {
    $IE = true;
    $Gecko = false;
    $Safari = false
}
function $_t(b, a, e) {
    var c = b.getElementsByTagName(a);
    for (var d = 0; d < c.length; d++) {
        if (c[d].id == e) {
            return c[d]
        }
    }
    return null
}
function _(a) {
    var f = arguments;
    var g = 0;
    if (typeof (a) == "string") {
        a = document
    } else {
        g = 1
    }
    for (var d = g; d < f.length; d++) {
        var e = a.getElementsByTagName("*");
        var c = false;
        for (var b = 0; b < e.length; b++) {
            if (e[b].id == f[d]) {
                a = e[b];
                c = true;
                break
            }
        }
        if (!c) {
            return null
        }
    }
    return a
}
function $dele(o, fn, rv) {
    var r = function() {
        var s = arguments.callee;
        var args = [];
        for (var i = 0; i < s.length; i++) {
            args[i] = s[i]
        }
        var argStr = args.join(",");
        if (argStr.length > 0) {
            argStr = "," + argStr
        }
        var callStr = "s.thiz[s.fn](" + argStr + ")";
        var v = eval(callStr);
        if (s.rv != null) {
            return s.rv
        } else {
            return v
        }
    };
    r.thiz = o;
    r.fn = fn;
    r.rv = rv;
    return r
}
function $ge(a) {
    if (a != null) {
        return a
    }
    if ($IE) {
        return window.event
    } else {
        return a
    }
}
function $gte(b, a) {
    if (!b.getElementById) {
        b = b.ownerDocument
    }
    if ($IE) {
        return a != null ? a : b.parentWindow.event
    } else {
        return a;
        throw new Error("this method can only execute in IE")
    }
}
function $addEL(h, g, f, d) {
    if ($IE) {
        if (h["$__listener_" + g] == null) {
            var c = function(l) {
                var k = arguments.callee;
                var b = k.fList;
                l = $ge(l);
                for (var j = 0; j < b.length; j++) {
                    b[j](l)
                }
            };
            c.fList = [];
            h["$__listener_" + g] = c;
            h["on" + g] = h["$__listener_" + g]
        }
        var a = h["$__listener_" + g].fList;
        a[a.length] = f
    } else {
        h.addEventListener(g, f, d)
    }
}
function $cancelEvent(a) {
    if ($IE) {
        a.returnValue = false;
        a.cancelBubble = true
    } else {
        a.preventDefault()
    }
}
function $cpAttr(d, c) {
    for (var a in c) {
        var b = c[a];
        d[a] = b
    }
    return d
}
function $getValue(a, b) {
    return a == null ? b : a
}
var $gv = $getValue;
var $dom = {
    parseInt: function(a) {
        if (a == null || a == "" || typeof (a) == "undefined") {
            return 0
        }
        return parseInt(a)
    },
    getClientSize: function(h) {
        if ($IE) {
            var e = {
                x: h.clientLeft,
                y: h.clientTop
            };
            e.l = e.x;
            e.t = e.y;
            e.r = h.clientRight;
            e.b = h.clientBottom;
            e.w = h.clientWidth;
            e.h = h.clientHeight;
            return e
        } else {
            var d = h.style;
            if (d.borderLeftWidth.length == 0 || d.borderTopWidth.length == 0
					|| d.borderRightWidth.length == 0
					|| d.borderBottomWidth.length == 0) {
                var c = h.offsetWidth;
                d.borderLeftWidth = "0px";
                c -= h.offsetWidth;
                var f = h.offsetWidth;
                d.borderRightWidth = "0px";
                f -= h.offsetWidth;
                var g = h.offsetHeight;
                d.borderTopWidth = "0px";
                g -= h.offsetHeight;
                var a = h.offsetHeight;
                d.borderBottomWidth = "0px";
                a -= h.offsetHeight;
                d.borderLeftWidth = c + "px";
                d.borderTopWidth = g + "px";
                d.borderRightWidth = f + "px";
                d.borderBottomWidth = a + "px";
                var e = {
                    l: c,
                    r: f,
                    t: g,
                    b: a,
                    x: c,
                    y: g
                };
                return e
            } else {
                var e = {
                    x: this.parseInt(h.style.borderLeftWidth),
                    y: this.parseInt(h.style.borderTopWidth),
                    r: this.parseInt(h.style.borderRightWidth),
                    b: this.parseInt(h.style.borderBottomWidth)
                };
                e.l = e.x;
                e.t = e.y;
                return e
            }
        }
    },
    getSize: function(e, b) {
        var d = {
            x: e.offsetWidth != null ? e.offsetWidth : 0,
            y: e.offsetHeight != null ? e.offsetHeight : 0
        };
        if (b) {
            var a = this.getMargin(e);
            d.x += a.l + a.r;
            d.y += a.t + a.b
        }
        return d
    },
    setSize: function(e, b, h, f) {
        if ($IE) {
            if (f) {
                var a = this.getMargin(e);
                b -= a.l + a.r;
                h -= a.t + a.b
            }
            e.style.width = b;
            e.style.height = h
        } else {
            var g = this.getClientSize(e);
            var d = g.l + g.r;
            var c = g.t + g.b;
            e.style.width = b - d + "px";
            e.style.height = h - c + "px"
        }
    },
    getPosition: function(b, d) {
        var e;
        e = {
            x: b.offsetLeft,
            y: b.offsetTop
        };
        if (d) {
            var a = this.getMargin(b);
            e.x -= a.l;
            e.y -= a.t
        }
        return e
    },
    setPosition: function(b, a, d, c) {
        if (c) {
        }
        b.style.left = a + "px";
        b.style.top = d + "px"
    },
    setAlpha: function(c, b) {
        return;
        c.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + b
				* 100 + ");";
        c.style.opacity = b;
        c.style.MozOpacity = b
    }
};
var $motion = {
    smooth: function(b, c, a) {
        if (a > 1) {
            a = 1
        }
        return (c - b) * a + b
    }
};
function PopUp(e, a) {
    this.id = e;
    var d = this.config = a;

    d.width = $gv(d.width, 300);
    d.height = $gv(d.height, 200);
    d.bottom = $gv(d.bottom, 0);
    d.right = $gv(d.right, 20);
    d.display = $gv(d.display, true);
    //d.contentUrl = $gv(d.contentUrl, "");
    d.motionFunc = $gv(d.motionFunc, $motion.smooth);
    d.position = {
        x: 0,
        y: 0
    };
    var b = d.time;
    b.slideIn = $gv(b.slideIn, 10);
    b.hold = $gv(b.hold, 10);
    b.slideOut = $gv(b.slideOut, 10);
    b.slideIn *= 1000;
    b.hold *= 1000;
    b.slideOut *= 1000;
    this.container = document.body;
    this.popup = null;
    this.content = null;
    this.switchButton = null;
    this.moveTargetPosition = 0;
    this.startMoveTime = null;
    this.startPosition = null;
    this.status = PopUp.STOP;
    this.intervalHandle = null;
    this.contentHTML = null;
    this.Title = null;
    this.mm = "max";
    this.imgMin1 = "http://img.baidu.com/hi/img/refer/blogrecommend_hz_004.gif";
    this.imgMin2 = "http://img.baidu.com/hi/img/refer/yzq_001.gif";
    this.imgMax = "http://img.baidu.com/hi/img/refer/blogrecommend_hz_003.gif"
}
PopUp.STOP = 0;
PopUp.MOVE_DOWN = 1;
PopUp.MOVE_UP = 2;
PopUp.SWITCH_TO_MIN = PopUp.MOVE_DOWN | 4;
PopUp.SWITCH_TO_MAX = PopUp.MOVE_UP | 8;
var __o = {
    create: function() {

        var h = document;
        var i = this.config;
        var g = this.popup = h.createElement("div");
        this.container.appendChild(g)
        g.id = this.id;
        g.style.cssText = "position:absolute;z-index:65531 !important;overflow:hidden;border:1px solid #E97B00;";
        $dom.setSize(g, i.width, i.height);
        var e = this.content = h.createElement("div");
        g.appendChild(e);
        e.id = this.id + "_content";
        e.style.cssText = "position:absolute;z-index:1;	overflow:hidden;";
        $dom.setSize(e, i.width, i.height);
        $dom.setPosition(e, 0, 0);
        i.position.y = i.height;
        this.onresize();
        this.Title = document.createElement("DIV");
        this.Title.style.width = "314px";
        this.Title.style.height = "35px";
        this.Title.style.backgroundImage = "url(/images/pop_title.jpg)";
        var d = "<a id='closeButton' href='#'></a><a id='switchButton' href='#'></a>";
        e.innerHTML = d;
        e.appendChild(this.Title);
        this.contentHTML = document.createElement("DIV");
        this.contentHTML.id = "ifm_div";
        this.contentHTML.style.height = "260px";
        this.contentHTML.style.width = "300px";
        this.contentHTML.style.backgroundColor = "#FFFFFF";
        if (i.contentUrl != null && i.contentHTML == null) {
            this.win(i.contentUrl);
        }
        else if (i.contentUrl == null && i.contentHTML != null) {
            this.contentHTML.innerHTML = i.contentHTML;
        }
        e.appendChild(this.contentHTML);
        var f = this.switchButton = $_t(e, "a", "switchButton");
        f.style.cssText = 'position:absolute;z-index:2;font-size:0px;line-height:0px;left:275px;top:6px;width:13px;height:13px;background-image:url("http://img.baidu.com/hi/img/refer/blogrecommend_hz_004.gif");';
        $addEL(f, "click", $dele(this, "switchMode"), true);
        $addEL(f, "click", $cancelEvent, true);
        var b = $_t(e, "a", "closeButton");
        b.style.cssText = 'position:absolute;z-index:2;font-size:0px;line-height:0px;left:290px;top:6px;width:13px;height:13px;background-image:url("http://img.baidu.com/hi/img/refer/blogrecommend_hz_003.gif");';
        $addEL(b, "mouseover", function(c) {
            $dom.setAlpha(this, 0.4)
        }, true);
        $addEL(b, "mouseout", function(c) {
            $dom.setAlpha(this, 1)
        }, true);
        $addEL(b, "click", $dele(this, "hide"), true);
        $addEL(b, "click", $cancelEvent, true);
        var a = $IE ? document.body : document.documentElement;
        $addEL(document.body, "resize", $dele(this, "onresize"), true);
        this.__hackTimer = window.setInterval("__popup.onresize()", 50);
        $addEL(a, "scroll", $dele(this, "onresize"), true);
        this.onresize()
    },
    win: function(src) {
        var w = "<iframe id='"
				+ this.id
				+ "_content_iframe' src="
				+ src
				+ " frameborder=0 scrolling=no width='100%' height='100%' allowTransparency='true'></iframe>";

        var _win = document.createElement(w);
        this.contentHTML.appendChild(_win);
    },
    show: function() {
        if (!this.config.display) {
            return
        }
        this.moveTargetPosition = 0;
        this.status = PopUp.MOVE_UP;
        this.startMove()
    },
    hide: function() {
        this.status = PopUp.MOVE_DOWN;
        this.stopMove();
        if (typeof (quitAdSrc) != "undefined" && quitAdSrc != null
				&& quitAdSrc != "" && this.mm == "max") {
            $_t(this.content, "a", "closeButton").style.visibility = "hidden";
            $_t(this.content, "a", "switchButton").style.visibility = "hidden";
            $_t(this.content, "div", "ifm_div").style.visibility = "hidden";
            var b = $_t(this.content, "div", "closeswf_div");
            b.style.visibility = "visible";
            var a = this.popup;
            setTimeout(function() {
                a.innerHTML = ""
                this.container.reoveChild(a);
                _currentPOP = null;
            }, 3500)
        } else {
            this.moveTargetPosition = this.config.height;
            this.status = PopUp.MOVE_DOWN;
            this.startMove()
        }
    },
    minimize: function() {
        this.mm = "min";
        this.moveTargetPosition = this.config.height - 28;
        this.status = PopUp.SWITCH_TO_MIN;
        this.startMove();
        var b = this.switchButton.style;
        var a = b.backgroundImage;
        if (a.indexOf(this.imgMin1) > -1) {
            a = a.replace(this.imgMin1, this.imgMin2);
            b.backgroundImage = a
        }
    },
    maximize: function() {
        if (!this.config.display) {
            return
        }
        this.mm = "max";
        this.moveTargetPosition = 0;
        this.status = PopUp.SWITCH_TO_MAX;
        this.startMove();
        var b = this.switchButton.style;
        var a = b.backgroundImage;
        if (a.indexOf(this.imgMin2) > -1) {
            a = a.replace(this.imgMin2, this.imgMin1);
            b.backgroundImage = a
        }
    },
    delayHide: function() {
        window.setTimeout("__popup.hide()", this.config.time.hold)
    },
    delayMin: function() {
        window.setTimeout("__popup.minimize()", this.config.time.hold)
    },
    switchMode: function() {
        if (this.mm == "min") {
            this.maximize()
        } else {
            this.minimize()
        }
    },
    startMove: function() {
        this.stopMove();
        this.intervalHandle = window.setInterval("__popup.move()", 100);
        this.startMoveTime = new Date().getTime();
        this.startPosition = this.config.position.y
    },
    stopMove: function() {
    },
    move: function() {
        var a = new Date().getTime();
        a = a - this.startMoveTime;
        var b = this.status & PopUp.MOVE_UP
				? this.config.time.slideIn
				: this.config.time.slideOut;
        var c = this.config.motionFunc(this.startPosition,
				this.moveTargetPosition, a / b);
        this.config.position.y = c;
        this.onresize();
        if (a >= b) {
            this.onFinishMove()
        }
    },
    onFinishMove: function() {
        this.stopMove();
        if (this.status == PopUp.MOVE_UP && this.config.time.hold > 0) {
            this.delayMin()
        } else {
            if (this.__hackTimer != null) {
                window.clearInterval(this.__hackTimer)
            }
        }
        this.status = PopUp.STOP
    },
    onresize: function() {
        var g = this.config;
        var e = document.documentElement;
        var e = (document.compatMode.toLowerCase() == "css1compat")
				? document.documentElement
				: document.body;
        var d = e.clientWidth + e.scrollLeft;
        var b = e.clientHeight + e.scrollTop;
        var a = (d - g.right - g.width) - 1;
        var f = (b - g.bottom - g.height + g.position.y) - 1;
        $dom.setPosition(this.popup, a, f);
        $dom.setSize(this.popup, g.width, g.height - g.position.y)
    }
};
$cpAttr(PopUp.prototype, __o);
function job(html, url) {
    var h = {
        width: 314,
        height: 148,
        bottom: 2,
        right: 1,
        display: true,
        contentUrl: url,
        contentHTML: html,
        contentTitle: "新消息",
        time: {
            slideIn: 1,
            hold: 60,
            slideOut: 1
        }
    };
    var n = ["7+7"];
    var c = "once";
    var l = {};
    var k = [];
    for (var g = 0; g < n.length; g++) {
        var b = n[g];
        var e = b.split("+");
        var p = parseInt(e[0]);
        for (var d = 0; d < e.length - 1; d++) {
            e[d] = e[d + 1]
        }
        l[p] = true;
        for (var f = 0; f < e.length; f++) {
            l[p + parseInt(e[f])] = true
        }
    }
    n = [];
    for (var g in l) {
        var q = parseInt(g);
        if (isNaN(q)) {
            continue
        }
        n[n.length] = q
    }
    n = n.sort();
    function a() {
        if (_currentPOP != null) {
            if (h.contentHTML != null && h.contentUrl == null) {
                _currentPOP.contentHTML.innerHTML = h.contentHTML;
                //_currentPOP.Title.innerText = h.contentTitle;
            }
            else if (h.contentHTML == null && h.contentUrl != null) {
                _currentPOP.win(h.contentUrl);
            }
            _currentPOP.show();
        }
        else {
            var i = new PopUp("xp", h);
            window.__popup = i;
            i.create();
            i.show()
            _currentPOP = i;
        }
    }
    a()
}
function showPOP(html, url) {
    if ($IE) {
        if (document.readyState == "loaded"
				|| document.readyState == "complete") {
            job(html, url)
        } else {
            window.setTimeout(function() { showPOP(html, url) }, 500);
            return
        }
    } else {
        job(html, url)
    }
}



/////////////////////////////////////////////////
var _DOMAIN = "31jy.com";
var _SOURCE = "http://www.31jy.com/run/client.ashx";
//var _DOMAIN = "192.168.1.18";
//var _SOURCE = "http://192.168.1.18/run/client.ashx";
var _MSGS = new Array();
var _RUN = false;
var _INTERVALID = 0;
var _ISONLINE = false;
var _TIMEOUTID = 0;
var CURRENTPAGEID = 0;
function AddCookie(name, value, hour) {//添加cookie
    var str = name + "=" + escape(value);
    if (hour > 0) {//为0时不设定过期时间，浏览器关闭时cookie自动消失
        var date = new Date();
        var ms = hour * 3600 * 1000;
        date.setTime(date.getTime() + ms);
        str += "; expires=" + date.toGMTString();
    }
    document.cookie = str;
}

function GetCookie(name) {//获取指定名称的cookie的值
    var arrStr = document.cookie.split("; ");
    for (var i = 0; i < arrStr.length; i++) {
        var temp = arrStr[i].split("=");
        if (temp[0] == name) return unescape(temp[1]);
    }
    return null;
}

function DelCookie(name) {//为了删除指定名称的cookie，可以将其过期时间设定为一个过去的时间
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = name + "=a; expires=" + date.toGMTString();
}

function Call(method, args) {

    this.Method = method;
    this.Args = args;
    return this;
}
function Sync() {
    if (GetCookie("ONLINESESSION") != null) {
        if (parseInt(GetCookie("ONLINESESSION")) != CURRENTPAGEID) {
            clearInterval(_INTERVALID);
            clearTimeout(_TIMEOUTID);
            _INTERVALID = 0;
            return;
        }
    }
    $.get(
      _SOURCE, // 请求的URL
      {cmd: "100", r: Math.random() },
      function(data) { onResult(data); }
      , "xml"
      );

}
function Connect() {
    $.get(
          _SOURCE, // 请求的URL
          {cmd: "101",session:1, r: Math.random() },
          function() { }
          );
}
function UnOnline() {
    $.get(
          _SOURCE,
          { cmd: "0", r: Math.random() },
          function(data) {  } // 指定请求成功完成时需要执行的方法
      );
}
var SessionID = 0;
function Online(interval, session) {
    SessionID = session;
    if (GetCookie("ONLINESESSION") == null) {
        AddCookie("ONLINESESSION", CURRENTPAGEID, 0);
    }
    else {
        DelCookie("ONLINESESSION");
        AddCookie("ONLINESESSION", CURRENTPAGEID, 0);
    }
    _INTERVALID = setInterval(Sync, 5 * 1000);
    //Sync();
   _TIMEOUTID=setTimeout(Sync, 1000);
}
function onActive() {
    if (SessionID == 0) {
        return;
    }
    if (GetCookie("ONLINESESSION") != null) {
        if (parseInt(GetCookie("ONLINESESSION")) != CURRENTPAGEID) {
            DelCookie("ONLINESESSION");
            AddCookie("ONLINESESSION", CURRENTPAGEID, 0);
            if (_INTERVALID < 1) {
                _INTERVALID = setInterval(Sync, 5 * 1000);
            }
            Sync();
        }
    } else {
        AddCookie("ONLINESESSION", CURRENTPAGEID, 0);
        if (_INTERVALID < 1) {
            _INTERVALID = setInterval(Sync, 5 * 1000);
        }
        Sync();
    }


}
function Run() {
    if (_MSGS != null && _MSGS.length > 0) {
        var _e = _MSGS.shift();
        if (_e != null) {
            try {
                var _es = _e.Method + "(" + _e.Args + ")"
                eval(_es);
            }
            catch (e) {  }
            clearTimeout(_TIMEOUTID);
            _TIMEOUTID = setTimeout(Run, 5000);
        }
    }
    else {
        _RUN = false;
    }
}

function onActive() {
    Sync();
}

function onResult(xml) {
    var _events = xml.firstChild.childNodes;
    for (var i = 0; i < _events.length; i++) {
        var _call = new Call(_events[i].nodeName, _events[i].text);
        _MSGS.push(_call);
    }
    if (!_RUN) {
        clearTimeout(_TIMEOUTID);
        _TIMEOUTID=setTimeout(Run, 5000);
    }
}


///有人上线(ID,昵称，上线时间)
function vipOnline(uid, province, city, nickName, sex, pic, time) {
    nickName = decodeURI(nickName);
    pic = decodeURI(pic);
    province = decodeURI(province);
    city = decodeURI(city);
    if (uid == undefined || nickName == undefined || pic == undefined) {
        return;
    }
    var _html = "<div style='width:100px;height:120px;float:left;margin-left:2px;'><a target='_blank' href='/View/?uid=" + uid + "'><img onerror=\"this.src='/images/no_"+sex+".gif'\" style='width:80px;height:80px;border:0px' src='" + pic + "' alt='" + nickName + "'/></a></div>";
    _html += "<div style='width:185px;height:120px;float:left;margin-left:10px;'><br />" + province + city + "的<a style='color:red' target='_blank' href='/View/?uid=" + uid + "'> " + nickName + " </a>满怀期待的于"+time+"上线了</div>";
    showPOP(_html,null);
    if ($MARQUEE != null) {
        $MARQUEE.add(province + city + "的<a style='color:red' target='_blank' href='/View/?uid=" + uid + "'> " + nickName + "满怀期待的于" + time + "上线了</a>");
    }
}
///有人查看自己(查看人ID，昵称,图片,时间)
function viewMe(uid, nickName, sex, pic, time) {
    if (uid == undefined || nickName == undefined || pic == undefined) {
        return;
    }
    nickName = decodeURI(nickName);
    pic = decodeURI(pic);
    var _sn = sex == 1 ? "他" : "她";
    var _html = "<div style='width:100px;height:120px;float:left'><a target='_blank' href='/View/?uid=" + uid + "'><img onerror=\"this.src='/images/no_"+sex+".gif'\" style='width:80px;height:80px;border:0px' src='" + pic + "' alt='" + nickName + "'/></a></div>";
    _html += "<div style='width:185px;height:140px;float:left;margin-left:10px;margin-left:2px;'><p><a target='_blank' href='/View/?uid=" + uid + "'> " + nickName + " </a>正在查看您的资料</p><p>" + _sn + "可能对您很感兴趣哦！</p><p>艳遇就在瞬间，快加" + _sn + "的QQ联系吧</p>";
    _html += "<div style='width:120px;height:20px;float:right;margin-right:5px;border: 1px solid #FF9900; color: #CC3300; background-color: #FFCC99;'><a target='_blank' href='/View/?uid="+uid+"'>看" + _sn + "的联系资料-></a></div></div>";
    showPOP(_html, null);
    if ($MARQUEE != null) {
        $MARQUEE.add("<a target='_blank' href='/View/?uid=" + uid + "'> " + nickName + "正在查看您的资料" + _sn + "可能对您很感兴趣哦！艳遇就在瞬间，快加" + _sn + "的QQ联系吧</a>");
    }
}
function onVip(uid, nickName, sex, pic) {
    if (uid == undefined || nickName == undefined || pic == undefined) {
        return;
    }
    nickName = decodeURI(nickName);
    pic = decodeURI(pic);
    var _sn = sex == 1 ? "他" : "她";
    var _html = "<div style='width:100px;height:120px;float:left'><a target='_blank' href='/View/?uid=" + uid + "'><img onerror=\"this.src='/images/no_" + sex + ".gif'\" style='width:80px;height:80px;border:0px' src='" + pic + "' alt='" + nickName + "'/></a></div>";
    _html += "<div style='width:185px;height:140px;float:left;margin-left:10px;margin-left:2px;'><p><a target='_blank' href='/View/?uid=" + uid + "'> 恭喜" + nickName + " </a>升级为高级VIP会员</p><p>艳遇就在瞬间，快加" + _sn + "的QQ联系吧</p>";
    _html += "<div style='width:120px;height:20px;float:right;margin-right:5px;border: 1px solid #FF9900; color: #CC3300; background-color: #FFCC99;'><a target='_blank' href='/View/?uid=" + uid + "'>看" + _sn + "的联系资料-></a></div></div>";
    showPOP(_html, null);
    if ($MARQUEE != null) {
        $MARQUEE.add("<a target='_blank' href='/View/?uid=" + uid + "'> " + nickName + "升级为高级VIP会员" + _sn + ",艳遇就在瞬间，快加" + _sn + "的QQ联系吧 </a>");
    }
}
function onPay(uid, nickName, sex, pic,money) {
    if (uid == undefined || nickName == undefined || pic == undefined) {
        return;
    }
    nickName = decodeURI(nickName);
    pic = decodeURI(pic);
    var _sn = sex == 1 ? "他" : "她";
    var _html = "<div style='width:100px;height:120px;float:left'><a target='_blank' href='/View/?uid=" + uid + "'><img onerror=\"this.src='/images/no_" + sex + ".gif'\" style='width:80px;height:80px;border:0px' src='" + pic + "' alt='" + nickName + "'/></a></div>";
    _html += "<div style='width:185px;height:140px;float:left;margin-left:10px;margin-left:2px;'><p><a target='_blank' href='/View/?uid=" + uid + "'> " + nickName + " </a>成功充值"+money+"元</p><p>艳遇就在瞬间，快加" + _sn + "的QQ联系吧</p>";
    _html += "<div style='width:120px;height:20px;float:right;margin-right:5px;border: 1px solid #FF9900; color: #CC3300; background-color: #FFCC99;'><a target='_blank' href='/View/?uid=" + uid + "'>看" + _sn + "的联系资料-></a></div></div>";
    showPOP(_html, null);
    if ($MARQUEE != null) {
        $MARQUEE.add("<a target='_blank' href='/View/?uid=" + uid + "'> " + nickName + "充值" + money + "元" + _sn + ",艳遇就在瞬间，快加" + _sn + "的QQ联系吧</a>");
    }
}
///系统消息
function systemMsg(msg) {
    showPOP("系统消息:" + msg);
}
///短信(类型,用户ID,用户昵称,消息)
function onSMS(type, uid, nickName, msg) {
    showPOP("短信：" + msg + "<br />发信人：<a target='_blank' href='/View/?uid=" + uid + "'>" + nickName + "</a>", null);
    if ($MARQUEE != null) {
        $MARQUEE.add("短信：" + msg + "<br />发信人：<a target='_blank' href='/View/?uid=" + uid + "'>" + nickName + "</a>");
    }
}
function onMessage(uid, nickname, time) {
    nickName = decodeURI(nickName);
    showPOP("用户<a style='color:red' href='/View/?uid=" + uid + "'>" + nickName + "</a>在" + time + "给您发了条短息，请<a href='/members/MyMessages.aspx'>查收</a>", null);
    if ($MARQUEE != null) {
        $MARQUEE.add("用户<a style='color:red' href='/View/?uid=" + uid + "'>" + nickName + "在" + time + "给您发了条短息，请<a href='/members/MyMessages.aspx'>查收</a>");
    }
}
///点歌

function broadcastBlog(uid, nickname, id, title) {
    nickname = decodeURI(nickname);
    title = decodeURI(title);
    var _html = "<div>用户<a target='_blank' href='/View/?uid=" + uid + "' />" + nickname + "</a>发表新的日志:</div>";
    _html += "<div style='margin-top:5px; margin-left:10px'><a target='_blank' href='/blog/show.aspx?id=" + id + "'>" + title + "</a></div>";
    showPOP(_html, null);
}
//关闭用户msg(关闭原因)
function Close(msg) {
    alert(msg);
    window.top.close();
}
///上传图片
function onUpload(uid, nickname, pic) {
}
///注册新用户
function onRegister(uid, nickname) {
}
function showAlert(title, html, options) {

    box = $("<div>", { "title": title, "id": "virtualModulDialog" }).appendTo("body");
    $("#virtualModulDialog").bind("dialogclose", function (event, ui) {
        close(event, ui);
    });
    if (options != null) {
        box.dialog(options);
    }
    else {
        box.dialog();
    }
    box.html(html);
}
function close(event, ui) {
//    var _shaps = document.getElementsByTagName("shape");
//    alert($(event.target).parent().html());
//    $("shape",$(event.target).parent()).remove();
//    $("shape").bind("click", function () {
//        alert(this.outerHTML);
//        $(this).remove();
//       
//    });
}
function loadFrame(sender) {

    $(sender).show("fast");
    $(sender).parent().css("background", "none");
    $(sender).parent().css("background-image", "none");
}
function frameDialog(title, src, width, height, options) {
//    var _back = $("<div>").appendTo("body");
//    if (options != null) {
//        if ($.browser.msie && $.browser.version>=6) {
//            $(_back).css("position", "absolute");
//            $(_back).css({ "top": "0px", "left": "0px" });
//            $(_back).css("width", $(window.document).width() + "px");
//            $(_back).css("height", $(window.document).height() + "px");
//            $(_back).css("background-color", "#F0F0EA");
//            $(_back).css("filter", "alpha(opacity=30)");
//           
//        }
//    }
    box = $("<div>", { "title": title, "id": "_virtualModulDialog" }).appendTo("body");
    box.css({ "width": width,
        "height": height,
        "overflow": "hidden",
        "margin": "0px",
        "padding": "0px",
        "background-image": "url(/images/loading_data.gif)",
        "background-repeat": "no-repeat",
        "background-position": "center center",
        "z-index": 1000
    });
    $(box).bind("dialogclose", function (event, ui) {
        close(event, ui);
    });

    if (options != null) {
        box.dialog(options);
    }
    else {
        box.dialog();
    }
    box.html("<iframe onload='loadFrame(this)' frameborder=\"0\"  scrolling=\"no\"  style=\"width:100%;height:" + height + ";display:block\" src=\"" + src + "\"  scrolling=\"no\"></iframe>");
}

$(function () {
    $MARQUEE = new Marquee();
    $MARQUEE.init("#marqueePanel");
});
