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;
	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('.html','');
			url += '_' + listd + '_' + listx + '_' + page_no.value + '.html' + window.location.search;
			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('&p='+page,'');
				location.href = url + '&p=' + page_no.value;
			}else{
				url = document.URL.replace('?p='+page,'');
				location.href = url + '?p=' + 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";
}