function ValidateSearch()
{
  if (trim(document.theForm.txtSearchString.value).length <= 0)
  {
    alert("Please enter a keyword to search...");
    document.theForm.txtSearchString.focus();
    return false;
  }
  else
  {
   document.theForm.submit();	
  } 
}

function entsub() 
{
 	if (window.event && window.event.keyCode == 13)
  	{ 
		if(trim(document.theForm.txtSearchString.value).length > 0)
			document.theForm.submit();	
	}
}

function ValidateSearch2()
{
  if (trim(document.theForm2.txtSearchString.value).length <= 0)
  {
    alert("Please enter a keyword to search...");
    document.theForm2.txtSearchString.focus();
    return false;
  }
  else
  {
   document.theForm.submit();	
  } 
}

function entsub2() 
{
 	if (window.event && window.event.keyCode == 13)
  	{ 
		if(trim(document.theForm2.txtSearchString.value).length > 0)
			document.theForm2.submit();	
	}
}


function trim(s)
{
	var l=0; var r=s.length -1;
	while(l < s.length && s[l] == ' ')
	{	l++; }
	while(r > l && s[r] == ' ')
	{	r-=1;	}
	return s.substring(l, r+1);
}
