sortLocations(); function Locations_alphaSort(a,b) { if (a < b) { return -1; } if (a > b) { return 1; } return 0; } function sortLocations() { tmpLocations = new Array(); for(i=0;i 0) || (Locations[i].SOURCE != "ED") ) { itemList[itemList.length] = new optionObj(Locations[i].PRODUCT,Locations[i].PRODUCTLABEL); } } } return itemList; } function reWriteDropDown(theField,optionList) { selectedValue = ""; if (theField.selectedIndex >= 0) { selectedValue = theField.options[theField.selectedIndex].value; } theField.length = 0; OptionIndex = 0; for(i=0;i 0) { theField.selectedIndex = OptionIndex; } OptionIndex++; } if (!theField.options[0]) {theField.options[0] = new Option("Not available","Not available");} if (theField.selectedIndex < 0) {theField.options[0].selected = true;} } function setDropDowns(theField) { if (theField.name == "CONTINENT") { // set Countries optionList = sortOptionObj(getLocOptObjs(theField.form,"COUNTRY"),"All Countries",true); reWriteDropDown(theField.form.COUNTRY,optionList); setDropDowns(theField.form.COUNTRY); } else if ((theField.name == "COUNTRY" || theField.name == "SEARCHBYBUTTON") && theField.form.SEARCHBYBUTTON[2].checked) { // set Regions optionList = sortOptionObj(getLocOptObjs(theField.form,""),"All Regions and Cities",false); reWriteDropDown(theField.form.CITYREGION,optionList); setDropDowns(theField.form.CITYREGION); } else if (theField.name == "COUNTRY" && theField.form.SEARCHBYBUTTON[1].checked) { // set Regions if (theField.form.CONTINENT.options[theField.form.CONTINENT.selectedIndex].value.length > 0 || theField.form.COUNTRY.options[theField.form.COUNTRY.selectedIndex].value.length > 0) { optionList = sortOptionObj(getLocOptObjs(theField.form,"REGION"),"All Regions",true); reWriteDropDown(theField.form.CITYREGION,optionList); } else { optionList = sortOptionObj(getLocOptObjs(theField.form,"ABC"),"Not Available",true); reWriteDropDown(theField.form.CITYREGION,optionList); } reWriteDropDown(theField.form.CITYREGION,optionList); setDropDowns(theField.form.CITYREGION); } else if (theField.name == "SEARCHBYBUTTON" && theField.form.SEARCHBYBUTTON[1].checked) { // set Regions if (theField.form.CONTINENT.options[theField.form.CONTINENT.selectedIndex].value.length > 0 || theField.form.COUNTRY.options[theField.form.COUNTRY.selectedIndex].value.length > 0) { optionList = sortOptionObj(getLocOptObjs(theField.form,"REGION"),"All Regions",true); reWriteDropDown(theField.form.CITYREGION,optionList); } else { optionList = sortOptionObj(getLocOptObjs(theField.form,"ABC"),"Not Available",true); reWriteDropDown(theField.form.CITYREGION,optionList); } setDropDowns(theField.form.CITYREGION); } else if (theField.name == "COUNTRY" && theField.form.SEARCHBYBUTTON[0].checked) { // set Cities if (theField.form.CONTINENT.options[theField.form.CONTINENT.selectedIndex].value.length > 0 || theField.form.COUNTRY.options[theField.form.COUNTRY.selectedIndex].value.length > 0) { optionList = sortOptionObj(getLocOptObjs(theField.form,"CITY"),"All Cities",false); reWriteDropDown(theField.form.CITYREGION,optionList); } else { optionList = sortOptionObj(getLocOptObjs(theField.form,"ABC"),"Not Available",true); reWriteDropDown(theField.form.CITYREGION,optionList); } setDropDowns(theField.form.CITYREGION); } else if (theField.name == "SEARCHBYBUTTON" && theField.form.SEARCHBYBUTTON[0].checked) { // set Cities if (theField.form.CONTINENT.options[theField.form.CONTINENT.selectedIndex].value.length > 0 || theField.form.COUNTRY.options[theField.form.COUNTRY.selectedIndex].value.length > 0) { optionList = sortOptionObj(getLocOptObjs(theField.form,"CITY"),"All Cities",false); reWriteDropDown(theField.form.CITYREGION,optionList); } else { optionList = sortOptionObj(getLocOptObjs(theField.form,"ABC"),"Not Available",true); reWriteDropDown(theField.form.CITYREGION,optionList); } reWriteDropDown(theField.form.CITYREGION,optionList); setDropDowns(theField.form.CITYREGION); } else if (theField.name == "CITYREGION") { // set Products optionList = sortOptionObj(getLocOptObjs(theField.form,"PRODUCT"),"All Products",true); reWriteDropDown(theField.form.PRODUCT,optionList); } } function isSAINT(theProductName) { if (theProductName.substr(0,2) == "SI" || theProductName.length < 1) { return 1; } return 0; } function getRegion(theContinent, theCountry, theCity) { for(i=0;i") { theForm.KEYWORD.value = ""; } if ((theForm.SEARCHBYBUTTON[0].checked) && (theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].text.substr(0,1) != "-")) { theForm.CITY.value = theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].value; theForm.REGION.value = getRegion(theForm.CONTINENT.options[theForm.CONTINENT.selectedIndex].value,theForm.COUNTRY.options[theForm.COUNTRY.selectedIndex].value,theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].value); } else if ((theForm.SEARCHBYBUTTON[0].checked) && (theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].text.substr(0,1) == "-")) { theForm.REGION.value = theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].value; theForm.CITY.value=""; } else if (theForm.SEARCHBYBUTTON[1].checked) { theForm.REGION.value = theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].value; theForm.CITY.value = ""; } else if (theForm.SEARCHBYBUTTON[2].checked) { theForm.REGION.value = theForm.CITYREGION.options[theForm.CITYREGION.selectedIndex].value; theForm.CITY.value = ""; } if ( (theForm.CONTINENT.selectedIndex < 1) && (theForm.PRODUCT.selectedIndex < 1) && (theForm.KEYWORD.value.length < 1) ) { alert("You must select a continent, product type or enter a keyword to search for products."); return false; } document.cookie = "CONTINENT=" + document.SearchForm.CONTINENT.options[document.SearchForm.CONTINENT.selectedIndex].value; document.cookie = "COUNTRY=" + document.SearchForm.COUNTRY.options[document.SearchForm.COUNTRY.selectedIndex].value; document.cookie = "PRODUCT=" + document.SearchForm.PRODUCT.options[document.SearchForm.PRODUCT.selectedIndex].value; document.cookie = "KEYWORD="; for (i=0;i