function doSearch()
{
  if(form1.keyword.value==""|| trimString(form1.keyword.value).length<2)
  {alert("关键字不能为空或不能小于2个字符");
   return false;
  }else{
  return true;
  }
}

//清除字符串前导空格和拖尾空格
function trimString(s)
{
	if(s==null||s=="")
	{
  		return "";
	}

	var str=new String(s);
	var index=0;

	while(str.charAt(0)==" ")
	{
		str=str.substring(1);
	}

	index=str.length-1;

	while(str.charAt(index)==" ")
	{
		str=str.substring(0,index);
		index=str.length-1;
	}
	
	return str;
}
