function getBrands(ctl) { try { cboBrand = $get(clientID + '_ddBrands'); div = $get(clientID + '_UpdateProgress1'); div.style.display = "block"; var _value = ctl.options[ctl.selectedIndex].value; var value_ = 0; try { value_ = cboBrand.options[cboBrand.selectedIndex].value; } catch (err) {} WebService.GetBrands( value_,_value, onMethodCompleteBrands, onMethodFail); } catch (err) { alert(err.message); div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; } } function getCategory(ctl) { try { cboCategory = $get(clientID + '_ddCats'); div = $get(clientID + '_UpdateProgress1'); div.style.display = "block"; var _value = ctl.options[ctl.selectedIndex].value; var value_ = 0; try { value_ = cboCategory.options[cboCategory.selectedIndex].value; } catch (err) {} WebService.GetCategory(_value, value_, onMethodCompleteCategory, onMethodFail); } catch (err2) { alert(err2.message); div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; } } function onMethodCompleteBrands(results) { try { ReplaceOptions(cboBrand, results); } catch (err) { alert(err); } div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; } function onMethodCompleteCategory(results) { try { ReplaceOptions(cboCategory, results); } catch(err) { alert(err); } div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; } function onMethodFail(results) { alert("Something went wrong and the following error occured:\n\r\n\r" + results.get_message()); div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; } function ClearForm() { cboCategory = $get(clientID + '_ddCats'); getBrands(cboCategory); cboCategory.selectedIndex = 0; cboBrand = $get(clientID + '_ddBrands'); cboBrand.selectedIndex = 0; getCategory(cboBrand); cboBrand.selectedIndex = 0; /*alert(cboBrand.selectedIndex);*/ //chkNewProdsOnly = $get(clientID + '_chkNewProdsOnly'); //chkNewProdsOnly.checked = false; txt = $get(clientID + '_txtKeyword'); txt.value = ""; if (window.location.search) window.location = "SearchAdvanced.aspx"; } /*OLD FUNCTION */ /* function ClearForm() { cboCategory = $get(clientID + '_ddCats'); cboCategory.selectedIndex = 0; getBrands(cboCategory); cboBrand = $get(clientID + '_ddBrands'); cboBrand.selectedIndex = 0; getCategory(cboBrand); cboBrand.selectedIndex = 0; txt = $get(clientID + '_txtKeyword'); txt.value = ""; if (window.location.search) window.location = "SearchAdvanced.aspx"; } */ function formRedirect() { div = $get(clientID + '_UpdateProgress1'); div.style.display = "none"; var redirectURL = asURL+"?"; var value_ = 0; cboCategory = $get(clientID + '_ddCats'); try { value_ = cboCategory.options[cboCategory.selectedIndex].value; } catch(err) { alert(err); } redirectURL += "&CategoryID=" + value_; value_ = 0; cboBrand = $get(clientID + '_ddBrands'); try { value_=cboBrand.options[cboBrand.selectedIndex].value; } catch(err) { alert(err); } redirectURL += "&BrandID=" + (value_ != -1 ? value_ : ""); value_ = ""; txtKeyword = $get(clientID + '_txtKeyword'); try { value_ = txtKeyword.value; } catch(err) { alert(err); } //chkNewProdsOnly = $get(clientID + '_chkNewProdsOnly'); //redirectURL += "&NewProducts="+(chkNewProdsOnly.checked == true ? "true" : "false"); redirectURL += "&Keyword=" + value_; document.location.href = redirectURL; //alert(redirectURL); }