// JavaScript Document
function allSsPage(){
	var ssnr=document.getElementById("ssnr").value;
	var tmppd=document.getElementsByName("ssradio");
	var pd="";
	var s="<>'%;\"\\/";
	for(var i=0;i<tmppd.length;i++){
		if(tmppd[i].checked){
			pd=tmppd[i].value;
			break;
		}
	}
	if(ssnr.length==0){
		alert("请输入搜索内容！");
		document.getElementById("ssnr").focus();
		return;
	}else if(pd=="1"){
		for(var i=0;i<ssnr.length;i++){
			if(s.indexOf(ssnr.substring(i,i+1))!=-1){
				alert("对不起，您输入了非法字符（<>'%;\"\\/）！");
				document.getElementById("ssnr").select();
				return;
			}
		}
		ssnr=encodeURI(encodeURI(ssnr));
		window.open("search.jsp?ssnr="+ssnr);
	}else{
		window.open("http://www.google.cn/search?hl=zh-CN&newwindow=1&q="+ssnr+"&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&oq=");
	}
}
function allSsThisPage(){
	var ssnr=document.getElementById("ssnr").value;
	var tmppd=document.getElementsByName("ssradio");
	var pd="";
	var s="<>'%;\"\\/";
	for(var i=0;i<tmppd.length;i++){
		if(tmppd[i].checked){
			pd=tmppd[i].value;
			break;
		}
	}
	if(ssnr.length==0){
		alert("请输入搜索内容！");
		document.getElementById("ssnr").focus();
		return;
	}else if(pd=="1"){
		for(var i=0;i<ssnr.length;i++){
			if(s.indexOf(ssnr.substring(i,i+1))!=-1){
				alert("对不起，您输入了非法字符（<>'%;\"\\/）！");
				document.getElementById("ssnr").select();
				return;
			}
		}
		ssnr=encodeURI(encodeURI(ssnr));
		requestPage('lbjtnrkj','common/allss','jsp','pn=1&ssnr='+ssnr);
	}else{
		window.open("http://www.google.cn/search?hl=zh-CN&newwindow=1&q="+ssnr+"&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=f&oq=");
	}
}
function fypd(tpn,apn,pd){
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('lbjtnrkj','common/lb','jsp','pn='+tpn+'&pd='+pd);
}
function ccfypd(tpn,apn,pd,pd1){
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('lbjtnrkj','common/cclb','jsp','pn='+tpn+'&pd='+pd+'&pd1='+pd1);
}
function lyfypd(tpn,apn){
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('fklykj','common/lyjl','jsp','pn='+tpn);
}
function ssfypd(tpn,apn,pd,ssnr){
	ssnr=encodeURI(encodeURI(ssnr));
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('fklykj','common/lyjlsh','jsp','pn='+tpn+'&pd='+pd+'&ssnr='+ssnr);
}
function allssfypd(tpn,apn,ssnr){
	ssnr=encodeURI(encodeURI(ssnr));
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('lbjtnrkj','common/allss','jsp','pn='+tpn+'&ssnr='+ssnr);
}
function tpfypd(tpn,apn){
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('picnewskj','common/pn','jsp','pn='+tpn);
}
function tzym_ck(apn,pd){
	var tzpn=document.getElementById("tzym_text").value;
	var s="0123456789";
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("tzym_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("tzym_text").value="";
		document.getElementById("tzym_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("tzym_text").value="";
				document.getElementById("tzym_text").focus();
				return;
			}
		}
		requestPage('lbjtnrkj','common/lb','jsp','pn='+tzpn+'&pd='+pd);
	}
}
function cc_ck(apn,pd,pd1){
	var tzpn=document.getElementById("tzym_text").value;
	var s="0123456789";
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("tzym_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("tzym_text").value="";
		document.getElementById("tzym_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("tzym_text").value="";
				document.getElementById("tzym_text").focus();
				return;
			}
		}
		requestPage('lbjtnrkj','common/cclb','jsp','pn='+tzpn+'&pd='+pd+'&pd1='+pd1);
	}
}
function fkly_ck(apn){
	var tzpn=document.getElementById("fkly_text").value;
	var s="0123456789";
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("fkly_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("fkly_text").value="";
		document.getElementById("fkly_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("fkly_text").value="";
				document.getElementById("fkly_text").focus();
				return;
			}
		}
		requestPage('fklykj','common/lyjl','jsp','pn='+tzpn);
	}
}
function ssly_ck(apn,pd,ssnr){
	var tzpn=document.getElementById("ssly_text").value;
	var s="0123456789";
	ssnr=encodeURI(encodeURI(ssnr));
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("ssly_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("ssly_text").value="";
		document.getElementById("ssly_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("ssly_text").value="";
				document.getElementById("ssly_text").focus();
				return;
			}
		}
		requestPage('fklykj','common/lyjlsh','jsp','pn='+tzpn+'&pd='+pd+'&ssnr='+ssnr);
	}
}
function allss_ck(apn,ssnr){
	var tzpn=document.getElementById("tzym_text").value;
	var s="0123456789";
	ssnr=encodeURI(encodeURI(ssnr));
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("tzym_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("tzym_text").value="";
		document.getElementById("tzym_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("tzym_text").value="";
				document.getElementById("tzym_text").focus();
				return;
			}
		}
		requestPage('lbjtnrkj','common/allss','jsp','pn='+tzpn+'&ssnr='+ssnr);
	}
}
function tp_ck(apn){
	var tzpn=document.getElementById("tzym_text").value;
	var s="0123456789";
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("tzym_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("tzym_text").value="";
		document.getElementById("tzym_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("tzym_text").value="";
				document.getElementById("tzym_text").focus();
				return;
			}
		}
		requestPage('picnewskj','common/pn','jsp','pn='+tzpn);
	}
}
function yqlink(id){
	if(id!="#"){
		window.open("link.jsp?linkid="+id);
	}
}
function xggz_fl(tpn,apn,pd,pd1){
	if(tpn<=0)
		alert("当前已是首页");
	else if(tpn>apn)
		alert("当前已是尾页");
	else requestPage('lbjtnrkj','common/xggzlb','jsp','pn='+tpn+'&pd='+pd+'&pd1='+pd1);
}
function xggx_fy(apn,pd,pd1){
	var tzpn=document.getElementById("tzym_text").value;
	var s="0123456789";
	if(tzpn.length==0){
		alert("请输入跳转页码！");
		document.getElementById("tzym_text").focus();
	}else if(parseInt(tzpn)>apn || tzpn=="0"){
		alert("对不起，您输入的跳转页码已超出范围！");
		document.getElementById("tzym_text").value="";
		document.getElementById("tzym_text").focus();
	}else{
		for(var i=0;i<tzpn.length;i++){
			if(s.indexOf(tzpn.substring(i,i+1))==-1){
				alert("请确保您输入的跳转页码合法！");
				document.getElementById("tzym_text").value="";
				document.getElementById("tzym_text").focus();
				return;
			}
		}
		requestPage('lbjtnrkj','common/xggzlb','jsp','pn='+tzpn+'&pd='+pd+'&pd1='+pd1);
	}
}
function setHomepage(){
	if (document.all) {
    	document.body.style.behavior='url(#default#homepage)';
    	document.body.setHomePage('http://www.hngjc.cn');
    } else if (window.sidebar){
		if(window.netscape){
			try{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch (e){
				alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]双击设置为'true'");
			}
    	}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    	prefs.setCharPref('browser.startup.homepage','http://www.hngjc.cn');
	}
}
