productOption = { containerFinishID: 'product-finish', finishDropdownID: 'finish', weightDropdownID: 'weight', productContainerID: 'product-container', init:function(){ if(!document.getElementById || !document.createTextNode){return;} // Display left menu after instanstiating the list (displays menu ONLY when its fully built - eliminates flicker) var containerFinish = document.getElementById(productOption.containerFinishID); if(!containerFinish){return;} var finishDropdown = document.getElementById(productOption.finishDropdownID); fp.addEvent(finishDropdown, 'change', productOption.updateProductListing, false); var weightDropdown = document.getElementById(productOption.weightDropdownID); fp.addEvent(weightDropdown, 'change', productOption.updateProductListing, false); }, updateProductListing:function(e) { // Determine category unique name var pathArray = window.location.pathname.split( '/' ); var string = '&category_unique_name='+pathArray[pathArray.length-2]; var target=helper.getTarget(e); if(target.id == productOption.finishDropdownID) { string += '&finish_id='+target.value; var weightDropdown = document.getElementById(productOption.weightDropdownID); if(weightDropdown.value) { string += '&weight_id='+weightDropdown.value; } } if(target.id == productOption.weightDropdownID) { string += '&weight_id='+target.value; var finishDropdown = document.getElementById(productOption.finishDropdownID); if(finishDropdown.value) { string += '&finish_id='+finishDropdown.value; } } ajaxCall.createXMLHttpRequest(string); var container = document.getElementById(productOption.productContainerID); while (container.firstChild) { //The list is LIVE so it will re-index each call container.removeChild(container.firstChild); } container.innerHTML = ajaxCall.xmlHttp.responseText; } } fp.addEvent(window, 'load', productOption.init, false);