// JavaScript Document
	function openwin(url)
		{
			window.open(url,'_blank','','width=550,height=400');
		}
	
	function SearchType_onclick()
	{
		if(listform.SearchType[0].checked)	//简单检索
		{
			spsearch.style.display="";
			adsearch.style.display="none";
		}	
		else                                 //高级检索
	    {									
			spsearch.style.display="none"; 
			adsearch.style.display="";
		}	
	}
	
	function se()        //简单检索
   	{
 		var count = 0;
		
		if(document.all.listform.searchword.value == "")
		{
			alert("请您输入检索词！");
			document.all.listform.searchword.focus();
			return false;
		}
		
		if(document.all.listform.sel.length == undefined)
		{
			alert("现在还没要检索的资源！");
			document.all.listform.sel.focus();
			return false;	
		}
		else{
			if( document.all.listform.sel.length > 1 ){
				for(i=0;i<document.all.listform.sel.length;i++)
					if( document.all.listform.sel[i].checked == true )
						count++;
				if(count == 0)		         
				{
					alert("请您选择要检索的资源！");
					document.all.listform.sel[0].focus();
					return false;
				}
			}
			else{
				if(document.all.listform.sel.checked == false)
				{
					alert("请您选择要检索的资源！");
					document.all.listform.sel.focus();
					return false;
				}
			}
		}
		
		document.listform.target = "_blank";
 		document.listform.action="http://219.137.192.229:8080/sp/gjhj_search.jsp";
   		document.listform.submit();
   	}
   	
	function advse()	//高级检索
	{
		
		var count = 0;
		if(document.all.listform.adsearchword1.value == "" &&
		   document.all.listform.adsearchword2.value == "" &&
		   document.all.listform.adsearchword3.value == ""
		  )
		{
			alert("请您输入至少一项检索条件！");
			document.all.listform.adsearchword1.focus();
			return false;
		}
		
		if(document.all.listform.adsearchword1.value != "" && document.all.listform.adsearchfield1.value == 0)
		{
			alert("您的第一个检索项没有选择，请选择！")
			return false;
		}
		
		if(document.all.listform.adsearchword2.value != "" && document.all.listform.adsearchfield2.value == 0)
		{
			alert("您的第二个检索项没有选择，请选择！")
			return false;
		}

		if(document.all.listform.adsearchword3.value != "" && document.all.listform.adsearchfield3.value == 0)
		{
			alert("您的第三个检索项没有选择，请选择！")
			return false;
		}
		
		if((document.all.listform.adsearchfield1.value == document.all.listform.adsearchfield2.value &&
			document.all.listform.adsearchfield1.value != 0)
			|| (document.all.listform.adsearchfield1.value == document.all.listform.adsearchfield3.value &&
			document.all.listform.adsearchfield2.value != 0)
			|| (document.all.listform.adsearchfield2.value == document.all.listform.adsearchfield3.value &&
			document.all.listform.adsearchfield3.value != 0)
		   )
		{
			alert("您不能选择相同的检索入口，请重新选择！")
			return false;
		}

		if(document.all.listform.sel.length == undefined)
		{
			alert("现在还没要检索的资源！");
			document.all.listform.sel.focus();
			return false;	
		}
		else{
			if( document.all.listform.sel.length > 1 ){
				for(i=0;i<document.all.listform.sel.length;i++)
					if( document.all.listform.sel[i].checked == true )
						count++;
				if(count == 0)		         
				{
					alert("请您选择要检索的资源！");
					document.all.listform.sel[0].focus();
					return false;
				}
			}
			else{
				if(document.all.listform.sel.checked == false)
				{
					alert("请您选择要检索的资源！");
					document.all.listform.sel.focus();
					return false;
				}
			}
		}
		
		document.listform.target = "_blank";   
		document.listform.adsearchflag.value = "true";
		document.listform.action = "http://219.137.192.229:8080/sp/gjhj_search.jsp";
		document.listform.submit();
	}
	
	function go()
	{
		var pnto_Value = document.listform.pnto.value;
	    var i;
		
		if(pnto_Value.charAt(0) == ""){
			alert("请输入一个大于0整数！");
			document.listform.pnto.focus();
			return false
		}
		if(pnto_Value.charAt(0) == '0'){
			alert("请输入一个大于0整数！");
			document.listform.pnto.focus();
			return false
		}
		for(i=0;i<pnto_Value.length;i++){
			if(pnto_Value.charAt(i)<'0' || pnto_Value.charAt(i)>'9'){
				alert("请输入一个大于0整数！");
				document.listform.pnto.focus();
				return false;
			}
		}
		document.listform.action="";
		document.listform.target="_blank";
		document.listform.submit();
	}
	  
	function rssearch()
   	{
 		document.listform.action="http://219.137.192.229:8080/sp/resourcelist.jsp";
   		document.listform.submit();
   	}
	
	function allselect()
	{
		var i
		if( document.all.listform.sel == undefined )
		{
			return;
		}
		if(document.all.listform.selall1.checked==true || document.all.listform.selall2.checked==true)
		{
			if( document.all.listform.sel.length > 1 )
			{
			 	for(i=0;i<document.all.listform.sel.length;i++)
				{
					document.all.listform.sel[i].checked=true
				}
			}
			else
			{
				document.all.listform.sel.checked=true;
			}
		}
		else
		{
			if( document.all.listform.sel.length > 1 )
			{
			 	for(i=0;i<document.all.listform.sel.length;i++)
				{
					document.all.listform.sel[i].checked=false
				}
			}
			else
			{
				document.all.listform.sel.checked=false;
			}
		}
	}
	
    function keyEnter(iKeyCode) 
	{

		var srcElement=window.event.srcElement;
		
		if(srcElement.name=="save" || iKeyCode==-1) {
			document.formlist.submit();
			return true;
		} 
		
		if(iKeyCode!=13) return false;
		
		if (srcElement.tagName=="INPUT"||srcElement.tagName=="SELECT") {
			var i = 0
			while (srcElement!=srcElement.form.elements[i])
				i++
			srcElement.form.elements[i+1].focus();
		}
	
		return false;
	}
	
	function del()        
	{
		var count = 0;
		if( document.all.listform.sel + "" == "undefined" )
		{
			return;
		}
		if(document.all.listform.sel.length > 1)
		{
			for(i=0;i<document.all.listform.sel.length;i++)
				if( document.all.listform.sel[i].checked == true )
					count++;
			if(count == 0)		         
			{
				alert("请选择要删除的资源");
				document.all.listform.sel[0].focus();
				return false;
			}
		}	
		else
		{	
			if(document.all.listform.sel.checked == false)
			{
				alert("请选择要删除的资源");
				document.all.listform.sel.focus();
				return false;
			}
		}
		if(confirm("您确定要删除吗？")){
			document.listform.action="http://219.137.192.229:8080/sp/delmyresource.jsp";
			document.listform.submit();
		}
	}

oncontextmenu="window.event.returnvalue=false"