﻿function AddFavorite(sURL, sTitle) {try {window.external.addFavorite(sURL, sTitle);}catch (e) {try {window.sidebar.addPanel(sTitle, sURL, "");}catch (e) {alert("加入收藏失败，请使用Ctrl+D进行添加");}}}
function SetHome(obj, vrl) {try {obj.style.behavior = 'url(#default#homepage)';obj.setHomePage(vrl);} catch (e) {if (window.netscape) {try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");} catch (e) {alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");}var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage', vrl);} }}   

$(document).ready(function () {
    $(".lidown").mouseover(function () {
        $(this).find(".head_down").addClass("head_down2");
        $(this).find(".head_d_box").removeClass("display");
    });
    $(".lidown").mouseout(function () {
        $(this).find(".head_down").removeClass("head_down2");
        $(this).find(".head_d_box").addClass("display");
    })
    
    /*登录信息*/
    $.post("/ajax/common.aspx?rd=" + Math.random(),{action:"url"},function(url){
        $.getJSON(url+"/ajax/common.aspx?rd=" + Math.random() + "&callback=?", {
            action: "getperauth"
        }, function (data) {
            if (data != null&&$.trim(data).length>0) {
                var arr = data.toString().split(';');
                if ($.trim(arr[1]).length > 0) {
                    $("#nav_login").hide();
                    $("#nav_reg").hide();
                    $("#nav_per_logout").show().find("a:eq(0)").text(arr[1]);
                    $("#nav_per_op").show();
                }
            } else {
                $.getJSON(url+"/ajax/common.aspx?rd=" + Math.random() + "&callback=?", {
                    action: "getcomauth"
                }, function (data) {
                    if (data != null&&$.trim(data).length>0) {
                        var arr = data.toString().split(';');
                        if ($.trim(arr[1]).length > 0) {
                            $("#nav_login").hide();
                            $("#nav_reg").hide();
                            $("#nav_com_logout").show().find("a:eq(0)").text(arr[1]);
                            $("#nav_com_op").show();
                        }
                    }
                });
            }
        });
    },"text");
});

