with(document.getElementById('ajaxLogon')){ innerHTML=
    //-----未登录
    '<span class="off" '+(!document.cookie.match(/(^|; )common_session_id=[^;]+/)?'':'style="display:none"')+'>'+
    '<form method=post action="http://www.net-sky.net/bbs/CreateUser.asp" style="margin:0;display:inline"> '+
    (location.host.match(/pconline/)?'<select onchange="form.action=value"><option value="http://www.net-sky.net/bbs/CreateUser.asp" selected>PCclub</option><option value="http://www.net-sky.net/bbs/CreateUser.asp">商家</option></select> ':'')+
    '<input style="background:no-repeat url(http://www.net-sky.net/menhu/images/ajaxLogon.gif);" name=username size=10 onfocus="style.backgroundPosition=\'0 -25px\'" onblur="if(value==\'\')style.backgroundPosition=\'0 0\';"> '+
    '<input style="background:no-repeat url(http://www.net-sky.net/menhu/images/ajaxLogon.gif) 0 -50px;" name=password type=password size=6 onfocus="style.backgroundPosition=\'0 -25px\'" onblur="if(value==\'\')style.backgroundPosition=\'0 -50px\';"> '+
    '<input type=submit class=submit value="登录"> '+
    '<input type=button class=reg value="注册" onclick="window.open(\'http://www.net-sky.net/bbs/CreateUser.asp\',\'register\')" title="可在此取回密码"></form> </span> '+
    //-----已登录
    '<span class="on" '+(!!document.cookie.match(/(^|; )common_session_id=[^;]+/)?'':'style="display:none"')+'>'+(
//*
    location.host.match(/pconline/)?'<a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>太平洋社区</a>':
    location.host.match(/pcauto/)?'<a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>博客管理</a> ':
    location.host.match(/pcgames/)?'<a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>jClub管理</a>':
    location.host.match(/pclady/)?'<a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>博客管理</a>':
    location.host.match(/pckids/)?'<a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>博客管理</a>':
/**/
    '')+' <a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>空间管理</a> <a href="http://www.net-sky.net/bbs/CreateUser.asp" target=_blank>帐号管理</a> <a href="http://www.net-sky.net/bbs/CreateUser.asp" onclick=" try{jQuery.getScript(href,ajaxLogonRefresh);}catch(e){};return false;">退出</a>'+
    '</span>'};

function ajaxLogonRefresh() {
    if(!document.cookie.match(/(^|; )common_session_id=[^;]+/) != !jQuery('#ajaxLogon>span:last:visible').length) jQuery('#ajaxLogon>span').toggle();
}


function jQueryLoaded4Logon($) {
    var $ = jQuery;
    $('#ajaxLogon form').append($('<input type="hidden" name="return"><input type="hidden" name="fail">').val("http://www.net-sky.net/bbs/CreateUser.asp"))
    .submit(function(){
        var usr = this['username'].value, pwd = this['password'].value;
        if(usr==''||pwd=='') { alert('请填写用户名和密码'); return false; }
        if(this.action.match(/\/eyp\./)) return; //商家
        $('input[type=submit]',this).css('opacity',.5).attr('disabled',true);

        this.target='pconline_login'; var win=window.open('','pconline_login','height=1, width=1, top=9999, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no'); window.focus();

        var time=0; var fm = this;
        var checker = setInterval(function(){
            if(time++ < 600 && !win.closed) return;
            clearInterval(checker);
            if(win.closed) {
                if(document.cookie.match(/(^|; )common_session_id=[^;]+/)) ajaxLogonRefresh();
                else alert('登录失败! 请检查帐号和密码是否正确。');

            } else {
                win.close();
                alert('登录超时失败，请检查网络状况并再试一次。');
            }
            $('input[type=submit]',fm).css('opacity',1).attr('disabled',false);
        },100);

        //$.getScript(this.action+(this.action.match(/\?/)?"&":"?")+"username=" +usr+"&password="+pwd, ajaxLogonRefresh);
    }); /**/
}

setTimeout(function(){
    if(typeof jQuery!='undefined') return jQueryLoaded4Logon();
    var $_already_defined = typeof $ != 'undefined';
    needJS(window.jQuery,'http://www.net-sky.net/menhu/images/jquery-pconline1.2.js',function(){
        if($_already_defined) jQuery.noConflict();
        jQueryLoaded4Logon();
    });
},1000); //等1秒，先显示页面其它内容

function needJS(fn,src,callback) {
    if(typeof fn != 'undefined' && fn != null && fn != '') return callback();
    var status = typeof _needJS_ == 'undefined' ? _needJS_ = {loaded:[],loading:[]} : _needJS_;

    for(var i=0; i<status.loaded.length; i++) {
        if(status.loaded[i] == src) return callback();
    }

    function idx(src) { //供后面的代码调用
        for(var i=0;i<status.loading.length;i++) if(status.loading[i].src==src) return i;
    }

    var loading = status.loading[idx(src)];
    if(loading != null) {
        loading.callbacks.push(callback);
        return;
    }

    status.loading.push(loading = {src:src,callbacks:[callback]});
    var js = document.createElement('script');
    js.src = src;
    js.onload = js.onreadystatechange = function() {
        if(typeof js.readyState == 'undefined' || js.readyState == 'loaded' || js.readyState == 'complete') {
            status.loaded.push(loading.src);
            var callbacks = loading.callbacks;
            status.loading.splice(idx(src),1);
            for(var i = 0; i < callbacks.length; i++) {
                loading.callbacks[i]();
            }
        }
    }
    document.getElementsByTagName('head')[0].appendChild(js);
} //needJS()
