	function trim(stringToTrim) {
		return stringToTrim.replace(/(^\s*)|(\s*$)/g, "");
	}
    
	function isEmpty(str) {
		var trimStr = trim(str);
		
		if ("" == trimStr || "请输入产品关键字" ==trimStr || null == trimStr) {
			alert('请输入产品关键字');
			return false;
		} else {
			return true;
		}
	}
	
	// add to favorite
	function addfavorite(url, title)
	{
		try {
			 if (document.all) {
	    		window.external.addFavorite(url, title); 
		    } else if (window.sidebar) {
		    	window.sidebar.addPanel(title, url, ""); 
		    } else {
		    	alert('抱歉！您的浏览器不支持直接添加收藏夹。');
		    } 
		} catch(e) {
		   		alert('抱歉！您的浏览器不支持直接添加收藏夹。');
		}
	}