WebStore by Amazon 3.5.1: Merchant Manual
35
<table align="center" width="100%" border="0" cellspacing="0"
cellpadding="0"> <tr> <td width="100%" align="center"> <script
type="text/javascript" src="/images/activate.js"></script> </td> </tr>
</table>
Publish your site and view the flash on your live storefront. Embedding your Flash
this way allows your customers to avoid confusing warnings in Internet Explorer.
Add an Advanced Search
A technique to add some additional functionality to your WebStore is to create a
custom search widget. The following JavaScript and HTML are an example of an
advanced search widget created for a watch merchant:
SCRIPT type=text/javascript> /*Compile (concatenate) the search terms from the
form into a string and pass to the search page*/ function compileSearch(o){
searchValues = "";
/*If the keywords field is not empty remove any extra spaces*/
if(o.terms.value.replace(/\s/g, "")!='')
searchValues=o.terms.value.replace(/\s*([^\s]+)(\s)*/g, "$1 ");
/*If the brand field is selected append the value onto the string*/
if(o.brand.selectedIndex > 0) searchValues +=
o.brand.options[o.brand.selectedIndex].value;
/*If the gender field is selected append the value onto the string separating with
ampersands*/ if(o.gender.selectedIndex > 0){ if(searchValues != null &&
searchValues != "") searchValues += " && " ; searchValues +=
o.gender.options[o.gender.selectedIndex].value; }
/*If the color field is selected append the value onto the string separating with
ampersands*/ if(o.color.selectedIndex > 0){ if(searchValues != null && searchValues
!= "") searchValues += " && " ; searchValues +=
o.color.options[o.color.selectedIndex].value; }
/*If the features field is selected append the value onto the string separating with
ampersands*/ if(o.features.selectedIndex > 0){ if(searchValues != null &&
searchValues != "") searchValues += " && " ; searchValues +=
o.features.options[o.features.selectedIndex].value; }
/*Copy the search values string into the hidden keyword field*/
o.keyword.value=searchValues;
/*If there are search terms, send the form, otherwise send an error message*/
if(searchValues!='') o.submit(); else alert('Please enter your search requirements.');
}
('Please enter your search requirements.'); } </script>