function chk_form(){
var string=document.search.keyword.value;
 if(string==""){
  alert('Please enter the keywords!');
  document.search.keyword.focus();
  return false;
 }else{
 	if(trim(string).length<3){
	  alert('The keywords is too short! At least 3 characters please!');
	  document.search.keyword.focus();
	  return false;
	}else
  		return true;
 }
}

function trim(str){
    return str.replace(/(^\s*)|(\s*$)/g, "");
}