Product={productType:"",capacities:[],capacitiesFormatted:[],colors:[],marketingColors:[],featureToIDMap:[],tempToRealIDMap:[],retailPrices:[],unitPrices:[],priceDrop:[],hasPriceDropValue:[],rebateSavings:[],rebateAmt:[],hasRebateAmt:[],availability:[],shippingInfo:[],basicToMarketingColors:[],hasColorsOption:false,hasCapacitiesOption:false,hasLengthsOption:false,hasFreeShippingValue:false,hasMarketingColorsOption:false,hasRetailPricesShown:false,categoryID:false,hasUpsell:false,init:function(d,h,j,o,l,b,c,p,f,a,e,k,n,m,g){if(!document.getElementsByTagName||!document.getElementById){return false}Product.productType=d;if(h){Product.categoryID=h}if(g){Product.hasUpsell=g}if(o.length>0){Product.setFeatureToIDMap(j);Product.setTempToRealIDMap(o)}switch(Product.productType){case ("Capacity and Color"):if(b.length>0){Product.setColors(b);Product.hasColorsOption=true}if(c.length>0){Product.setMarketingColors(c);Product.hasMarketingColorsOption=true}if(b.length>0&&c.length>0){for(i=0;i<b.length;i++){Product.basicToMarketingColors[b[i].toLowerCase()]=c[i]}}if(l.length>0){Product.setCapacitiesFormatted(l);Product.setCapacities(l);Product.hasCapacitiesOption=true}break;case ("Capacity"):if(l.length>0){Product.setCapacitiesFormatted(l);Product.setCapacities(l);Product.hasCapacitiesOption=true}break;case ("Color"):if(b.length>0){Product.setColors(b);Product.hasColorsOption=true}if(c.length>0){Product.setMarketingColors(c);Product.hasMarketingColorsOption=true}if(b.length>0&&c.length>0){for(i=0;i<b.length;i++){Product.basicToMarketingColors[b[i].toLowerCase()]=c[i]}}break;case ("None"):break;default:break}if(p.length>0){Product.setRetailPrices(p);Product.hasRetailPricesShown=true}if(f.length>0){Product.setUnitPrices(f)}if(a.length>0){Product.setRebateAmt(a);Product.setHasRebate(a)}if(e.length>0){Product.setRebateSavings(e)}if(k.length>0){Product.setPriceDrop(k);Product.setHasPriceDrop(k)}if(n.length>0){Product.setAvailability(n)}if(m.length>0){Product.setShipping(m)}},getFirstCapacity:function(){return Product.capacities[0]},getFirstCapacityFormatted:function(){return Product.capacitiesFormatted[0]},getFirstColor:function(){return Product.colors[0].toLowerCase()},getFirstColorFormatted:function(){var a;a=Product.colors[0].substr(0,1).toUpperCase()+Product.colors[0].substr(1,Product.colors[0].length).toLowerCase();if(Product.hasMarketingColors()){return a}else{return Product.basicToMarketingColors[a]+" ("+a+") "}},getColorFormatted:function(a){var c,b;c=a.toLowerCase();c=c.substr(0,1).toUpperCase()+c.substr(1,c.length).toLowerCase();if(Product.hasMarketingColors()){b=Product.basicToMarketingColors[a.toLowerCase()]+" ("+c+") ";return b}else{return c}},getCapacityFormatted:function(e){var d=new String();var b=new String();var a;for(i=0;i<Product.capacitiesFormatted.length;i++){a=Product.capacitiesFormatted[i].length;d=Product.capacitiesFormatted[i].substring(0,a-2);d=d.replace(" ","");b=Product.capacitiesFormatted[i].substring(a-2,a);if(d=e){return Product.capacitiesFormatted[i]}else{return 0}}},getCapacity:function(c){var d=new String();var b=new String();var a;a=c.length;d=c.substring(0,a-2);d=d.replace(" ","");b=c.substring(a-2,a);return d},getProductFeatureString:function(b){var a="";for(i=0;i<b.length;i++){if(b[i]==""){}else{if(i+1==b.length){a=a+b[i].toLowerCase()}else{a=a+b[i].toLowerCase()+","}}}return a},getTempProductId:function(c){var b=Product.getProductFeatureString(c);var a=Product.featureToIDMap[b];return a},getProductId:function(d){var c=Product.getProductFeatureString(d);var a=Product.featureToIDMap[c];var b=Product.tempToRealIDMap[a];return b},getUnitPrice:function(c){var b=Product.getTempProductId(c);var a=Product.unitPrices[b];return a},getRetailPrice:function(c){var b=Product.getTempProductId(c);var a=Product.retailPrices[b];return a},getBeforeRebatePrice:function(c){var b=Product.getTempProductId(c);var a=Product.unitPrices[b];return a},getAfterRebatePrice:function(c){var b=Product.getTempProductId(c);var a=Product.retailPrices[b];return a},getRebateAmt:function(c){var b=Product.getTempProductId(c);var a=Product.rebateAmt[b];return a},getRebateSavings:function(c){var b=Product.getTempProductId(c);var a=Product.rebateSavings[b];return a},getShipping:function(c){var b=Product.getTempProductId(c);var a=Product.shippingInfo[b];return a},getAvailability:function(d){var c=Product.getTempProductId(d);var b=Product.availability[c];return b},getPriceDrop:function(b){var a=Product.getTempProductId(b);var c=Product.priceDrop[a];return c},getCategoryID:function(){if(Product.categoryID){return Product.categoryID}else{return false}},hasUpsellProducts:function(){return Product.hasUpsell},hasRebate:function(c){var b=Product.getTempProductId(c);var a=Product.hasRebateAmt[b];return a},hasPriceDrop:function(b){var a=Product.getTempProductId(b);var c=Product.hasPriceDropValue[a];return c},hasFreeShipping:function(c){var b=Product.getTempProductId(c);var a=Product.shippingInfo[b];if(a.toLowerCase()=="free"){return true}else{return false}},setCapacities:function(c){var d=new String();var b=new String();var a;for(i=0;i<c.length;i++){a=c[i].length;d=c[i].substring(0,a-2);d=d.replace(" ","");b=c[i].substring(a-2,a);Product.capacities[i]=d}},setCapacitiesFormatted:function(a){Product.capacitiesFormatted=a},setColors:function(a){Product.colors=a},setRetailPrices:function(a){Product.retailPrices=a},setUnitPrices:function(a){Product.unitPrices=a},setPriceDrop:function(a){Product.priceDrop=a},setHasPriceDrop:function(a){for(i=0;i<a.length;i++){if(a[i]!=0){Product.hasPriceDropValue[i]=true}else{Product.hasPriceDropValue[i]=false}}},setHasRebate:function(a){for(i=0;i<a.length;i++){if(a[i]>0){Product.hasRebateAmt[i]=true}else{Product.hasRebateAmt[i]=false}}},setMarketingColors:function(a){Product.marketingColors=a},setFeatureToIDMap:function(a){Product.featureToIDMap=a},setTempToRealIDMap:function(a){Product.tempToRealIDMap=a},setShipping:function(a){Product.shippingInfo=a},setAvailability:function(b){Product.availability=b},setRebateAmt:function(a){Product.rebateAmt=a},setRebateSavings:function(a){Product.rebateSavings=a},hasColors:function(){return Product.hasColorsOption},hasMarketingColors:function(){return Product.hasMarketingColorsOption},hasCapacity:function(){return Product.hasCapacityOption},hasLength:function(){return Product.hasLengthOption},hasRetailPrices:function(){return Product.hasRetailPricesShown}};
