// JavaScript Document
 function get_hint(pre)
 {
	  var cat_val=$('#category').val();
	  if(searchForm.category.value==""){
		 alert("Please select category first!");
		 searchForm.category.focus();
	  }else{
		  		 $.ajax({url:'search.php',
					  type:'post',
					  data:{act:'get_hint',
					  		   client:pre,
					  		   category:cat_val,
							   keywords:$('#keywords').val()
							   },
					  dataType:'json',
					  success: function(data)
					  {
						  if(cat_val==1 || cat_val==4){
addOptions("#selectmenu",data,'','',0);							  
						  }else if(cat_val==2 || cat_val==5){
addOptions("#selectmenu",data,"tbCompanyID","tbNickName",0);
						  }else if(cat_val==3 || cat_val==7){
addOptions("#selectmenu",data,"tbProductName","tbProductName",0);//alert(data[0].tbProductName);
						  }else{ }
					  }
				   });  
	  }	
 } 
 
 function checkSearchForm()
 {
	  if(searchForm.category.value==""){
		 alert("Category Is Empty,Please Select!");
		 searchForm.category.focus();
	  }else if(searchForm.keywords.value==""){
		 alert("Keywords Must Be Filled!");
		 searchForm.keywords.focus();
	  }else{
		 return true;
	  }	 
	  return false;
 }
 
 function checkStabyForm()
 {
	  if(staby.act.value==""){
		 alert("Statistic By Field Is Empty,Please Select!");
		 staby.act.focus();
	  }else{
		 return true;
	  }	 
	  return false;
 }