function showTabCom(objComDivId) { var imgPath = "https://media.entertainment.com/sally/assets/images/shopping/" var objComDivArr = new Array("tab-more-info","tab-files","tab-email-friend","tab-products"); for (i = 0; i < objComDivArr.length; i++) { if (document.getElementById(objComDivArr[i] + "-img")) { document.getElementById(objComDivArr[i] + "-img").src = imgPath + objComDivArr[i] + "-off.gif"; document.getElementById(objComDivArr[i]).style.display = "none"; } } document.getElementById(objComDivId + "-img").src = imgPath + objComDivId + ".gif"; document.getElementById(objComDivId).style.display = "block"; } utilityBrowserVer = parseInt(navigator.appVersion); function imgOn(imgName) { if (utilityBrowserVer >= 3) { imgOnString = eval(imgName + "_on.src"); document.images[imgName].src = imgOnString; } } function imgOff(imgName) { if (utilityBrowserVer >= 3) { imgOffString = eval(imgName + "_off.src"); document.images[imgName].src = imgOffString; } } function goToLink(address) { var linkURL = address.options[address.selectedIndex].value; window.top.location.href = linkURL; address.selectedIndex=0; } /* * This function launches a new web browser window to a specified width, height and features. * Features string is a comma separated window's feature needed for this new window. For Instance * If a new window needs a toolbar the feature string must be "toolbar" like needs scroll bar and * and toolbar then it must be "toolbar,scrollbar". Note that the order of the feature is not required. * Also it's case insensitive. Therefore, "scrollbar,toolbar" is identical to "Toolbar,ScrollBar". * * If the features string is ommitted then all the features are turned off. To turn all the features on * use the word "all" for features instead of specifying each feature. */ function openWindow(address, width, height,features) { /* Find out what features need to be enable * */ if(features) features = features.toLowerCase(); else features = ""; var toolbar = (features == "all" ? 1 : 0); var menubar = (features == "all" ? 1 : 0); var location = (features == "all" ? 1 : 0); var directories = (features == "all" ? 1 : 0); var status = (features == "all" ? 1 : 0); var scrollbars = (features == "all" ? 1 : 0); var resizable = (features == "all" ? 1 : 0); if(features != "all") { //split features var feature = features.split(","); for(i = 0; i < feature.length; i++) { if(feature[i] == "toolbar") toolbar = 1; else if(feature[i] == "menubar") menubar = 1; else if(feature[i] == "location") location = 1; else if(feature[i] == "directories") directories = 1; else if(feature[i] == "status") status = 1; else if(feature[i] == "scrollbars") scrollbars = 1; else if(feature[i] == "resizable") resizable = 1; } } features = "toolbar=" + toolbar + ","; features += "menubar=" + menubar + ","; features += "location=" + location + ","; features += "directories=" + directories + ","; features += "status=" + status + ","; features += "scrollbars=" + scrollbars + ","; features += "resizable=" + resizable; var newWindow = window.open(address, 'Popup_Window', 'width=' + width + ',height=' + height + ',"' + features + '"'); newWindow.focus(); } function confirmWindow(url, text) { if (confirm(text)) { window.go = url; window.location = url; } } function setOperation(opType,needSubmit,addressIndex) { document.addUpdateDeleteAddressForm.operation.value = opType; if(addressIndex) document.addUpdateDeleteAddressForm.selectedAddressIndex.value = addressIndex; if(needSubmit) { if(opType == "EDIT") window.location="/sally/user/address_book.jsp?addressIndex=" + addressIndex; else document.addUpdateDeleteAddressForm.submit(); } } function setAddTo(addToType) { document.productForm.addTo.value = addToType; } // This is an example of sending product data from the server // to the client, then formatting the variants on the client-side // based on certain criteria. function cbFormatter(list, attribute, opt) { // Get the price for this variant.. If this is the primary list, get all related // variants from the group and get their prices as well so we can build a range. var pvds = list.productVariantDropdownSupport; // Get all of the product variants for this attribute var variantGroup = attribute.getVariant().getProductVariantGroup(); var groupVariants = variantGroup.getAllVariants() // Are all of the prices the same within the group? var lowGroupPrice = 999999.00; var highGroupPrice = -1.00; for (var idx = 0; idx < groupVariants.length; idx++) { lowGroupPrice = groupVariants[idx].numericPrice < lowGroupPrice ? groupVariants[idx].numericPrice : lowGroupPrice; highGroupPrice = groupVariants[idx].numericPrice > highGroupPrice ? groupVariants[idx].numericPrice : highGroupPrice; } // Are all of the prices the same within the variant? var variants = variantGroup.getVariantsMatching(attribute.name, attribute.value); var lowVariantPrice = 999999.00; var highVariantPrice = -1.00; var lowVariantDisplay = variants[0].displayPrice; var highVariantDisplay = variants[0].displayPrice; for (var idx = 0; idx < variants.length; idx++) { // Display really needs to be done before the re-assignment... lowVariantDisplay = variants[idx].numericPrice < lowVariantPrice ? variants[idx].displayPrice : lowVariantDisplay; lowVariantPrice = variants[idx].numericPrice < lowVariantPrice ? variants[idx].numericPrice : lowVariantPrice; highVariantDisplay = variants[idx].numericPrice > highVariantPrice ? variants[idx].displayPrice : highVariantDisplay; highVariantPrice = variants[idx].numericPrice > highVariantPrice ? variants[idx].numericPrice : highVariantPrice; } if (lowGroupPrice != highGroupPrice) { // Primary list should display a range if (pvds.isPrimary) if (lowVariantPrice != highVariantPrice) opt.text = opt.text + " " + lowVariantDisplay + " - " + highVariantDisplay; else opt.text = opt.text + " " + attribute.getVariant().displayPrice; else // Secondary lists should show exact price opt.text = opt.text + " " + attribute.getVariant().displayPrice; } return opt; } /* This function is called when a subject is changed so that actual subject text can be * stored in to a hidden subject field. Since value of the subject list is a keyword define * in the command configuration file to identify it's email address. */ function setSubject(thisRef) { var formRef = document.forms["contactUsForm"]; //set subject value formRef.elements["subject"].value = (thisRef.options[thisRef.selectedIndex]).text; }