    
function validateSearch(searchbox) {
    	//var val = document.forms[0].rslt_search.value;
	var val = document.getElementById(searchbox).value.trim();
	if (val == "" || val == null)
	{
		alert("Please type the word or words you wish to search for in the search box.");
	} 
	else 
	{
		location.href = 'searchresults.aspx?q=' + val;
	}
}



var popupWindow;

function newWindow(page, height, width) 
{
	popupWindow = window.open(page, 'popupWindow', 'width=625,height=457,menubar=no,status=no,location=no,toolbar=no,scrollbars=yes');
}


//Search - Press Enter Key

 function checkKey()
    {
        if (window.event.keyCode == 13)
        {
          
var bt = document.getElementById("searchbtn_123");  
bt.click();
return false;

        }

return true;
    }


function searchkeyword()
{
  	
	var val = document.getElementById("rslt_search").value.trim();
    // Keyword        
	if (val == "" || val == null)
	{
		alert("Please type the word or words you wish to search for in the search box.");
	} 
	else 
	{

	      location.href = 'searchresults.aspx?q=' + val;    

	}
}


function doSearch()
{
  var searchKeywords = document.getElementById("rslt_search");
  var searchKeywords_res = document.getElementById("search");

if (searchKeywords != null &&
    searchKeywords.value != "")
    {
        
        __context.GetServiceClientProxy('BaracludeUpdateServices').SetSearchKeywords(searchKeywords.value);
   window.location.href = 'searchresults.aspx';
    }
    else if(searchKeywords_res != null &&
    searchKeywords_res.value != "")
    {
      
        __context.GetServiceClientProxy('BaracludeUpdateServices').SetSearchKeywords(searchKeywords_res.value);
        
    window.location.href = 'searchresults.aspx';    
    }
    else
    {
    alert("Please type the word or words you wish to search for in the search box.");
    }    

}


