document.writeln("  <div id=\'top\'>");
document.writeln("    <div class=\'l\'> ");
document.writeln("      登录名&nbsp;<input name=\'username\' type=\'text\' class=\'text\' id=\'username\' size=\'8\' \/>");
document.writeln("      密码&nbsp;<input name=\'password\' type=\'password\' class=\'text\' id=\'password\' size=\'8\' \/>");
document.writeln("      <select name=\'gopage\' id=\'gopage\'><option value=\'1\'>当前页<\/option><option value=\'2\' selected>管理页<\/option><\/select>");
document.writeln("       <input type=\'button\' value=\' 登录 \' onclick=\'ajaxlogin()\' \/>&nbsp;<a href=\'\/zhuce\'>注册会员<\/a>");
document.writeln("    <\/div>");
document.writeln("    <div class=\'r\'>");
//document.writeln("      <img src=\'http:\/\/b.window168.com\/images\/red\/top_r1.gif\' \/>&nbsp;");
document.writeln("       &nbsp;<a href=\"javascript:addBookmark(\'中国带钢网\',\'http:\/\/www.zgsteel.cn\/index.html\')\">加入收藏夹<\/a>");
//document.writeln("       <img src=\'http:\/\/b.window168.com\/images\/red\/top_r2.gif\' \/>&nbsp;");
document.writeln("       &nbsp;<a href=\"javascript:setHomepage( \'http:\/\/www.zgsteel.cn\/index.html\' )\">设为首页<\/a>");
document.writeln("       &nbsp;<a href=\'\/fuwu\/tuiguang\'>广告服务<\/a>");
document.writeln("      &nbsp;电话:0510-83226001<\/div>");
document.writeln("   <\/div>");

function ajaxlogin(){
	var u = jQuery.trim( $("#username").val() );
	if( u == "" ){ alert("用户名不能为空!"); return false; }
	var p = jQuery.trim( $("#password").val() );
 	if( p == "" ){ alert("密码不能为空!"); return false; }
	var url = "/alogin?username=" + u + "&password=" + p;
	$.getJSON(url, function(data){
	  alert( data );
	  if( data == "会员您好，振兴钢材市场拉欢迎你回来！" ){
	    if( $("#gopage").val() == "2" )
	  	  window.location = "/admin/stocklist";
	  	else
	  	  window.location.reload();
	  }
	}); 
}; 
function ajaxlogin1(){
	var u = jQuery.trim( $("#_username").val() );
	if( u == "" ){ alert("用户名不能为空!"); return false; }
	var p = jQuery.trim( $("#_password").val() );
 	if( p == "" ){ alert("密码不能为空!"); return false; }
	var url = "/alogin?username=" + u + "&password=" + p;
	$.getJSON(url, function(data){
	  if( data == "会员您好，振兴钢材市场拉欢迎你回来！" ){
	    if( $("#_gopage").val() == "2" )
	  	  window.location = "/admin/stocklist";
	  	else
	  	  window.location.reload();
	  }
	}); 
}; 
function addBookmark(title,url) {
	if (window.sidebar) { 
		window.sidebar.addPanel(title, url,""); 
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}
function address(obj, url, title) {
    var e = window.event || arguments.callee.caller.arguments[0];
    var B = {
        IE : /MSIE/.test(window.navigator.userAgent) && !window.opera
        , FF : /Firefox/.test(window.navigator.userAgent)
        , OP : !!window.opera
    };
    obj.onmousedown = null;
    if (B.IE) {
        obj.attachEvent("onmouseup", function () {
            try {
                window.external.AddFavorite(url, title);
                window.event.returnValue = false;
            } catch (exp) {}
        });
    } else {
        if (B.FF || obj.nodeName.toLowerCase() == "a") {
            obj.setAttribute("rel", "sidebar"), obj.title = title, obj.href = url;
        } else if (B.OP) {
            var a = document.createElement("a");
            a.rel = "sidebar", a.title = title, a.href = url;
            obj.parentNode.insertBefore(a, obj);
            a.appendChild(obj);
            a = null;
        }
    }
}
function setHomepage( url ){
  if (document.all){
        document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage( url );
 
  }else if (window.sidebar){
    if(window.netscape){
      try{ 
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
      }catch (e) { 
        alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); 
      }
    }
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage', url );
  }
}