function showSearch(){
var searchVal= document.getElementById('searchNow').value;
if(trim(searchVal)==''){
alert('Please enter words to be search.');
return false;
}
else if (trim(searchVal).length<3){
alert('Minimum 3 characters.');
return false;
}

}
function trim(str, chars)
{
  return ltrim(rtrim(str, chars), chars);
} 


function ltrim(str, chars)
{
  chars = chars || "\\s";
  return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 

function rtrim(str, chars)
{
  chars = chars || "\\s";
  return str.replace(new RegExp("[" + chars + "]+ s", "g"), "");
}