try {
	document.execCommand("BackgroundImageCache", false, true);
}
catch (e) {
}

function addfavorite(sTitle, sURL) {
	try {
		window.external.addFavorite(sURL, sTitle);
	}
	catch (e) {
		try {
			window.sidebar.addPanel(sTitle, sURL, "");
		}
		catch (e) {
			alert("加入收藏失败，请使用Ctrl+D进行添加。");
		}
	}
}

function sethome(sTitle, sURL) {
	try {
		sTitle.style.behavior='url(#default#homepage)'; sTitle.setHomePage(sURL);
	}
	catch(e) {
		if(window.netscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			}  
			catch (e) { 
				alert("此项操作被浏览器拒绝！\n\n1.请在浏览器地址栏中输入about:config并按回车键。\n2.在进入高级设置之前可能会出现一个安全警告提示，点击“我保证会小心”。\n3.将signed.applets.codebase_principal_support设置为true。\n4.重新进行“设为首页”操作。");  
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage', sURL);
		}
	}
}

function $(o) {
	return document.getElementById(o);
}

window.onload = function() {
	for(var i=0; i<document.links.length; i++)
	document.links[i].onfocus = function() {this.blur()}
}

function checode() {
	if ((event.keyCode < 48 && event.keyCode != 13) || event.keyCode > 57) {
		event.returnValue = false;
	}
}
function refcode() {
	$("imgcode").src = "/getcode.asp?s=" + Math.random();
	$("code").value = "";
}
function crecode(sURL) {
	if (sURL.indexOf("getcode.asp") == -1) {
		$("imgcode").src = "/getcode.asp?s=" + Math.random();
	}
}

function webload() {
	var web_left = $("web_left").scrollHeight;
	var web_right = $("web_right").scrollHeight;
	var web_newheight = Math.max(web_left, web_right);
	$("web_left").style.height = web_newheight-80 + "px";
	$("web_right").style.height = web_newheight-80 + "px";
}

function select_active(o) {
	$(o).style.display="block";
}
function select_mouseover() {
	try {
		window.clearTimeout(timer);
	}
	catch(e) {
	}
}
function select_mouseout(o) {
	var possel = $(o).style.display;
	if(possel == "block") {
		timer = setTimeout("select_hide('" + o + "')", 100);
	}
}
function select_hide(o) {
	$(o).style.display = "none";
}
function select_show(o, i, name, v, s) {
	$(o).innerHTML = name;
	$(i).value = v;
	select_hide(s);
}
function mactive() {
	$("class").style.display = "block";
}
function mactive2(o) {
	$(o).style.display = "block";
}
function mover() {
	try {
		window.clearTimeout(mtimer);
	}
	catch(e) {
	}
}
function mover2() {
	try {
		window.clearTimeout(mtimer2);
	}
	catch(e) {
	}
}
function mout() {
	var mstr = $("class").style.display;
	if(mstr == "block") {
		mtimer = setTimeout("mhide()", 100);
	}
}
function mout2(o) {
	var mstr2 = $(o).style.display;
	if(mstr2 == "block") {
		mtimer2 = setTimeout("mhide2('" + o + "')", 100);
	}
}
function mhide() {
	$("class").style.display = "none";
}
function mhide2(o) {
	$(o).style.display = "none";
}
