﻿$(document).ready(function(){
    $("#topnav .sub").hide();
    $("#topnav .products").mouseover(function(){
        $("#topnav .sub").show();
    });
    $("#topnav .products").mouseout(function(){
        $("#topnav .sub").hide();
    });
    $("#topnav .sub").mouseover(function(){
        $(this).show();
    });
    $("#topnav .sub").mouseout(function(){
        $(this).hide();
    });
    if($.browser.msie)
    { 
        if($.browser.version=="6.0")
        {
            $.getScript("/js/IE8.js");
        }
    }
    $("#imgClose").click(function(){
        $(".zoutu_qq_online_box").hide();
        $(".qq_online_smail").show(500);
    });
    $(".qq_online_smail").mouseover(function(){
        $(".qq_online_smail").hide();
        $(".zoutu_qq_online_box").show(500);
    });
    $("#Login_QQ").click(function(){
        showQQLogin();
        return false;
    });
});

function refreshUserLoginStatus()//刷新用户状态
{
    $.ajax({
        type: "post",
        contentType: "application/json",
        url: "/WebServices/dataValidateWebService.asmx/validateUserLoginStatus",
        data: "{}",
        dataType: "json",
        success: function(result) {
            if(result.d.length>2)
            {
                var treeData=eval('('+result.d+')');
                $('.top_banner #sp_user_t').html("<i><u>欢迎您，" + treeData[0].uname + "</u></i><i><a href='/member/"+treeData[0].uid+"'>我的空间</a></i><i><a href='/logout.html'>安全退出</a></i>");
            }
            if(result.d!="")
            {
                
            }
        }
    });
}

function showQQLogin()
{
    var A=window.open("/User/QQLogin.aspx","TencentLogin","width=450,height=320,menubar=0,scrollbars=1,resizable=1,status=1,titlebar=0,toolbar=0,location=1");
}

function handler_qqbind(tp)
{
    ymPrompt.close();
    if(tp=="ok")
    {
        refreshUserLoginStatus();
    }
}

