var Catalog = {}; Catalog.Utils = { FormatUrl: function(url) { return document.location.protocol + "//" + document.location.host + url }, QueryString: function(parameter) { var loc = location.search.substring(1, location.search.length); var param_value = false; var params = loc.split("&"); for (i = 0; i < params.length; i++) { param_name = params[i].substring(0, params[i].indexOf("=")); if (param_name == parameter) { param_value = params[i].substring(params[i].indexOf("=") + 1) } } return param_value ? param_value : "" }, ReplaceQueryString: function(url, param, value) { var re = new RegExp("([?|&])" + param + "=.*?(&|$)", "i"); if (url.match(re)) { return url.replace(re, "$1" + param + "=" + value + "$2") } else { return url + "&" + param + "=" + value } } }; Catalog.Inventory = { skus: new Array(), AddControlToArray: function(sku) { Catalog.Inventory.skus.push(sku) }, RefreshControls: function(CheckStoreAvailability) { if (Catalog.Inventory.skus.length > 0) { if ((readCookieName("Recognized") == null && readCookieName("SelectedStores") == null) || CheckStoreAvailability == false) { var url = "/Catalog/ButtonControlContent.aspx?PopulateISA=false&AllowSecure=True&lang=" + document.documentElement.lang } else { var url = "/Catalog/ButtonControlContent.aspx?PopulateISA=true&AllowSecure=True&lang=" + document.documentElement.lang } JsLib.UI.InjectHTMLMultiple(url, Catalog.Inventory.skus.join("&"), Catalog.Inventory.skus) } } }; Catalog.DetailsTab = { SelectTabSpecWithPagination: function(productId, tabId, catalogName, pageNumber, itemsPerPage, sortOption) { var url = url = "/Catalog/DetailsTabs.aspx?Sku=" + encodeURIComponent(productId) + "&ActiveTab=" + encodeURIComponent(tabId) + "&SortOption=" + encodeURIComponent(sortOption); if (catalogName == "" || catalogName == null) { url += "&Page=" + encodeURIComponent(pageNumber - 1) + "&PageSize=" + encodeURIComponent(itemsPerPage) } else { url += "&pcname=" + encodeURIComponent(catalogName) } $get("BundleDetails").innerHTML = JsLib.HttpRequest.loadText(Catalog.Utils.FormatUrl("/Catalog/DetailsTabs.aspx?Sku=" + encodeURIComponent(productId) + "&ActiveTab=" + encodeURIComponent(tabId) + "&SelectedProduct=" + encodeURIComponent(selectedId))); var pageContent = JsLib.HttpRequest.loadText(Catalog.Utils.FormatUrl(url)); pageContent = pageContent.substring(pageContent.indexOf('<div id="tableId"')); pageContent = pageContent.substring(0, pageContent.indexOf("</form>")); $get("div" + tabId).innerHTML = pageContent; $get("div" + tabId).style.display = "block" }, GetBundleDetails: function(liid, productId, srcdiv, targetdiv) { var li = $get(liid); for (var i = 0; i < li.parentNode.childNodes.length; i++) { var liTag = document.getElementsByTagName(li.parentNode.childNodes[i].tagName); if (liTag.item(i) != null) { if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { li.parentNode.childNodes[i].removeAttribute("className") } else { li.parentNode.childNodes[i].removeAttribute("class") } } } li.className = "active"; var url = "/Catalog/BundleTabDetailsContent.aspx?Sku=" + encodeURIComponent(productId); JsLib.UI.InjectHTML(url, srcdiv, targetdiv) }, GetBundleSpecs: function(sender, productId, srcdiv, targetdiv) { var olObject = $get(sender).parentNode.parentNode.parentNode; for (var i = 0; i < olObject.childNodes.length; i++) { if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { olObject.childNodes[i].removeAttribute("className") } else { if (olObject.childNodes[i].nodeType != 3) { olObject.childNodes[i].removeAttribute("class") } } } $get(sender).parentNode.parentNode.className = "active"; var url = "/Catalog/BundleTabSpecsContent.aspx?Sku=" + encodeURIComponent(productId); JsLib.UI.InjectHTML(url, srcdiv, targetdiv) }, OpenGlossaryTermPopup: function(GlossaryId, GlossaryAlternateSource) { var popupUrl = "../ResearchCentre/GlossaryTermDescription.aspx?GlossaryId=" + encodeURIComponent(GlossaryId) + "&GlossaryAlternateSource=" + encodeURIComponent(GlossaryAlternateSource); $popUp(popupUrl, "", { scrollbars: true, status: false, width: 850 }) } }; Catalog.Tabs = { currentTab: "", ActivateById: function(objid) { url = location.href; url = Catalog.Utils.ReplaceQueryString(url, "ActiveTab", objid); $redirect(url) }, OnMouseOver: function(obj) { $get(obj.id).className += " pdptab-hover" }, OnMouseOut: function(obj) { $get(obj.id).className = $get(obj.id).className.replace("pdptab-hover", "") }, Initialize: function() { currentTab = ""; var a = Catalog.Tabs.Initialize.arguments; for (i = 1; i < a.length; i++) { ($get(a[i])).onmouseover = function() { Catalog.Tabs.OnMouseOver(this); return false }; ($get(a[i])).onmouseout = function() { Catalog.Tabs.OnMouseOut(this); return false }; ($get(a[0])).className = "pdptab roll" } }, GetContent: function(url) { JsLib.UI.InjectHTML(url, "_ajax_tabs", "_ajax_tabs") } }; Catalog.BundleTabDetailsControl = { SelectTabSpec: function(productId, tabId, selectedId, catalogName) { $get("BundleDetails").innerHTML = JsLib.HttpRequest.loadText(Catalog.Utils.FormatUrl("/Catalog/DetailsTabs.aspx?Sku=" + encodeURIComponent(productId) + "&ActiveTab=" + encodeURIComponent(tabId) + "&SelectedProduct=" + encodeURIComponent(selectedId))) } }; Catalog.SearchResults = { GetContent: function(url, srcdiv, targetdiv) { Catalog.ProductCompare.InitializeFields(); var selectedproducts = $get(Catalog.ProductCompare.lblSelectedProductIds).value; url = Catalog.Utils.ReplaceQueryString(url, "SelectedProductIds", selectedproducts); JsLib.UI.InjectHTML(url, srcdiv, targetdiv); window.scrollTo(0, 0) }, GetContentWithPageSize: function(url, srcdiv, targetdiv, dropdown) { var dropdownobject = $get(dropdown); var itemsperpage = dropdownobject.options[dropdownobject.selectedIndex].value; url = Catalog.Utils.ReplaceQueryString(url, "PageSize", itemsperpage); Catalog.SearchResults.GetContent(url, srcdiv, targetdiv) }, UpdateBackToSearchResultsHref: function(backToText, targetId, regex) { var backToLink = document.getElementById(targetId); if (document.referrer.match(regex)) { backToLink.href = document.referrer; backToLink.innerHTML = backToText; backToLink.style.display = "inline" } } }; Catalog.ProductCompareTab = { SelectCompareBrand: function(tabId, productId, brandId, categoryId, catalogName) { var sortoption = document.URL.valueOf; url = "/Catalog/ProductDetails.aspx?Sku=" + encodeURIComponent(productId) + "&ActiveTab=" + encodeURIComponent(tabId) + "&CompareBrand=" + encodeURIComponent(brandId) + "&CompareCategory=" + encodeURIComponent(categoryId) + "&category=" + encodeURIComponent(categoryId) + "&SortOption=" + encodeURIComponent(Catalog.Utils.QueryString("SortOption")); if (!(catalogName == "" || catalogName == null)) { url += "&pcname=" + encodeURIComponent(catalogName) } $redirect(url) }, GetContent: function(Sku, ItemsPerPageDropDownID, CurrentItemIndex, CurrentPage, CurrentSortOption, CurrentCategory, IncludeParentProducts, srcdiv, targetdiv, senderid, sendertype) { Catalog.ProductCompare.InitializeFields(); var ItemsPerPageDropDown = $get(ItemsPerPageDropDownID); var ItemsPerPage = 15; if (!(ItemsPerPageDropDown == null)) { ItemsPerPage = ItemsPerPageDropDown.options[ItemsPerPageDropDown.selectedIndex].value } if (sendertype == "sortoption") { CurrentSortOption = $get(senderid).value } else { if (sendertype == "itemsperpage") { ItemsPerPageDropDownID = senderid } } var selectedproducts = $get(Catalog.ProductCompare.lblSelectedProductIds).value; var url = "/Catalog/ProductTabCompareContent.aspx?Sku=" + encodeURIComponent(Sku) + "&ItemsPerPage=" + encodeURIComponent(ItemsPerPage) + "&CurrentItemIndex=" + encodeURIComponent(CurrentItemIndex) + "&CurrentPage=" + encodeURIComponent(CurrentPage) + "&Sort=" + encodeURIComponent(CurrentSortOption) + "&CurrentCategory=" + encodeURIComponent(CurrentCategory) + "&IncludeParentProducts=" + encodeURIComponent(IncludeParentProducts) + "&SelectedProductIds=" + encodeURIComponent(selectedproducts); JsLib.UI.InjectHTML(url, srcdiv, targetdiv) } }; Catalog.QuickView = { quickViewData: null, lastQuickViewSku: "", quickView: null, boundPage: null, quickViewContent: null, quickViewTitle: "Quick View", quickViewCloseBtnTitle: "Close Window", quickViewLoadingText: "Loading...", quickViewWindow: "#QuickView", quickViewYClick: null, quickViewXClick: null, loaded: false, Initialize: function() { if ($("html").attr("lang") == "fr-CA") { this.quickViewTitle = "Vue rapide"; this.quickViewCloseBtnTitle = "Fermer la fen&ecirc;tre"; this.quickViewLoadingText = "Chargement..." } this.loaded = true; this.quickViewData = new Array(); $("body").append('<div id="QuickView"><div class="quick-view"><div class="box"><div class="top-bar"><div class="left"><h3>' + this.quickViewTitle + '</h3></div><a id="ucQuickView_HypClosePopup" class="close" href="javascript:Catalog.QuickView.Hide();">' + this.quickViewCloseBtnTitle + '</a><div class="clear"/></div></div><div id="quickViewContent"><div class="content">' + this.quickViewLoadingText + '</div></div><div class="clear"/></div></div>') }, Show: function(url, sku, source, e) { if (this.loaded == false) { this.Initialize() } if (sku == this.lastQuickViewSku) { this.Hide(); return } this.lastQuickViewSku = sku; $(this.quickViewWindow).html('<div class="quick-view" style="height: 100px;"><div class="box"><div class="top-bar"><div class="left"><h3>' + this.quickViewTitle + '</h3></div><a id="ucQuickView_HypClosePopup" class="close" href="javascript:Catalog.QuickView.Hide();">' + this.quickViewCloseBtnTitle + '</a><div class="clear"/></div><div id="quickViewContent"><div class="content"><div style="margin-left: 120px;"><img src="/images/common/icons/anim_loading.gif" width="50" height="50" /></div></div></div><div class="clear"/></div></div>'); this.quickViewYClick = e.clientY; this.quickViewXClick = e.clientX; $(this.quickViewWindow).show(); this.loadQuickViewResizeWindow(source); this.quickView = true; this.loadQuickViewData(url, sku, source) }, loadQuickViewData: function(url, sku, source) { var data = ""; var xAdjust = 0; var yAdjust = 0; if (!this.quickViewData[url]) { $.get(url, this.loadQuickViewDataWrap(url, sku, source)) } else { $(this.quickViewWindow).html(this.quickViewData[url]); this.loadQuickViewResizeWindow(source) } }, loadQuickViewDataWrap: function(url, sku, source) { return function(data, textStatus) { if (textStatus == "success") { Catalog.QuickView.loadQuickViewDataParseResults(data, url, sku, source) } else { $(Catalog.QuickView.quickViewWindow).html('<div class="quick-view" style="height: 100px;"><div class="box"><div class="top-bar"><div class="left"><h3>' + this.quickViewTitle + '</h3></div><a id="ucQuickView_HypClosePopup" class="close" href="javascript:Catalog.QuickView.Hide();">' + this.quickViewCloseBtnTitle + '</a><div class="clear"/></div><div id="quickViewContent"><div class="content"><div style="margin-left: 120px;">Error loading content.</div></div></div><div class="clear"/></div></div>') } } }, loadQuickViewDataParseResults: function(data, url, sku, source) { var o = document.createElement("div"); o.innerHTML = data; this.quickViewData[url] = JsLib.UI.GetNestedElem(o, "div", "quickviewmaindiv").innerHTML; if (sku == this.lastQuickViewSku) { $(this.quickViewWindow).html(this.quickViewData[url]); this.loadQuickViewResizeWindow(source) } }, loadQuickViewResizeWindow: function(source) { var idName = $(source).attr("id"); var offsetTop = document.getElementById(idName).offsetTop; var offsetLeft = document.getElementById(idName).offsetLeft; var height = $(".quick-view").height(); var width = $(".quick-view").width(); var windowHeight = $(window).height(); var windowWidth = $(window).width(); var windowAdjust = 0; var pageX; var pageY; var clickX = this.quickViewXClick; var clickY = this.quickViewYClick; windowAdjust = (clickY) - (height / 2); windowAdjustX = clickX - (width / 2); if (windowAdjust < 0) { windowAdjust = 0 } if ((clickY + (height / 2)) >= windowHeight) { windowAdjust = windowHeight - height - 10 } if ((clickY - (height / 2)) <= 0) { windowAdjust = 10 } if ((clickX + (width / 2)) >= windowWidth) { windowAdjustX = windowWidth - width - 10 } if ((clickX - (width / 2)) <= 0) { windowAdjustX = 10 } if (typeof (window.pageXOffset) == "number") { pageX = window.pageXOffset } else { pageX = document.documentElement.scrollLeft } if (typeof (window.pageYOffset) == "number") { pageY = window.pageYOffset } else { pageY = document.documentElement.scrollTop } $(this.quickViewWindow).css({ left: windowAdjustX, top: pageY + windowAdjust }) }, Hide: function() { if (this.quickView == true) { this.lastQuickViewSku = ""; $(this.quickViewWindow).hide(); this.quickView = false; ShowDropDownOnQuickViewClose() } } }; function HideDropDownOnQuickView(sDiv) { var oDiv = document.getElementById(sDiv); var colS = document.all.tags("SELECT"); if (colS != null) { for (i = 0; i < colS.length; i++) { if (OBJIsUnderDiv(colS[i], oDiv)) { colS[i].style.visibility = "hidden" } } } } function OBJIsUnderDiv(oOBJ, oDiv) { var oX1 = findPosX(oOBJ); var oX2 = oX1 + oOBJ.offsetWidth; var oY1 = findPosY(oOBJ); var oY2 = oY1 + oOBJ.offsetHeight; var dX1 = findPosX(oDiv); var dX2 = dX1 + oDiv.offsetWidth; var dY1 = findPosY(oDiv); var dY2 = dY1 + oDiv.offsetHeight; if (oX1 >= dX1 && oX1 <= dX2 && oY1 >= dY1 && oY1 <= dY2) { return true } if (oX2 >= dX1 && oX2 <= dX2 && oY2 >= dY1 && oY2 <= dY2) { return true } return false } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent } } else { if (obj.x) { curleft += obj.x } } return curleft } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent } } else { if (obj.y) { curtop += obj.y } } return curtop } function ShowDropDownOnQuickViewClose() { var colS = document.all.tags("SELECT"); if (colS != null) { for (i = 0; i < colS.length; i++) { colS[i].style.visibility = "inherit" } } } $addHandler(document.body, "click", Catalog.QuickView.Hide); Catalog.ProductImages = { ImageUrlIndex: 0, RotateImage: function(imagesPaths, direction, imgProductClientID, lblImageRotatorClientID) { var ImageUrlArray = imagesPaths.split(","); var TotalImages = ImageUrlArray.length; var UrlLocation = ""; if (Catalog.ProductImages.ImageUrlIndex < 0 || Catalog.ProductImages.ImageUrlIndex >= TotalImages) { Catalog.ProductImages.ImageUrlIndex = 0 } if (direction.match("right")) { if (Catalog.ProductImages.ImageUrlIndex < TotalImages - 1) { ++Catalog.ProductImages.ImageUrlIndex; UrlLocation = ImageUrlArray[Catalog.ProductImages.ImageUrlIndex].toString(); $get(imgProductClientID).src = UrlLocation; $("#" + lblImageRotatorClientID).text("Image " + (Catalog.ProductImages.ImageUrlIndex + 1) + " of " + TotalImages) } } if (direction.match("left")) { if (this.ImageUrlIndex > 0) { --this.ImageUrlIndex; UrlLocation = ImageUrlArray[this.ImageUrlIndex].toString(); $get(imgProductClientID).src = UrlLocation; $("#" + lblImageRotatorClientID).text("Image " + (this.ImageUrlIndex + 1) + " of " + TotalImages) } } } }; Catalog.MiniQuickView = { ShowMiniQuickView: function(miniQuickViewId, url) { var miniQuickView = $get(miniQuickViewId); if (!miniQuickView) { return } if (miniQuickView.innerHTML == "") { var response = JsLib.HttpRequest.loadText(url); response = response.substring(response.indexOf("<script")); miniQuickView.innerHTML = response } var bounds = Sys.UI.DomElement.getBounds(miniQuickView); var pageBounds = Sys.UI.DomElement.getBounds($get("aspnetForm")); if ((bounds.x + bounds.width) > pageBounds.width) { var difference = (bounds.x + bounds.width) - pageBounds.width; Sys.UI.DomElement.setLocation(miniQuickView, (bounds.x - difference), bounds.y) } document.getElementById("pagecontentmain2").style.zIndex = 0; miniQuickView.style.zIndex = 100; miniQuickView.style.display = "block" }, HideMiniQuickView: function(miniQuickViewId) { var miniQuickView = $get(miniQuickViewId); miniQuickView.style.display = "none" } }; Catalog.ProductCompare = { lblSelectedProductIds: "", lblSelectedProductCount: "", hidNotEnoughProductsErrorMessage: "", hidTooManyProducts: "", hidMaxProductsToCompare: "", hidMinProductsToCompare: "", boolInitialized: false, InitializeFields: function() { if (!Catalog.ProductCompare.boolInitialized) { Catalog.ProductCompare.lblSelectedProductIds = $get("hidSelectedProductIds_ID").value.replace("$", "_"); Catalog.ProductCompare.lblSelectedProductCount = $get("hidSelectedProductCount_ID").value.replace("$", "_"); Catalog.ProductCompare.hidNotEnoughProductsErrorMessage = $get("hidNotEnoughProductsMessage_ID").value.replace("$", "_"); Catalog.ProductCompare.hidTooManyProducts = $get("hidTooManyProductsMessage_ID").value.replace("$", "_"); Catalog.ProductCompare.hidMaxProductsToCompare = $get("hidMaxComparableProducts_ID").value.replace("$", "_"); Catalog.ProductCompare.hidMinProductsToCompare = $get("hidMinComparableProducts_ID").value.replace("$", "_"); Catalog.ProductCompare.boolInitialized = true } }, doCompare: function(returnUrl) { Catalog.ProductCompare.InitializeFields(); var rootdomain = "http://" + window.location.host; var checkedList = $get(Catalog.ProductCompare.lblSelectedProductIds).value; var selectedProductCount = parseFloat($get(Catalog.ProductCompare.lblSelectedProductCount).value); var maxProducts = parseFloat($get(Catalog.ProductCompare.hidMaxProductsToCompare).value); var minProducts = parseFloat($get(Catalog.ProductCompare.hidMinProductsToCompare).value); if (selectedProductCount > maxProducts) { var tooManyProducts = $get(Catalog.ProductCompare.hidTooManyProducts).value; tooManyProducts = tooManyProducts.replace("{0}", maxProducts); alert(tooManyProducts) } else { if (selectedProductCount < minProducts) { var notEnoughProductsMessage = $get(Catalog.ProductCompare.hidNotEnoughProductsErrorMessage).value; notEnoughProductsMessage = notEnoughProductsMessage.replace("(2)", minProducts); alert(notEnoughProductsMessage) } else { checkedList = checkedList.replace("#,", ""); var uri; uri = rootdomain + "/catalog/compare-result.aspx?ProductIds=" + encodeURIComponent(checkedList) + "&returnPath=" + encodeURIComponent("" + returnUrl); $redirect(uri) } } }, initHiddenFields: function(maxComparableProducts, notEnoughProductsText, tooManyProductsSelectedText) { Catalog.ProductCompare.InitializeFields(); $get(Catalog.ProductCompare.hidMaxProductsToCompare).value = maxComparableProducts; $get(Catalog.ProductCompare.hidNotEnoughProductsErrorMessage).value = notEnoughProductsText; $get(Catalog.ProductCompare.hidTooManyProducts).value = tooManyProductsSelectedText }, initSelectedProductHiddenFields: function(inlblSelectedProductIds, inlblSelectedProductCount) { Catalog.ProductCompare.InitializeFields(); $get(Catalog.ProductCompare.lblSelectedProductIds.replace("$", "_")).value = inlblSelectedProductIds; $get(Catalog.ProductCompare.lblSelectedProductCount).value = inlblSelectedProductCount }, checkBoxClicked: function(thisCheckBox, thisSku) { Catalog.ProductCompare.InitializeFields(); var checked; var checkedList = $get(Catalog.ProductCompare.lblSelectedProductIds).value; var selectedProductCount = parseFloat($get(Catalog.ProductCompare.lblSelectedProductCount).value); if (thisCheckBox.checked) { checkedList = checkedList + "," + thisSku; selectedProductCount = selectedProductCount + 1; var maxProducts = parseFloat($get(Catalog.ProductCompare.hidMaxProductsToCompare).value); if (selectedProductCount > maxProducts) { var maxProducts = parseFloat($get(Catalog.ProductCompare.hidMaxProductsToCompare).value); var tooManyProducts = $get(Catalog.ProductCompare.hidTooManyProducts).value; tooManyProducts = tooManyProducts.replace("{0}", maxProducts); alert(tooManyProducts); thisCheckBox.checked = false } else { $get(Catalog.ProductCompare.lblSelectedProductIds).value = checkedList; $get(Catalog.ProductCompare.lblSelectedProductCount).value = selectedProductCount } } else { checkedList = checkedList.replace("," + thisSku, ""); checkedList = checkedList.replace(thisSku + ",", ""); checkedList = checkedList.replace(thisSku, ""); if (selectedProductCount > 0) { selectedProductCount = selectedProductCount - 1 } $get(Catalog.ProductCompare.lblSelectedProductIds).value = checkedList; $get(Catalog.ProductCompare.lblSelectedProductCount).value = selectedProductCount } }, Initialize: function(lblSelectedProductIds, lblSelectedProductCount, compareIdMapping) { Catalog.ProductCompare.InitializeFields(); var checkedList = $get(lblSelectedProductIds).value; var selectedProductCount = parseFloat($get(lblSelectedProductCount).value); if (compareIdMapping != null && selectedProductCount > 0) { var productIds = checkedList.split(","); for (var i = 0; i < compareIdMapping.length; i += 2) { for (var j = 0; j < productIds.length; j++) { if (productIds[j] == compareIdMapping[i]) { var elem = $get(compareIdMapping[i + 1]); if (elem != null) { elem.checked = true } } } } } } }; function TermsPopup(nameOfControl, wpUrl, productId) { var radioButtons = document.getElementsByName(nameOfControl); for (var indx = 0; indx < radioButtons.length; indx++) { if (radioButtons[indx].checked) { var warrantyId = radioButtons[indx].getAttribute("warrantyId"); if (warrantyId != null && warrantyId != "0") { $popUp(wpUrl + "&WarrantyId=" + encodeURIComponent(warrantyId) + "&Sku=" + encodeURIComponent(productId), "", { scrollbars: true, status: false }); break } } } } function WarrantyIsSelected(boxChecked) { document.WarrantyChecked = boxChecked } function AcceptTermAndConditions(chkBoxTerm) { basket.set_PSPTermAccepted(chkBoxTerm.checked) } function PspConstituentSelected(itemCheckedControl, controlId, index) { acceptCheckbox = $get(controlId + "_ChkAcceptTerms"); parentSpan = acceptCheckbox.parentNode; termsLink = $get(controlId + "_HypTerms"); if (acceptCheckbox && parentSpan && termsLink) { acceptCheckbox.parentNode.disabled = false; acceptCheckbox.disabled = false; parentSpan.style.visibility = "visible"; termsLink.style.visibility = "visible"; var warrantyId = itemCheckedControl.getAttribute("warrantyId"); basket.addAtBundlePSP(index, warrantyId) } } function EnableTermAcceptStartupScript(itemCheckedControl, controlId, warrantyId) { acceptCheckbox = $get(controlId + "_ChkAcceptTerms"); parentSpan = acceptCheckbox.parentNode; termsLink = $get(controlId + "_HypTerms"); additional = $get("warrantyterms"); if (acceptCheckbox && parentSpan && termsLink) { acceptCheckbox.parentNode.disabled = false; acceptCheckbox.disabled = false; parentSpan.style.visibility = "visible"; termsLink.style.visibility = "visible"; basket.set_PSP(warrantyId) } } function EnableTermAccept(itemCheckedControl, controlId) { acceptCheckbox = $get(controlId + "_ChkAcceptTerms"); parentSpan = acceptCheckbox.parentNode; termsLink = $get(controlId + "_HypTerms"); additional = $get("warrantyterms"); if (acceptCheckbox && parentSpan && termsLink) { acceptCheckbox.parentNode.disabled = false; acceptCheckbox.disabled = false; parentSpan.style.visibility = "visible"; termsLink.style.visibility = "visible"; var warrantyId = itemCheckedControl.getAttribute("warrantyId"); basket.set_PSP(warrantyId) } } function DisableTermAccept(itemChecked, controlId) { acceptCheckbox = $get(controlId + "_ChkAcceptTerms"); parentSpan = acceptCheckbox.parentNode; termsLink = $get(controlId + "_HypTerms"); additional = $get("warrantyterms"); if (acceptCheckbox && parentSpan && termsLink) { acceptCheckbox.checked = false; parentSpan.style.visibility = "hidden"; termsLink.style.visibility = "hidden"; basket.set_PSP("0"); basket.set_PSPTermAccepted(false) } } function PrePopulateBundlePSPs(numberOfPSP) { basket.BundlePSP = new Array(numberOfPSP) } function DisplayTermsNotAcceptedMessage(termsMessage) { alert(termsMessage); return true } function WarrantyIsSelected(boxChecked) { document.WarrantyChecked = boxChecked } function GotoTop() { document.location.hash = "Top" } function SetUniqueRadioButton(nameregex, current) { re = new RegExp(nameregex); var pId, fldSelected; for (i = 0; i < document.forms[0].elements.length; i++) { elm = document.forms[0].elements[i]; if (elm.type == "radio") { if (re.test(elm.name)) { elm.checked = false } if (elm.name == current.name) { pId = current.parentNode.getAttribute("ProductID") } } if (elm.type == "hidden") { if (elm.name.indexOf("HdfSelectedProduct") > 0) { elm.value = pId; fldSelected = elm } } } current.checked = true } function SetSelectedProductSku(fldSelected, productSku) { fldSelected.value = productSku } function PopupGlossary(url) { window.open(url, "glossary", "location=0,menubar=0,scrollbars=1,status=0,toolbar=0,width=585,height=480") };
