  function validateSearch()
  {
    theForm=document.productSearchForm;
    if( (theForm.productSearchCategory.options[theForm.productSearchCategory.selectedIndex].value==0)
        &&
        (theForm.productSearchBrand.options[theForm.productSearchBrand.selectedIndex].value==0)
        &&
        isEmpty(theForm.productSearchKeyword.value) ) 
    {
      alert('Please select a category, a brand, or enter a keyword to search on.');
      return false;
    }
    else
    {
      return true;
    }
  }

  
function selectCategory(categorySelect)
{
	selectedCategory = categorySelect.options[categorySelect.selectedIndex].value;
	
	brandSelect = categorySelect.form.productSearchBrand;
	 
	//if (brandSelect.selectedIndex == 0)
	//{
		var menuData = "none";
		
		$.getJSON('/js/productsearchAJAX.cfm?category='+selectedCategory, function(data){
		    menuData = data;
		    oldselected = brandSelect.options[brandSelect.selectedIndex].value;
		    brandSelect.options.length = 0;
	 		brandSelect.add(new Option("All Brands", 0), null)
			$.each( menuData, function(v,k) {
			   thisselected = oldselected == k;
	 		   brandSelect.add(new Option(v, k, thisselected, thisselected), null)
			}); 	    
		  }
		);	  ;
	//}
}

function selectBrand(brandSelect)
{
	selectedBrand = brandSelect.options[brandSelect.selectedIndex].value;
	
	categorySelect = brandSelect.form.productSearchCategory;
	
	var menuData = "none";
	
	//if (categorySelect.selectedIndex == 0)
	//{
		$.getJSON('/js/productsearchAJAX.cfm?brand='+selectedBrand, function(data){
		    menuData = data;
		    oldselected = categorySelect.options[categorySelect.selectedIndex].value;
		    categorySelect.options.length = 0;
		    categorySelect.add(new Option("All Categories", 0), null)
			$.each( menuData, function(v,k) {
				thisselected = oldselected == k;
				categorySelect.add(new Option(v, k, thisselected, thisselected), null)
			}); 	    
		  }
		);	  
	//}
}
