﻿  
        $(function() {
        if (!CheckLogin(".GXUSERNAME")) {
                //未登录
            }
            else {//已登录
                SendBackdoor();
            }
        });
        function SendBackdoor() {
            var url = "/Ajax/CheckLogin.ashx";           
            var pars = "{\"UserID\":\"" + $.cookie(".GXUSERID") + "\"}"
            pub_getws(url, ChangeHeaderContent, pars);
        }
        function ChangeHeaderContent(data) {
            if (data.Success) {
                //登入成功
                $(".orderHeaderTop").children().remove();                
                $(".orderHeaderTop").append("<ul><li>欢迎您！<span class=\"userNameSpan\">" + data.Description + "</span></li><li><a  class=\"ExitClassBtn\"  href=\"javascript:void(0)\">退出</a></li><li><a target=\"_blank\" href=\"http://user.guanxin.com\">个人中心</a></li><li class=\"mybox\"><a target=\"_blank\" href=\"http://user.guanxin.com/Reminder/ReminderList\">我的提醒<span>(" + data.UserRemindNum + ")</span></a></li><li class=\"myshop\"><a target=\"_blank\" href=\"http://shop.guanxin.com/ShopCart/Index\">购物车<span>(" + data.shopCarNum + ")</span></a></li><li><a target=\"_blank\" href=\"http://faq.guanxin.com\">帮助</a></li></ul>");
            }
            ExitBackdoor();
        }

        function ExitBackdoor() {
            $(".ExitClassBtn").click(function() {
                $.cookie('.GXUSERID', '', { expires: -1, path: '/', domain: '.guanxin.com' });
                $.cookie('.GXUSERNAME', '', { expires: -1, path: '/', domain: '.guanxin.com' });
                window.top.location.href = 'http://www.guanxin.com'; 
		return false;
            });
        }
