var oCurrentTab; var app103_displayAsPopup = false; function selectTab( oElement ) { if( oCurrentTab != undefined ) { oCurrentTab.selected = ""; } oElement.selected = "selected"; oCurrentTab = oElement; var tabname = ""; var attr = oCurrentTab.attributes["tabname"]; if( attr ) { tabname = attr.value; } loadProductDetailTab( tabname ); return false; }; function selectAttribute( iAttributeId ) { }; function selectCategory(iCategoryId) { }; function selectBrand(iBrand) { }; function resetSearch() { var oQSBrand = document.getElementById( "qsBrand" ); oQSBrand.value = 0; var oQSCategory = document.getElementById( "qsCategory" ); oQSCategory.value = 0; var oQSAttribute = document.getElementById( "qsAttribute" ); oQSAttribute.value = 0; var oQSKeyword = document.getElementById( "qsKeyword"); oQSKeyword.value = ""; performSearch(); }; function performSearch() { var oQuickSearchForm = document.getElementById( "prcQuickSearchForm" ); oQuickSearchForm.submit(); }; function showProductDetail( iProductIdx ) { location.href="index.cfm?command=detail&dtlIndex=" + iProductIdx; }; function showPreviousProduct() { if( oCurrentTab ) { loadProductDetailTab( oCurrentTab.tabname, "prev" ); } }; function showNextProduct() { if( oCurrentTab ) { loadProductDetailTab( oCurrentTab.tabname, "next" ); } }; function loadProductDetailTab( sTabName, sDirection ) { if (sTabName == undefined){sTabName="ovrvw"} if( sDirection ) { loadProductDetailTabParams( sTabName, "direction=" + sDirection ); } else { loadProductDetailTabParams( sTabName ); } }; function loadProductDetailTabParams( sTabName, sParams ) { var sContentSocketId = 'prc-detail-view-panel'; var oContentSocket = document.getElementById( sContentSocketId ); if( oContentSocket ) { var fnOnPortletResponse = function( req ) { Spry.Utils.setInnerHTML( sContentSocketId, req.xhRequest.responseText ); }; var sURL = "displays/disp_detail_view.cfm?displayAsPopup=" + app103_displayAsPopup + "&tab=" + sTabName; if( sParams ) { sURL = sURL + "&" + sParams } Spry.Utils.loadURL( "GET", sURL, true, fnOnPortletResponse ); } }; function updateContentSocket( oReq ) { Spry.Utils.setInnerHTML( 'prc-detail-view-panel', oReq.xhRequest.responseText ); }; function selectRecipe( oRecipeSelect, sTabName ) { loadProductDetailTabParams( sTabName, "recipeId=" + oRecipeSelect.value ); }; function recalculateRecipe() { var oRecalcForm = document.getElementById( "frm_servsCalc" ); if( oRecalcForm ) { if( Fse.FormManager.submit( oRecalcForm, false ) ) { Spry.Utils.submitForm( oRecalcForm, updateContentSocket ); } } else { alert( "Can't find frm_servsCalc" ); } };