	
// JavaScript Document

function checkEnter(e){ //e is event object passed from function invocation
	var characterCode;
	
	if(e && e.which){ //if which property of event object is supported (NN4)
		e = e;
		characterCode = e.which; //character code is contained in NN4's which property
	}
	else{
		e = event;
		characterCode = e.keyCode; //character code is contained in IE's keyCode property
	}
	
	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
//		alert('eureka'); //submit the form
		dwSearchCatalog();
		return false;
	}
	else{
		return true;
	}

}


function dwSearchCatalog()
{
 var url;
 var theSearchText = document.getElementById("dwSearchBox");
 var theDropDownBox = document.getElementById("ddlSearchType");
 if ((theSearchText.value.length < 2) || (theSearchText.value == "Search"))
 {
  alert('Please enter at least two characters.');
  theSearchText.focus();
 }
 else
 {
// Version 2.7 release
// 1. using default Domain, like "orientalmotor.thomasnet.com" in our sample
// 2. using root category shortName, like "all-categories" in our sample
//  url= "http://craftsmens.stage.thomasnet.com/keyword/all-categories?&key=all&keycateg=100&keyprod=&SchType=2&keyword="
   url = "http://powerequipment.stullenterprises.com/keyword/all-categories?&key=all&keycateg=100&keyprod=&SchType=2&keyword="
//  url = url + "&SchType=" + theDropDownBox.options[theDropDownBox.options.selectedIndex].value;
  url = url + "&keyword=" + encodeURI(theSearchText.value);
  url = url + "&refer=" + encodeURI("http://" + document.location.hostname);

  document.location.href = url;
 }
}






