configureBox={currentCableLength:"",currentFeatures:[],colorFeatureIndex:"",capacityFeatureIndex:"",cableLengthFeatureIndex:"",optionsBoxId:"",optionsBoxLink:"",selectedColorShownObj:"",currentColorName:"",currentColorNameFormatted:"",colorBoxes:[],colorBoxClass:"colorBox",currentColorBoxObj:"",currentColorBoxClass:"colorSelected",colorImageLinks:"",colorImageLinkClass:"colorImageLink",selectedCapacityShownObj:"",currentCapacityNumberOnly:"",currentCapacityNameFormatted:"",capacityBoxes:[],capacityBoxClass:"capacityBox",currentCapacityBoxObj:"",currentCapacityBoxClass:"capacitySelected",capacityImageLinks:"",capacityImageLinkClass:"capacityImageLink",upsellTable:"",currentUpsellProductId:"",upsellSelect:"",retailPriceValue:"",unitPriceValue:"",priceDropRetailPriceValue:"",priceDropUnitPriceValue:"",priceDropValue:"",beforeRebatePriceValue:"",afterRebatePriceValue:"",rebateAmtValue:"",rebateSavings:"",shippingValue:"",availabilityValue:"",helpBoxes:[],helpPopUpClass:"helpPopUp",submitBtn:"",windowScrollX:0,windowScrollY:0,init:function(){if(!document.getElementsByTagName||!document.getElementById){return false}configureBox.helpBoxes=document.getElementsByTagName("a");for(var a=0;a<configureBox.helpBoxes.length;a++){if(DOMhelp.cssjs("check",configureBox.helpBoxes[a],configureBox.helpPopUpClass)){DOMhelp.addEvent(configureBox.helpBoxes[a],"click",configureBox.helpPopUp,false)}}if(document.getElementById("optionsBox")&&document.getElementById("optionsBoxLink")){configureBox.optionsBoxId=document.getElementById("optionsBox");configureBox.optionsBoxLink=document.getElementById("optionsBoxLink");DOMhelp.cssjs("add",configureBox.optionsBoxId,"hide");DOMhelp.addEvent(configureBox.optionsBoxLink,"click",configureBox.optionsBoxToggle,false)}configureBox.colorBoxes=document.getElementsByTagName("div");for(var a=0;a<configureBox.colorBoxes.length;a++){if(DOMhelp.cssjs("check",configureBox.colorBoxes[a],configureBox.colorBoxClass)){DOMhelp.addEvent(configureBox.colorBoxes[a],"mouseover",configureBox.showColorName,false);DOMhelp.addEvent(configureBox.colorBoxes[a],"mouseout",configureBox.revertToCurrentColor,false);DOMhelp.addEvent(configureBox.colorBoxes[a],"click",configureBox.handleColorClick,false)}}if(document.getElementById("firstColorBox")){configureBox.currentColorBoxObj=document.getElementById("firstColorBox").parentNode;DOMhelp.cssjs("add",configureBox.currentColorBoxObj,configureBox.currentColorBoxClass);configureBox.currentColorName=Product.getFirstColor();configureBox.currentColorNameFormatted=Product.getColorFormatted(configureBox.currentColorName)}if(document.getElementById("colorLabelValue")){configureBox.selectedColorShownObj=document.getElementById("colorLabelValue")}configureBox.colorImageLinks=document.getElementsByTagName("a");for(var a=0;a<configureBox.colorImageLinks.length;a++){if(DOMhelp.cssjs("check",configureBox.colorImageLinks[a],configureBox.colorImageLinkClass)){DOMhelp.addEvent(configureBox.colorImageLinks[a],"mouseover",configureBox.changeImage,false);DOMhelp.addEvent(configureBox.colorImageLinks[a],"mouseout",configureBox.revertToCurrentColorImg,false)}}configureBox.capacityBoxes=document.getElementsByTagName("div");for(var a=0;a<configureBox.capacityBoxes.length;a++){if(DOMhelp.cssjs("check",configureBox.capacityBoxes[a],configureBox.capacityBoxClass)){DOMhelp.addEvent(configureBox.capacityBoxes[a],"mouseover",configureBox.showCapacityName,false);DOMhelp.addEvent(configureBox.capacityBoxes[a],"mouseout",configureBox.revertToCurrentCapacity,false);DOMhelp.addEvent(configureBox.capacityBoxes[a],"click",configureBox.handleCapacityClick,false)}}if(document.getElementById("firstCapacityBox")){configureBox.currentCapacityBoxObj=document.getElementById("firstCapacityBox").parentNode;DOMhelp.cssjs("add",configureBox.currentCapacityBoxObj,configureBox.currentCapacityBoxClass);configureBox.currentCapacityNumberOnly=Product.getFirstCapacity();configureBox.currentCapacityNameFormatted=Product.getFirstCapacityFormatted(configureBox.currentCapacityNumberOnly)}if(document.getElementById("selectedCapacity")){configureBox.selectedCapacityShownObj=document.getElementById("selectedCapacity")}configureBox.capacityImageLinks=document.getElementsByTagName("a");for(var a=0;a<configureBox.capacityImageLinks.length;a++){if(DOMhelp.cssjs("check",configureBox.capacityImageLinks[a],configureBox.capacityImageLinkClass)){DOMhelp.addEvent(configureBox.capacityImageLinks[a],"mouseover",configureBox.changeImage,false);DOMhelp.addEvent(configureBox.capacityImageLinks[a],"mouseout",configureBox.revertToCurrentCapacityImg,false)}}if(Product.hasUpsellProducts()){if(document.getElementById("upsellSelect")){configureBox.upsellSelect=document.getElementById("upsellSelect");DOMhelp.addEvent(configureBox.upsellSelect,"click",configureBox.handleUpsellSelectChange,false)}if(document.getElementById("upsellTable")){configureBox.upsellTable=document.getElementById("upsellTable")}}var a;a=0;if(configureBox.currentCapacityNumberOnly){configureBox.currentFeatures[a]=configureBox.currentCapacityNumberOnly;configureBox.capacityFeatureIndex=a;a=a+1}if(configureBox.currentColorName){configureBox.currentFeatures[a]=configureBox.currentColorName;configureBox.colorFeatureIndex=a;a=a+1}if(configureBox.currentCableLength){configureBox.currentFeatures[a]=configureBox.currentCableLength;configureBox.cableLengthFeatureIndex=a;a=a+1}if(a==0){configureBox.currentFeatures[a]="0"}if(document.getElementById("priceDropRetailPriceValue")){configureBox.priceDropRetailPriceValue=document.getElementById("priceDropRetailPriceValue")}if(document.getElementById("priceDropUnitPriceValue")){configureBox.priceDropUnitPriceValue=document.getElementById("priceDropUnitPriceValue")}if(document.getElementById("priceDropValue")){configureBox.priceDropValue=document.getElementById("priceDropValue")}if(document.getElementById("beforeRebatePriceValue")){configureBox.beforeRebatePriceValue=document.getElementById("beforeRebatePriceValue")}if(document.getElementById("rebateAmtValue")){configureBox.rebateAmtValue=document.getElementById("rebateAmtValue")}if(document.getElementById("afterRebatePriceValue")){configureBox.afterRebatePriceValue=document.getElementById("afterRebatePriceValue")}if(document.getElementById("unitPriceValue")){configureBox.unitPriceValue=document.getElementById("unitPriceValue")}if(document.getElementById("shippingValue")){configureBox.shippingValue=document.getElementById("shippingValue")}if(document.getElementById("availabilityValue")){configureBox.availabilityValue=document.getElementById("availabilityValue")}if(Product.hasPriceDrop(configureBox.currentFeatures)){DOMhelp.setText(configureBox.priceDropRetailPriceValue,"$"+Product.getRetailPrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.priceDropUnitPriceValue,"$"+Product.getUnitPrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.priceDropValue,Product.getPriceDrop(configureBox.currentFeatures));configureBox.toggle(document.getElementById("priceDropTable"),"show")}else{if(Product.hasRebate(configureBox.currentFeatures)){DOMhelp.setText(configureBox.beforeRebatePriceValue,"$"+Product.getBeforeRebatePrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.afterRebatePriceValue,"$"+Product.getAfterRebatePrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.rebateAmtValue,"$"+Product.getRebateAmt(configureBox.currentFeatures));configureBox.toggle(document.getElementById("rebateTable"),"show")}else{DOMhelp.setText(configureBox.unitPriceValue,"$"+Product.getUnitPrice(configureBox.currentFeatures));configureBox.toggle(document.getElementById("priceTable"),"show")}}if(Product.hasFreeShipping(configureBox.currentFeatures)){configureBox.toggle(document.getElementById("shippingTable"),"show")}DOMhelp.setText(configureBox.availabilityValue,Product.getAvailability(configureBox.currentFeatures));if(document.getElementById("submitBtn")){configureBox.submitBtn=document.getElementById("submitBtn");DOMhelp.addEvent(configureBox.submitBtn,"click",configureBox.submitPurchase,false)}},optionsBoxToggle:function(a){configureBox.windowScrollX=DOMhelp.getScrollPosition("x");configureBox.windowScrollY=DOMhelp.getScrollPosition("y");if(DOMhelp.cssjs("check",configureBox.optionsBoxId,"hide")){DOMhelp.cssjs("swap",configureBox.optionsBoxId,"hide","show");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}else{DOMhelp.cssjs("swap",configureBox.optionsBoxId,"show","hide");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}var b=DOMhelp.getTarget(a);if(b!="NULL"){if(b.nodeName.toLowerCase()=="img"){b=b.parentNode}}DOMhelp.cancelClick(a);return false},toggle:function(c,b){configureBox.windowScrollX=DOMhelp.getScrollPosition("x");configureBox.windowScrollY=DOMhelp.getScrollPosition("y");if(b==="show"){if(DOMhelp.cssjs("check",c,"hide")){DOMhelp.cssjs("swap",c,"hide","show");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}}else{if(b==="hide"){if(DOMhelp.cssjs("check",c,"show")){DOMhelp.cssjs("swap",c,"show","hide");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}}else{if(b==="toggle"){if(DOMhelp.cssjs("check",c,"hide")){DOMhelp.cssjs("swap",c,"hide","show");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}else{DOMhelp.cssjs("swap",c,"show","hide");window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)}}}}},handleColorClick:function(a){DOMhelp.cancelClick(a);configureBox.selectThisColor(a);configureBox.setCurrentColorName(a);configureBox.updatePrice(a);return false},handleCapacityClick:function(a){DOMhelp.cancelClick(a);configureBox.setCurrentCapacityName(a);configureBox.selectThisCapacity(a);configureBox.updatePrice(a);return false},showColorName:function(a){var c=DOMhelp.getTarget(a);var b;if(c.nodeName.toLowerCase()=="div"){b=c.getAttribute("title")}else{if(c.nodeName.toLowerCase()=="a"){b=c.firstChild.getAttribute("title")}else{if(c.nodeName.toLowerCase()=="img"){b=c.parentNode.getAttribute("title")}}}configureBox.selectedColorShownObj.innerHTML=Product.getColorFormatted(b)},setCurrentColorName:function(a){configureBox.windowScrollX=DOMhelp.getScrollPosition("x");configureBox.windowScrollY=DOMhelp.getScrollPosition("y");var c=DOMhelp.getTarget(a);var b;if(c.nodeName.toLowerCase()=="img"){b=c.parentNode.getAttribute("title")}else{if(c.nodeName.toLowerCase()=="a"){b=c.firstChild.getAttribute("title")}else{if(c.nodeName.toLowerCase()=="div"){b=c.getAttribute("title")}}}configureBox.currentColorName=b.toLowerCase();configureBox.currentColorNameFormatted=Product.getColorFormatted(configureBox.currentColorName);configureBox.currentFeatures[configureBox.colorFeatureIndex]=configureBox.currentColorName;window.scrollTo(configureBox.windowScrollX,configureBox.windowScrollY)},revertToCurrentColor:function(a){configureBox.selectedColorShownObj.innerHTML=configureBox.currentColorNameFormatted},selectThisColor:function(a){var b=DOMhelp.getTarget(a);if(b.nodeName.toLowerCase()=="img"){b=b.parentNode.parentNode}else{if(b.nodeName.toLowerCase()=="a"){b=b}else{if(b.nodeName.toLowerCase()=="div"){b=b.parentNode}}}DOMhelp.cssjs("remove",configureBox.currentColorBoxObj,configureBox.currentColorBoxClass);DOMhelp.cssjs("add",b,configureBox.currentColorBoxClass);configureBox.currentColorBoxObj=b},showCapacityName:function(b){var c=DOMhelp.getTarget(b);var a;a=c.getAttribute("title");configureBox.selectedCapacityShownObj.innerHTML=a},setCurrentCapacityName:function(b){var c=DOMhelp.getTarget(b);var a;a=c.getAttribute("title");configureBox.currentCapacityNameFormatted=a;configureBox.currentCapacityNumberOnly=Product.getCapacity(a);configureBox.currentFeatures[configureBox.capacityFeatureIndex]=configureBox.currentCapacityNumberOnly},revertToCurrentCapacity:function(a){configureBox.selectedCapacityShownObj.innerHTML=configureBox.currentCapacityNameFormatted},selectThisCapacity:function(a){var b=DOMhelp.getTarget(a);if(b.nodeName.toLowerCase()=="div"){b=b.parentNode}DOMhelp.cssjs("remove",configureBox.currentCapacityBoxObj,configureBox.currentCapacityBoxClass);DOMhelp.cssjs("add",b,configureBox.currentCapacityBoxClass);configureBox.currentCapacityBoxObj=b},updatePrice:function(a){configureBox.toggle(document.getElementById("priceTable"),"hide");configureBox.toggle(document.getElementById("priceDropTable"),"hide");configureBox.toggle(document.getElementById("rebateTable"),"hide");if(Product.hasPriceDrop(configureBox.currentFeatures)){DOMhelp.setText(configureBox.priceDropRetailPriceValue,"$"+Product.getRetailPrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.priceDropUnitPriceValue,"$"+Product.getUnitPrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.priceDropValue,Product.getPriceDrop(configureBox.currentFeatures));configureBox.toggle(document.getElementById("priceDropTable"),"show")}else{if(Product.hasRebate(configureBox.currentFeatures)){DOMhelp.setText(configureBox.beforeRebatePriceValue,"$"+Product.getBeforeRebatePrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.afterRebatePriceValue,"$"+Product.getAfterRebatePrice(configureBox.currentFeatures));DOMhelp.setText(configureBox.rebateAmtValue,"$"+Product.getRebateAmt(configureBox.currentFeatures));configureBox.toggle(document.getElementById("rebateTable"),"show")}else{DOMhelp.setText(configureBox.unitPriceValue,"$"+Product.getUnitPrice(configureBox.currentFeatures));configureBox.toggle(document.getElementById("priceTable"),"show")}}if(Product.hasFreeShipping(configureBox.currentFeatures)){DOMhelp.setText(configureBox.shippingValue,Product.getShipping(configureBox.currentFeatures));configureBox.toggle(document.getElementById("shippingTable"),"show")}else{configureBox.toggle(document.getElementById("shippingTable"),"hide")}DOMhelp.setText(configureBox.availabilityValue,Product.getAvailability(configureBox.currentFeatures))},submitPurchase:function(c){var d=DOMhelp.getTarget(c);if(d!="NULL"){if(d.nodeName.toLowerCase()!="a"){d=d.parentNode}}var a=Product.getProductId(configureBox.currentFeatures);var b=d.getAttribute("href")+a;if(Product.hasUpsellProducts()){if(configureBox.getCurrentUpsellProductId()){b=b+","+configureBox.getCurrentUpsellProductId()}}if(Product.getCategoryID()){b=b+"&category_id="+Product.getCategoryID()}window.location=b;DOMhelp.cancelClick(c);return false},changeImage:function(b){var d=DOMhelp.getTarget(b);if(d!="NULL"){if(d.nodeName.toLowerCase()!="a"){d=d.parentNode}}if(d.nodeName.toLowerCase()=="div"){d=d.parentNode}if(!document.getElementById("productImage")){return true}var c=document.getElementById("productImage");var a=d.getAttribute("href");c.setAttribute("src",a)},revertToCurrentCapacityImg:function(b){var d=DOMhelp.getTarget(b);if(d.nodeName.toLowerCase()=="div"){d=d.parentNode}if(!document.getElementById("productImage")){return true}var c=document.getElementById("productImage");var a=configureBox.currentCapacityBoxObj.getAttribute("href");c.setAttribute("src",a)},revertToCurrentColorImg:function(b){var d=DOMhelp.getTarget(b);if(d.nodeName.toLowerCase()=="div"){d=d.parentNode}if(!document.getElementById("productImage")){return true}var c=document.getElementById("productImage");var a=configureBox.currentColorBoxObj.getAttribute("href");c.setAttribute("src",a)},handleUpsellSelectChange:function(a){configureBox.setCurrentUpsellProductId(a)},setCurrentUpsellProductId:function(c){var d=DOMhelp.getTarget(c);if(d!=null){if(d.nodeName!="SELECT"){d=c.currentTarget}}var a=d.selectedIndex;var b=d.options[a].getAttribute("value");configureBox.currentUpsellProductId=b},getCurrentUpsellProductId:function(){if(configureBox.currentUpsellProductId==""||configureBox.currentUpsellProductId==0){return false}else{return configureBox.currentUpsellProductId}},cancelThisClick:function(a){DOMhelp.cancelClick(a);return false},helpPopUp:function(e){var obj=DOMhelp.getTarget(e);if(obj.nodeName.toLowerCase()=="a"){URL=obj.getAttribute("href")}else{if(obj.nodeName.toLowerCase()=="img"){URL=obj.parentNode.getAttribute("href")}}var page;eval("page = window.open(URL, 'Help', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=300');");page.focus();DOMhelp.cancelClick(e);return false}};DOMhelp.addEvent(window,"load",configureBox.init,false);
