// JavaScript Document

 
function LTrim(str){  //删除左边的空格
 return str.replace(/(^\s*)/g,"");
 }

function CheckSearch()
{
    var searchType=parseInt(document.form1.selectIndex.value);
	 
    var keyWords=LTrim(document.form1.name.value);
	 
	 if(keyWords==""){
			alert("请输入关键字进行搜索!");
			document.form1.name.select();
			return ;
		}
	if(document.form1.selectIndex.value==0){
			alert("请选择搜索分类!");
			document.form1.selectIndex.select();
			return;
			}
		
	 else{ 
	      document.form1.title.value=keyWords;
			switch(searchType)
			{
				case 1:
				 document.form1.action="/product/search_list.jsp";
					break;
				case 2:
				     document.form1.action="/news/search_list.jsp";	
					 
					break;
				case 3:
					  document.form1.action="/company/search_list.jsp";			
					
					break;
				case 4:
				document.form1.action="/meeting/search_meeting_list.jsp";	 
				  
					break;
				case 5:		
				  document.form1.action="/download/search_list.jsp";	
					
					break;
				case 6:
						  document.form1.action="/technology/search_list.jsp";	 	   
					break;
			}
			document.form1.submit();
	}
}


function CheckSearch2()
{
    var searchType=parseInt(document.form2.selectIndex.value);
	 
    var keyWords=LTrim(document.form2.name.value);
	 
	 if(keyWords==""){
			alert("请输入关键字进行搜索!");
			document.form2.name.select();
			return ;
		}
		if(document.form2.selectIndex.value==""){
			alert("请选择搜索分类!");
			document.form2.selectIndex.select();
			return;
			}
	 else{ 
	      document.form2.title.value=keyWords;
			switch(searchType)
			{
				case 1:
				 document.form2.action="/product/search_list.jsp";
					break;
				case 2:
				     document.form2.action="/news/search_list.jsp";	
					 
					break;
				case 3:
					  document.form2.action="/company/search_list.jsp";			
					
					break;
				case 4:
				document.form2.action="/meeting/search_meeting_list.jsp";	 
				  
					break;
				case 5:		
				  document.form2.action="/download/search_list.jsp";	
					
					break;
				case 6:
						  document.form2.action="/technology/search_list.jsp";	 	   
					break;
			}
			document.form2.submit();
	}
}
