﻿function addBookmark(title) {/*收藏*/var url=parent.location.href; 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 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("抱歉！您的浏览器不支持直接设为首页。请在浏览器地址栏输入“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',vrl);
                 }
        }
}
function hu_alert(txt){
	var selects =document.getElementsByTagName("select");
	if(selects)
	{
		for(var s=0; s<selects.length; s++)
		{
			selects[s].style.visibility='hidden';
		}
	}
	var shield = document.createElement("DIV");
	shield.id = "shield";
	shield.style.position = "absolute";
	shield.style.left = "0px";
	shield.style.top = "0px";
	shield.style.width = "100%";
	shield.style.height = ((document.documentElement.clientHeight>document.documentElement.scrollHeight)?document.documentElement.clientHeight:document.documentElement.scrollHeight)+"px";
	shield.style.background = "#333";
	shield.style.textAlign = "center";
	shield.style.zIndex = "100000";
	shield.style.filter = "alpha(opacity=0)";
	shield.style.opacity = 0;
	var alertFram = document.createElement("DIV");
	alertFram.id="alertFram";
	alertFram.style.position = "absolute";
	alertFram.style.left = "50%";
	alertFram.style.top = "60%";
	alertFram.style.marginLeft = "-225px" ;
	alertFram.style.marginTop = -75+document.documentElement.scrollTop+"px";
	alertFram.style.width = "450px";
	alertFram.style.height = "100px";
	alertFram.style.background = "#fff";
	alertFram.style.textAlign = "center";
	alertFram.style.lineHeight = "50px";
	alertFram.style.zIndex = "100001";
	strHtml  = "<ul style=\"list-style:none;margin:0px;padding:0px;width:100%\">\n";
	strHtml += "<li style=\"background:url(/images/info.gif) repeat-x; ;text-align:left;padding-left:10px;font-size:13px;height:25px;line-height:25px;border:1px solid #B77920; color:#FFF;\">系统提示(3秒后自动关闭)</li>\n";
	strHtml += "<li style=\"background:#fff;text-align:center; border-left:1px solid #B77920;border-right:1px solid #B77920; font-size:14px; color:#C16A13;\">"+txt+"</li>\n";
	strHtml += "<li style=\"background:#F5EAC2;text-align:center;font-weight:bold;height:25px;line-height:25px; border:1px solid #B77920;\"><input type=\"button\" value=\"关闭提示框\" id=\"do_OK\" onclick=\"doOk()\" /></li>\n";
	strHtml += "</ul>\n";
	alertFram.innerHTML = strHtml;
	document.body.appendChild(alertFram);
	document.body.appendChild(shield);
	var c = 0;
	this.doAlpha = function(){
		if (++c > 20){clearInterval(ad);return 0;}
	shield.style.filter = "alpha(opacity=50)";
   shield.style.opacity = 0.5;
	}
	var ad = setInterval("doAlpha()",1);
	this.doOk = function(){
		
		if(selects)
		{
				for(var s=0; s<selects.length; s++)
				{
				 selects[s].style.visibility='visible';
				}
		}
		document.body.removeChild(alertFram);
		document.body.removeChild(shield);

		document.body.onselectstart = function(){return true;}
		document.body.oncontextmenu = function(){return true;}
		

	}
    setTimeout(doOk,2000);	
	document.getElementById("do_OK").focus();
}

