// JavaScript Document
function dwComboRedirect(id){
	var url;
	url=document.getElementById(id).options[document.getElementById(id).options.selectedIndex].value;
	
	if (url == "0_0" || url =="TBD") alert ("Please choose an item in the drop down box"); else document.location.href = url;
}


	var test;
	test=test+'<tr><td></td></tr>';

	var hvac;
	hvac='<table class=\'dwPopUp\'>';
	hvac=hvac+'<tr><td>Centrifugal Pumps</td></tr>';
	hvac=hvac+'<tr><td>Variable Speed Pumps</td></tr>';
	hvac=hvac+'<tr><td>In-Line Pumps</td></tr>';
	hvac=hvac+'<tr><td>End Suction Pumps</td></tr>';
	hvac=hvac+'<tr><td>Split Case Pumps</td></tr>';
	hvac=hvac+'</table>';


	var industrial;
	industrial='<table class=\'dwPopUp\'>';
	industrial=industrial+'<tr><td>Air Operated Diaphragm Pumps</td></tr>';
	industrial=industrial+'<tr><td>Regenerative Turbine Pumps</td></tr>';
	industrial=industrial+'<tr><td>ANSI Centrifugal Pumps</td></tr>';
	industrial=industrial+'<tr><td>Gear Pumps</td></tr>';
	industrial=industrial+'<tr><td>Self Priming Pumps</td></tr>';
	industrial=industrial+'<tr><td>Plunger</td></tr>';
	industrial=industrial+'</table>';
	
	
	var powerGeneration;
	powerGeneration='<table class=\'dwPopUp\'>';
	powerGeneration=powerGeneration+'<tr><td>Air Operated Diaphragm Pumps</td></tr>';	
	powerGeneration=powerGeneration+'<tr><td>Vertical Turbine Pumps</td></tr>';	
	powerGeneration=powerGeneration+'<tr><td>Gear Pumps</td></tr>';	
	powerGeneration=powerGeneration+'<tr><td>Reciprocating</td></tr>';	
	powerGeneration=powerGeneration+'<tr><td>Split Case Pumps</td></tr>';	
	powerGeneration=powerGeneration+'<tr><td>Plunger</td></tr>';	
	powerGeneration=powerGeneration+'</table>';

	var chemicalProcess;
	chemicalProcess='<table class=\'dwPopUp\'>';
	chemicalProcess=chemicalProcess+'<tr><td>Air Operated Diaphragm Pumps</td></tr>';	
	chemicalProcess=chemicalProcess+'<tr><td>ANSI Centrifugal Pumps</td></tr>';	
	chemicalProcess=chemicalProcess+'<tr><td>Peristaltic & Hose Pumps</td></tr>';	
	chemicalProcess=chemicalProcess+'<tr><td>Stainless Steel</td></tr>';	
	chemicalProcess=chemicalProcess+'<tr><td>Mag-Drive</td></tr>';	
	chemicalProcess=chemicalProcess+'</table>';


	var foodBeverage;
	foodBeverage='<table class=\'dwPopUp\'>';
	foodBeverage=foodBeverage+'<tr><td>Peristaltic & Hose Pumps</td></tr>';	
	foodBeverage=foodBeverage+'<tr><td>Progressing Cavity Pumps</td></tr>';	
	foodBeverage=foodBeverage+'<tr><td>Rotary</td></tr>';	
	foodBeverage=foodBeverage+'<tr><td>Stainless Steel</td></tr>';	
	foodBeverage=foodBeverage+'<tr><td>Lobe</td></tr>';	
	foodBeverage=foodBeverage+'</table>';
	
	
	var waterWastewater;
	waterWastewater='<table class=\'dwPopUp\'>';
	waterWastewater=waterWastewater+'<tr><td>Submersible Pumps</td></tr>';
	waterWastewater=waterWastewater+'<tr><td>Progressing Cavity Pumps</td></tr>';
	waterWastewater=waterWastewater+'<tr><td>Self Priming Pumps</td></tr>';
	waterWastewater=waterWastewater+'<tr><td>Non-Clog Pumps</td></tr>';
	waterWastewater=waterWastewater+'<tr><td>Vortex</td></tr>';
	waterWastewater=waterWastewater+'</table>';
	
	var bioPharm;
	bioPharm='<table class=\'dwPopUp\'>';
	bioPharm=bioPharm+'<tr><td>Air Operated Diaphragm Pumps</td></tr>';		
	bioPharm=bioPharm+'<tr><td>Peristaltic & Hose Pumps</td></tr>';		
	bioPharm=bioPharm+'<tr><td>Progressing Cavity Pumps</td></tr>';		
	bioPharm=bioPharm+'<tr><td>Magnetic Drive Pumps</td></tr>';		
	bioPharm=bioPharm+'<tr><td>Multistage Pumps</td></tr>';		
	bioPharm=bioPharm+'<tr><td>Stainless Steel</td></tr>';		
	bioPharm=bioPharm+'</table>';
	
	
	
// 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");
 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://rbapump.thomasnet.com/keyword/?&plpver=10&key=all&keycateg=100"
  url = url + "&SchType=2";
  url = url + "&keyword=" + encodeURI(theSearchText.value);
  url = url + "&refer=" + encodeURI("http://" + document.location.hostname);

  document.location.href = url;
 }
}

function emptyField(thisField) {
	if (thisField.defaultValue == thisField.value) thisField.value = "";
}
function fillField(thisField) {
	if (thisField.value == "") thisField.value = thisField.defaultValue;
}	
