try {
	var LocString=new String(window.document.location.href);
	function GetQueryString(str) {
		var rs=new RegExp("(^|)"+str+"=([^\&]*)(\&|$)","gi").exec(LocString),tmp;
		if(tmp=rs)return tmp[2];
		return null;
	}
}catch(e){}
function set_homepage(url) {
	if (document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(url);
	}else{
		if (window.sidebar){
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch (e){
				alert("´Ë²Ù×÷±»ä¯ÀÀÆ÷¾Ü¾ø£¡\nÇëÔÚä¯ÀÀÆ÷µØÖ·À¸ÊäÈë¡°about:config¡±²¢»Ø³µ\nÈ»ºó½«[signed.applets.codebase_principal_support]ÉèÖÃÎª'true'");
				return false;
			}
			var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
			prefs.setCharPref('browser.startup.homepage',url);
		}
	}
}
function add_bookmark(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 CopyURL(id) {
	copyText(document.getElementById(id).value);
}
function copyText(id) {
	var testCode=id.replace(new RegExp("€","gm"),"\r\n");
	testCode=testCode.replace(new RegExp("¦Ø","gm"),"\"");
	if(copy2Clipboard(testCode)!=false) {
		//alert('¸´ÖÆ³É¹¦');
	}
}
copy2Clipboard=function(txt) {
	if(window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData("Text",txt);
	}else if(navigator.userAgent.indexOf("Opera")!=-1) {
		window.location=txt;
	}else if(window.netscape) {
		try{
			netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
		}catch(e){
			alert("ÄúµÄfirefox°²È«ÏÞÖÆÏÞÖÆÄú½øÐÐ¼ôÌù°å²Ù×÷£¬Çë´ò¿ª about:config ½«signed.applets.codebase_principal_support ÉèÖÃÎªtrue Ö®ºóÖØÊÔ£¬Ïà¶ÔÂ·¾¶Îªfirefox¸ùÄ¿Â¼/greprefs/all.js");
			return false;
		}
		var clip=Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if(!clip)
		return;
		var trans=Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if(!trans)
		return;
		trans.addDataFlavor('text/unicode');
		var str=new Object();
		var len=new Object();
		var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
		var copytext=txt;str.data=copytext;trans.setTransferData("text/unicode",str,copytext.length*2);
		var clipid=Components.interfaces.nsIClipboard;if(!clip)
		return false;clip.setData(trans,null,clipid.kGlobalClipboard);
	}
}
function do_Page(obj_name,listd,listx,page,allpage) {
	page_no = document.getElementById(obj_name);
	if (page == page_no.value) {
		page_no.value = "";
		return false;
	}
	page_yes = allpage - page_no.value;
	if (page_no.value == '') {
		alert('ÇëÊäÈëÒ³Âë£¡');
		page_no.focus();
		return false;
	}
	if (page_no.value == '0') {
		alert('ÊäÈëµÄÒ³Âë²»ÄÜÎª0£¡');
		page_no.value = "";
		page_no.focus();
		return false;
	}
	if (page_no.value.slice(0,1) == '0') {
		alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
		page_no.value = "";
		page_no.focus();
		return false;
	}
	if (page_yes >= 0) {
		if (!page_no.value.replace(/[0-9]+/g,'').length) {
			//url = window.location.pathname.replace(/_[0-9]+/g,'');
			//url = url.replace('.php','');
			url = obj_name+".php?b_id="+listd+"&sid="+listx+"&page="+page_no.value;
			location.href = url;
		} else {
			alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
			page_no.value = "";
			page_no.focus();
		}
	} else {
		alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
		page_no.value = "";
		page_no.focus();
	}
}
function dos_Page(obj_name,page,allpage,type) {
	page_no = document.getElementById(obj_name);
	if (page == page_no.value) {
		page_no.value = "";
		return false;
	}
	page_yes = allpage - page_no.value;
	if (page_no.value == '') {
		alert('ÇëÊäÈëÒ³Âë£¡');
		page_no.focus();
		return false;
	}
	if (page_no.value == '0') {
		alert('ÊäÈëµÄÒ³Âë²»ÄÜÎª0£¡');
		page_no.value = "";
		page_no.focus();
		return false;
	}
	if (page_no.value.slice(0,1) == '0') {
		alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
		page_no.value = "";
		page_no.focus();
		return false;
	}
	if (page_yes >= 0) {
		if (!page_no.value.replace(/[0-9]+/g,'').length) {
			if (type == 0){
				url = document.URL.replace('&page='+page,'');
				location.href = url + '&page=' + page_no.value;
			}else{
				url = document.URL.replace('?page='+page,'');
				location.href = url + '?page=' + page_no.value;
			}
		} else {
			alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
			page_no.value = "";
			page_no.focus();
		}
	} else {
		alert('ÄúÊäÈëµÄÒ³ÂëÓÐÎó£¬ÇëÖØÐÂÊäÈë£¡');
		page_no.value = "";
		page_no.focus();
	}
}
function show_up(all,n) {
	for (i = 1; i <= all; i++) {
		var intro = document.getElementById("cp"+i);
		var cha = document.getElementById("up"+i);
		intro.style.display = "none";
		cha.className = "";
		if (i == n) {
			intro.style.display = "block";
			cha.className = "a";
		}
	}
}
function show_intro(all,n) {
	for (i = 1; i <= all; i++) {
		var intro = document.getElementById("ca"+i);
		var cha = document.getElementById("ta"+i);
		intro.style.display = "none";
		cha.className="top_off";
		if (i == n) {
			intro.style.display = "block";
			cha.className="top_on";
		}
	}
}
function indexCode() {
	document.getElementById("imgval").src = "code.php?t="+ (new Date().getTime().toString(36));
	document.getElementById("spimg").style.display = "";
	document.getElementById("showvlitoop").style.display = "none";
	document.getElementById("authcode").onfocus = null;
}
function div_close(id) {
	document.getElementById(id).style.display = "none";
}
function div_block(id) {
	document.getElementById(id).style.display = "block";
}
function div_show(id,none) {
	document.getElementById(id).style.display = "";
	document.getElementById(none).style.display = "none";
}
