String.prototype.trim = function()
{
	// 用正则表达式将前后空格
	// 用空字符串替代。
	return this.replace(/(^\s*)|(\s*$)/g, "");
}
function addBookmark(url,title)
{
       if(window.sidebar) {
              window.sidebar.addPanel(title, url,"");
       }
       else if( document.all ) {
              window.external.AddFavorite(url, title);
       }
       else if( window.opera && window.print ) {
              return true;
       }
}
function checkSearch()
{
	var keywords = document.getElementById("wordsForSearch").value.trim();
	if(keywords == "")
	{
		window.alert("没有填入搜索关键词!");
		document.getElementById("wordsForSearch").focus();
		return false;
	}
	else
	{
		window.self.location = "/vocabulary/wordSearch.asp?keyword="+keywords;
	}
}
