var sSearchURL = 'www.dow.com/webapps/search/basicSearch.aspx';

function PerformSearch(SearchTextValue) {
  var sBusiness = '';
  var sRegion = '';
  var sCountry = '';

	if (SearchTextValue != "") {
		SearchTextValue = RemoveBad(SearchTextValue);
  }
	
	var aMetaTags = document.getElementsByTagName('meta');
	for (var i = 0; i < aMetaTags.length; i++) {
	  var oTag = aMetaTags[i];
	  if (oTag.content && oTag.content.indexOf(',') == -1) {
  	  if (oTag.name == 'Dow_Business' || oTag.name == 'DAS_Business') {
  	    if (oTag.content != 'Dow' && oTag.content != 'Dow AgroSciences') {
  	      sBusiness = oTag.content;
  	    }
  	  }
  	  if (oTag.name == 'Region') {
  	    sRegion = oTag.content;
  	  }
  	  if (oTag.name == 'Country') {
  	    sCountry = oTag.content;
  	  }
    }
	}

	var sSearchQuery = 'http://' + sSearchURL;
	sSearchQuery += '?txtNavigateActive=false';
	sSearchQuery += '&txtBucketsActive=Country;Region;Site%20Specific%20Documents';
	sSearchQuery += '&txtBucketsActiveValues=' + sCountry + ';' + sRegion + ';' + sBusiness;
	sSearchQuery += '&txtPageStart=1&txtPageEnd=10&txtCurrentPage=1&txtPagingActive=false';
	sSearchQuery += '&txtSearch=' + SearchTextValue;
	
	document.location = sSearchQuery;
}