//Instant quote script for Promopays.com/Promopays.ca // Copyright Promopays.com // Author: Andrew Park // Last Updated: Nov 23, 2009. //Constants var option_embroidery = 5; var option_custom_num = 3; var option_custom_name = 6.50; var option_color = 2; //Minimum order amount var min_order = 12; //Discount for different colors var heatherDiscount = 0.07; //6.95 -> 6.50 var neutralDiscount = 0.14; //6.95 -> 5.95 //Volume discounts when quantity >= value //This needs to be from smallest to largest! var discountlevels = new Array(12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 84, 92, 100, 125, 150, 175, 200, 250, 300, 350, 400, 450, 500); var discountvalues = new Array(1.05, 0.05, 0.10, 0.14, 0.18, 0.22, 0.25, 0.28, 0.31, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55); colors = new Array("Category","Name","Image","Description","Price","White","Black","Natural","Ash","LightSteel","SportGrey","AthleticOrange","Army","Azalea","BabyBlue","Banana","Bella_White_Black","Bella_White_Pink","Berry","Black_IceGrey","Blueberry","BlueDusk","BlueSurf","Brown","Cardinal","CardinalRed","CarolinaBlue","Cedar","Charcoal","CharcoalHeather","Chestnut","Chocolate","CoalGrey","Crimson","Daisy","DarkChocolate","DarkHeather","DeepForest","DeepHeather","DeepNavy","DeepRed","DeepRoyal","DrkChoco_Sand","FadedOlive","FatigueGreen","ForestGreen","Fuchsia","Gold","GoldNugget","HeatherCardinal","HeatherIndigo","Honeydew","IceGrey","Indigo","Iris","IrishGreen","KellyGreen","Leaf","LightBlue","LightPink","Lime","Maroon","MetroBlue","MilGreen_Tan","MilitaryGreen","Navy","Navy_LightBlue","Oceana","Olive","Orange","OxfordGrey","PalePink","Pebble","Pine","Pink","PrairieDust","Purple","Red","Royal","RoyalBlue","Sand","Sandstone","Sapphire","Seafoam","SereneGreen","SportGrey_Navy","Stone","StoneBlue","StonewashBlue","StonewashGreen","Tan","Tangerine","Teal","TexasOrange","Turquoise","VegasGold","Violet","Yellow","YellowHaze","White_Navy","WhiteBlackRinger","WhiteNavyRinger","WhiteRedRinger") items = new Array(); items[0] = new Array("T-shirt", "images/T-shirt.jpg", new Array("T-shirt","Gildan Heavy Cotton #5000","t-shirt_5000.jpg","apparel-catalog-1.html","7","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","","","","","1","","1","","","","","","1","","1","","","1","1","","1","","","","1","","","","1","","","","","","","","1","","1","1","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Gildan Ultra Cotton #2000","t-shirt_2000.jpg","apparel-catalog-1.html","7.25","1","1","1","1","","1","","","1","","","","","","","","1","","","","1","1","1","1","","1","","","","1","1","1","","","","","","","","","1","","1","","1","1","","1","1","1","1","1","1","1","1","1","1","1","","1","1","","1","1","1","","","","1","","1","1","1","","1","1","","1","","1","","","1","","","1","1","","1","","1","1","","1","","","",""), new Array("T-shirt","Gildan Heavy Cotton Youth #500B","t-shirt_youth_500B.jpg","apparel-catalog-1.html","7","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","1","1","","","","","","1","","","","1","","","","","","","","1","","1","1","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Gildan Ultra Cotton Youth #200B","t-shirt_youth_2000.jpg","apparel-catalog-1.html","7.25","1","1","","1","","1","","","","","","","","","","","","","","","1","","","","","","","","","1","1","","","","","","","","","","1","","1","","","","","","1","","1","1","","1","1","1","1","","","","1","","","","1","","","","","","","1","1","","1","1","","","","","","","","","","","1","","","","","","","","","","",""), new Array("T-shirt","Gildan Ultra Toddler #200P","t-shirt_toddler_200P.jpg","apparel-catalog-1.html","7.25","1","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Hanes Tagless #5250","t-shirt_hanes_tagless.jpg","apparel-catalog-1.html","7.25","1","1","1","1","1","","1","","","","","","","","","","","","","1","","1","","","1","","","","","","1","","1","","1","1","1","","","1","","","1","1","","","","","","","","1","","1","","1","1","","","","1","","","","1","1","1","1","","1","","1","","","","1","","","","","","","","","1","","","","1","","","","1","","","","",""), new Array("T-shirt","Gildan Ultra Cotton Elle Ladies #200L","t-shirt_elle_2000.jpg","apparel-catalog-1.html","8","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","1","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","1","","1","","","",""), new Array("T-shirt","Gildan Ultra Blend 50/50 #8000","t-shirt_ultra_blend_8000.jpg","apparel-catalog-1.html","7.25","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","1","","","","","","1","","","","","1","","","1","","","","1","","","","1","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Gildan SoftStyle Mens #6400","t-shirt_softstyle_mens_6400.jpg","apparel-catalog-1.html","8","1","","","","","1","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","","","","","","1","","","","","","1","","","","","1","","1","","","","1","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Gildan SoftStyle Ladies #640L","t-shirt_softstyle_ladies_640L.jpg","apparel-catalog-1.html","9","1","1","","","","1","","","","1","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","",""), new Array("T-shirt","Hanes Tagless Youth #5450","t-shirt_hanes_tagless_youth_5450.jpg","apparel-catalog-1.html","7.25","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","1","","1","","","1","1","","","","","","1","","","","","","","","","","","1","","1","1","","","","1","","","","1","","1","","","","","1","","","","1","","","","","","","","","","","","","","","","","1","","","","",""), new Array("T-shirt","Hanes Heavyweight #5280","t-shirt_hanes_heavyweight_5280.jpg","apparel-catalog-1.html","7","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","1","1","","","","","","","","","","","","","","","","","1","","","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Gildan Ultra Ringer #2600","t-shirt_ultra_cotton_ringer_2600.jpg","apparel-catalog-1.html","9.25","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","1","1"), new Array("T-shirt","ATC Contrast Stitch Tee #S820","t-shirt_the_authentic_t-shirt_company_contrast_stitch_tee_s820.jpg","apparel-catalog-1.html","12","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","1","","",""), new Array("T-shirt","Bella Ringer Ladies #1007","t-shirt_bella_ringer_ladies_1007.jpg","apparel-catalog-1.html","11.5","","","","","","","","","","","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Bella Deep V-Neck #8705","t-shirt_bella_deep_v_neck_8705.jpg","apparel-catalog-1.html","18.5","1","1","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","1","","","","","","","","","",""), new Array("T-shirt","Bella V-Neck Ladies #1005","t-shirt_bella_v_neck_1005.jpg","apparel-catalog-1.html","13.75","1","1","","","","","","","","1","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Bella Ladies Tee #1001","t-shirt_bella_crewneck_ladies_1001.jpg","apparel-catalog-1.html","13.5","1","1","","","","","","1","","1","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","1","","","","","","","","","","1","","","","1","","","","","1","","","","","","","","","1","","","1","","1","","","","","","","","","","","","","1","","","","","","","","","",""), new Array("T-shirt","Bella Jersey Knit Ladies #6001","t-shirt_bella_jersey_knit_ladies_6001.jpg","apparel-catalog-1.html","12.75","1","1","","","","","","","","1","","","","","","","","","","","","","","","","","1","","","","","","","1","","","","","","","","","","","","","","","","","","1","","","","","","","","","1","","","","1","","","","","1","","","1","","","","","","","","","","","","","","","","","1","","","","","","","",""), new Array("T-shirt","Bella Scoop Neck Ladies #1003","t-shirt_bella_scoop_neck_ladies_1003.jpg","apparel-catalog-1.html","12.75","1","1","","","","","","","","1","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Coal Harbour Dri-Fit Ladies #L451","t-shirt_coal_harbour_wicking_ladies_L451.jpg","apparel-catalog-1.html","22.5","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","1","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Coal Harbour Dri-Fit Mens #S451","t-shirt_coal_harbour_wicking_mens_S451.jpg","apparel-catalog-1.html","22.5","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","1","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("T-shirt","Coal Harbour Dri-Fit Youth #Y451","t-shirt_coal_harbour_wicking_youth_Y451.jpg","apparel-catalog-1.html","22.5","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","","")); items[1] = new Array("Golf Shirt", "images/Golf Shirt.jpg", new Array("Golf Shirt","Gildan Ultra Cotton Jersey #2800","golf-shirt_2800.jpg","apparel-catalog-1.html","15.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Golf Shirt","Gildan Ultra Cotton Pique #3800","golf-shirt_3800.jpg","apparel-catalog-1.html","18","1","1","","","","1","","","","","","","","","","","1","","","","1","","","1","","","","","","","","","","","","","","","","","1","","","","","","","","1","","","","","1","","","","","","","1","","","","","","","","","","","","1","","1","1","","","","","","","","","","","1","","","","","","","1","","","",""), new Array("Golf Shirt","Coal Harbour Silk Touch Youth #Y430","golf-shirt_coal_harbour_silk_touch_youth_y430.jpg","apparel-catalog-1.html","18","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","1","1","","","","","","","","","","","","",""), new Array("Golf Shirt","Coal Harbour Pima Pique #S410","golf-shirt_coal_harbour_pima_pique_S410.jpg","apparel-catalog-1.html","27","1","1","","","","","","","","","1","","","","","1","","1","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","",""), new Array("Golf Shirt","Coal Harbour Pima Ladies #L410","golf-shirt_coal_harbour_pima_pique_ladies_L410.jpg","apparel-catalog-1.html","27","1","1","","","","","","","","","1","","","","","1","","1","","","1","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","")); items[2] = new Array("Long Sleeve", "images/Long Sleeve.jpg", new Array("Long Sleeve","Gildan Heavy Cotton #5400","long-sleeve_5400.jpg","apparel-catalog-1.html","9.25","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Long Sleeve","Gildan Ultra Cotton #3500","long-sleeve_3500.jpg","apparel-catalog-1.html","11.75","1","1","1","1","","1","","","","","","","","","","","","","","","1","","","1","","","","","","","1","1","","","","","","","","","1","","1","","","","","","1","","","","","1","1","","1","","","","1","","","","1","","","","","","","","1","","1","","","","","","","","","","","","","","1","","","","","","","","",""), new Array("Long Sleeve","Gildan Ultra Cotton Youth #240B","long-sleeve_youth_240B.jpg","apparel-catalog-1.html","10.75","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","1","1","","1","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Long Sleeve","Hanes Heavyweight #5286","long-sleeve_hanes_tagless.jpg","apparel-catalog-1.html","9.25","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","1","1","","","","","","","","","","","","","","","","","","","","1","","","","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","")); items[3] = new Array("Sweatshirt", "images/Sweatshirt.jpg", new Array("Sweatshirt","Gildan Heavyweight #1801","sweatshirt_1801.jpg","apparel-catalog-1.html","14.25","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","","","","1","","","","","","","","","","","","","1","1","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sweatshirt","Gildan Ultra Cotton #0900","sweatshirt_0900.jpg","apparel-catalog-1.html","22.75","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","","","","1","","","","","","","","1","","","","","","","","1","","","","1","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sweatshirt","Gildan Heavyweight Youth #180B","sweatshirt_180B.jpg","apparel-catalog-1.html","13.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sweatshirt","Hanes Comfortblend #P160","sweatshirt_P160.jpg","apparel-catalog-1.html","14.25","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","1","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sweatshirt","Hanes Comfortblend Youth #P360","sweatshirt_P360.jpg","apparel-catalog-1.html","13.5","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","1","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","")); items[4] = new Array("Hoodie", "images/Hoodie.jpg", new Array("Hoodie","Gildan Heavyweight #1850","hoodie_1850.jpg","apparel-catalog-1.html","22","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","","","","1","","","","","","","","","","1","","","1","1","","1","","","","1","","","","1","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Hoodie","Gildan Ultra Cotton #9500","hoodie_9500.jpg","apparel-catalog-1.html","32.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","1","","","","","","","","","1","","","","","","","","1","","","","","1","1","","1","","","","1","","","","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","","","","","","",""), new Array("Hoodie","Gildan Heavyweight Youth #185B","hoodie_185B.jpg","apparel-catalog-1.html","20.75","1","1","","1","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","1","","","1","1","","1","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Hoodie","Hanes Comfortblend #P170","hoodie_P170.jpg","apparel-catalog-1.html","22","1","1","","","1","","","","","","","","","","","","","","1","","","","","","","","","","","","","","1","","1","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Hoodie","Hanes Cotton #F170","hoodie_F170.jpg","apparel-catalog-1.html","32.5","1","1","","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","1","1","1","","","","","","","1","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","")); items[5] = new Array("Sports Wear", "images/Sports Wear.jpg", new Array("Sports Wear","Gildan Ultra Cotton #0220","sports-wear_0220.jpg","apparel-catalog-1.html","8.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sports Wear","Gildan Ultra Cotton #2700","sports-wear_2700.jpg","apparel-catalog-1.html","7.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sports Wear","Gildan Ultra Cotton Elle #220L","sports-wear_220L.jpg","apparel-catalog-1.html","8.5","1","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","1","","1","","","",""), new Array("Sports Wear","King Fashions Sports #9340","sports-wear_9340.jpg","apparel-catalog-1.html","16.25","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","1","1"), new Array("Sports Wear","Hanes Stay Clean Jersey #H960","sports-wear_H960.jpg","apparel-catalog-1.html","21.25","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Sports Wear","Coal Harbour Wicking #S450","sports-wear_S450.jpg","apparel-catalog-1.html","36.25","1","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","")); items[6] = new Array("Pant", "images/Pant.jpg", new Array("Pant","Gildan Heavyweight #1820","pant_1820.jpg","apparel-catalog-1.html","17.5","","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Pant","Gildan Heavyweight Youth #182B","pant_182B.jpg","apparel-catalog-1.html","17","","1","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","1","","1","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Pant","Bella Ladies Yoga #0810","pant_0810.jpg","apparel-catalog-1.html","33.25","","1","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","",""), new Array("Pant","Bella Ladies Fleece #7017","pant_7017.jpg","apparel-catalog-1.html","30.25","1","1","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","","","","","","","","","","","","","","","","","","","","","1","","","","","","","","","1","","","1","","","","","","","","","","","","","","","","","","","","","","","","","")); //Variables and Constants var step1Slide, step2Slide, step3Slide, step4Slide; var arrayDelimiter = '~x~~'; //these selected* used to keep track of "cart" var selectedCategory = new Array(); var selectedStyle = new Array(); var selectedColour = new Array(); var selectedEmbroidery = new Array(); var selectedCustomNum = new Array(); var selectedCustomName = new Array(); var selectedColoursFront = new Array(); var selectedColoursBack = new Array(); var selectedColoursLeft = new Array(); var selectedColoursRight = new Array(); var selectedQuantity = new Array(); var itemPrices = new Array(); var itemNotes = new Array(); var itemExists = new Array(); var itemImages = new Array(); var numItems = 0; //track number of items in cart as well as index we're on //Track final price var subtotal = 0; window.addEvent('domready', function() { var status = { 'true': 'open', 'false': 'close' }; //-vertical step1Slide = new Fx.Slide('step1content'); step2Slide = new Fx.Slide('step2content'); step3Slide = new Fx.Slide('step3content'); step4Slide = new Fx.Slide('step4content'); //start off all closed except step1 step2Slide.hide(); step3Slide.hide(); step4Slide.hide(); var onUploadButtonClick = function(e){ //the second argument of setForm is crucial, //which tells Connection Manager this is a file upload form YAHOO.util.Connect.setForm('testForm', true); //what to do when upload is finished var uploadHandler = { upload: function(o) { var mystr = o.responseText; if(mystr.substring(1,6) == "~~~~~") { closeUpload(); $('testFile').value = ""; itemImages[numItems] = mystr.substring(6,mystr.length-1); $('uploadedimage').innerHTML = 'Associated Image:
http://www.promopays.com/instantquotes/uploadedfiles/'+mystr.substring(6,mystr.length-1)+''; } else { alert(mystr); } } }; YAHOO.util.Connect.asyncRequest('POST', 'upload.php', uploadHandler); }; YAHOO.util.Event.on('uploadButton', 'click', onUploadButtonClick); }); function selectCategory(cat) { selectedCategory[numItems] = cat; //store category in global variable //Begin generate HTML to display Step 2 //snap scrolling commented out //var result = "
"; var result = "
"; result += "
"; result += "
"; //start at 2 since items[cat][0]=category name, items[cat][1]=category picurl for (var i=2; i
'+items[cat][i][1]+'

Click for Details
'; } result += "
"; //snap scrolling commented out //result += "
"; result += "
"; $('step2content').innerHTML = result; //End generate HTML to display Step 2 //Make sure future steps are hidden in case user is going back a step step2Slide.hide(); step2Slide.slideIn(); step3Slide.slideOut(); step4Slide.slideOut(); } function selectStyle(cat,sty) { selectedStyle[numItems] = sty; //store style in global variable //Begin generate HTML to display Step 3 var result = ""; //items[cat][sty][0] = style name, items[cat][sty][1]=style picurl, items[cat][sty][2]=style price for (var i=5; i'; } } $('step3content').innerHTML = result; //End generate HTML to display Step 3 //Make sure future steps are hidden in case user is going back a step step3Slide.hide(); step3Slide.slideIn(); step4Slide.slideOut(); } function selectColor(cat,sty,num) { selectedColour[numItems] = num; //store color in global variable //Reanimate step 4 even though nothing changes step4Slide.hide(); step4Slide.slideIn(); } //resets all steps function resetAll() { $('step2content').innerHTML = ""; //Hide prevoius associated image and notes $('uploadedimage').innerHTML = ""; //Hide previous notes $('extranotes').value = ""; toLeft('scrollcontainer1'); //reset scroll box all the way to left //Hide future steps step2Slide.slideOut(); step3Slide.slideOut(); step4Slide.slideOut(); //Reset extra options stuff $('embroidery').checked = false; $('custom_number').checked = false; $('custom_name').checked = false; $('colours_front').value = 0; $('colours_back').value = 0; $('colours_left').value = 0; $('colours_right').value = 0; $('quantity').value = 12; } //Add an item to cart function addItem() { //Check quantity to make sure it is an integer and at least 12 selectedQuantity[numItems] = parseInt($('quantity').value); if (selectedQuantity[numItems] < min_order) { alert("Minimum quantity is 12"); return null; } //Save additional item notes itemNotes[numItems] = $('extranotes').value; addNotes = itemNotes[numItems]; if (addNotes == "") { addNotes = "None."; } //Hide default instructions $('instructions').style.display = "none"; //Product Data var categoryName = items[selectedCategory[numItems]][0]; var styleName = items[selectedCategory[numItems]][selectedStyle[numItems]][1]; var unitPrice = parseFloat(items[selectedCategory[numItems]][selectedStyle[numItems]][4]); var imageURL = "images/apparel/"+items[selectedCategory[numItems]][selectedStyle[numItems]][2]; //var imageURL = 'images/tshirt_tb.jpg'; // Check selected colour for a neutral/heather discount if (selectedColour[numItems] == 5 || selectedColour[numItems] == 6) { unitPrice *= (1-neutralDiscount); //White and Natural } else if (selectedColour[numItems] >= 7 && selectedColour[numItems] <= 9) { unitPrice *= (1-heatherDiscount); //Ash, LightSteel and SportGrey } // Check for colours var coloursFront = $('colours_front').value; var coloursBack = $('colours_back').value; var coloursLeft = $('colours_left').value; var coloursRight = $('colours_right').value; // Store colours in cart array selectedColoursFront[numItems] = coloursFront; selectedColoursBack[numItems] = coloursBack; selectedColoursLeft[numItems] = coloursLeft; selectedColoursRight[numItems] = coloursRight; if (coloursFront == 1) { colourOptions = '
Front: 1 colour
'; unitPrice += option_color; } else if (coloursFront > 1) { colourOptions = '
Front: '+coloursFront+' colours
'; unitPrice += coloursFront * option_color; } else { colourOptions = '
Front: None
'; } if (coloursBack == 1) { colourOptions += '
Back: 1 colour
'; unitPrice += option_color; } else if (coloursBack > 1) { colourOptions += '
Back: '+coloursBack+' colours
'; unitPrice += coloursBack * option_color; } else { colourOptions += '
Back: None
'; } if (coloursLeft == 1) { colourOptions += '
L Arm: 1 colour
'; unitPrice += option_color; } else if (coloursLeft > 1) { colourOptions += '
L Arm: '+coloursLeft+' colours
'; unitPrice += coloursLeft * option_color; } else { colourOptions += '
L Arm: None
'; } if (coloursRight == 1) { colourOptions += '
R Arm: 1 colour
'; unitPrice += option_color; } else if (coloursRight > 1) { colourOptions += '
R Arm: '+coloursRight+' colours
'; unitPrice += coloursRight * option_color; } else { colourOptions += '
R Arm: None
'; } //Calculate product discounts based on quantity for (i=discountlevels.length;i>0;i--) { if (selectedQuantity[numItems] >= discountlevels[i]) { unitPrice = unitPrice * (1-discountvalues[i]); break; } } //Product Extras var productOptions = ""; //set options to 0 temporarily selectedEmbroidery[numItems] = 0; selectedCustomNum[numItems] = 0; selectedCustomName[numItems] = 0; if ($('embroidery').checked == true) { productOptions += '
• Embroidery up to 5000 stitching
'; unitPrice += option_embroidery; selectedEmbroidery[numItems] = 1; } if ($('custom_number').checked == true) { productOptions += '
• Personalized Number
'; unitPrice += option_custom_num; selectedCustomNum[numItems] = 1; } if ($('custom_name').checked == true) { productOptions += '
• Personalized Name
'; unitPrice += option_custom_name; selectedCustomName[numItems] = 1; } //if no options selected then say so if (productOptions == "") { productOptions += '
None.
'; } //Order data var unitContent = "$" + unitPrice.toFixed(2); var totalPrice = selectedQuantity[numItems]*unitPrice.toFixed(2); itemPrices[numItems] = totalPrice.toFixed(2); var totalContent = "$" + totalPrice.toFixed(2); //Generate HTML to be displayed var content = '
'; content += '
'; content += '
' + styleName + " " + categoryName + '
'; content += '
'; content += '
Color:
'; content += colourOptions + '
Options'; content += productOptions + '
Additional Notes
'+addNotes+'
'; content += '
'; //content += '
x '+selectedQuantity[numItems]+' items
'; content += '
UNIT PRICE
  '+unitContent+'
'; content += '
QTY
  '+selectedQuantity[numItems]+'
'; content += '
TOTAL
  '+totalContent+'
'; //create the new row and fill it with HTML generated above var tableRef = $('quotetable'); var newRow = tableRef.insertRow(0); var newCell = newRow.insertCell(0); newCell.innerHTML = content; var itemdivid = "quote" + numItems; //the quote box id $(itemdivid).fade('hide'); $(itemdivid).fade('in'); //Update totals subtotal += totalPrice; $('subtotal').innerHTML = "$" + subtotal.toFixed(2) + ""; resetAll(); itemExists[numItems] = 1; //set this item as exist in cart numItems++; //increment number of items in cart $('nextstep').disabled = false; } //delete an item from cart -- just marks it as deleted and hides the box function deleteItem(num) { itemExists[num] = 0; //set this item as deleted var itemdivid = "quote" + num; //the quote box id $(itemdivid).fade('out'); //fade out the box setTimeout("offDisplay('"+itemdivid+"');", 500); //set box display to none //Update totals subtotal -= itemPrices[num]; if (subtotal < 0) { subtotal *= -1; } //make sure subtotal isn't -0.00 $('subtotal').innerHTML = "$" + subtotal.toFixed(2) + ""; } //hide a box and display instructions if necessary function offDisplay(divid) { $(divid).style.display = "none"; //Check if there are no more items, if so display first instruction and disable Next Step button if (sum(itemExists) == 0) { $('instructions').style.display = "inline"; $('nextstep').disabled = true; } } function openForm() { $('ajaxmessage').innerHTML = ""; $('quotesubmitform').style.display="inline"; } function closeForm() { $('quotesubmitform').style.display="none"; } function openUpload() { $('uploadform').style.display="inline"; } function closeUpload() { $('uploadform').style.display="none"; } //pass cart data to php script via ajax function submitQuote() { //remove any error messages and prevent double clicking $('ajaxmessage').innerHTML = ""; $('submitquotebutton').disabled = true; $('submitquotebutton').value = "Submitting..."; //prepare parameters for sending to php script var params = "itemExists=" + encodeURIComponent(itemExists.join(arrayDelimiter)); params += "&selectedCategory=" + encodeURIComponent(selectedCategory.join(arrayDelimiter)); params += "&selectedStyle=" + encodeURIComponent(selectedStyle.join(arrayDelimiter)); params += "&selectedColour=" + encodeURIComponent(selectedColour.join(arrayDelimiter)); params += "&selectedEmbroidery=" + encodeURIComponent(selectedEmbroidery.join(arrayDelimiter)); params += "&selectedCustomNum=" + encodeURIComponent(selectedCustomNum.join(arrayDelimiter)); params += "&selectedCustomName=" + encodeURIComponent(selectedCustomName.join(arrayDelimiter)); params += "&selectedColoursFront=" + encodeURIComponent(selectedColoursFront.join(arrayDelimiter)); params += "&selectedColoursBack=" + encodeURIComponent(selectedColoursBack.join(arrayDelimiter)); params += "&selectedColoursLeft=" + encodeURIComponent(selectedColoursLeft.join(arrayDelimiter)); params += "&selectedColoursRight=" + encodeURIComponent(selectedColoursRight.join(arrayDelimiter)); params += "&selectedQuantity=" + encodeURIComponent(selectedQuantity.join(arrayDelimiter)); params += "&itemPrices=" + encodeURIComponent(itemPrices.join(arrayDelimiter)); params += "&itemNotes=" + encodeURIComponent(itemNotes.join(arrayDelimiter)); params += "&itemImages=" + encodeURIComponent(itemImages.join(arrayDelimiter)); params += "&name=" + encodeURIComponent($('clientname').value); params += "&email=" + encodeURIComponent($('clientemail').value); params += "&phone=" + encodeURIComponent($('clientphone').value); params += "&ordernotes=" + encodeURIComponent($('clientnotes').value); params += "&currtime=" + encodeURIComponent($('currenttime').value); //send ajax request to php script (default method is post) var myRequest = new Request({ method: 'post', url: 'sendquote.php', onSuccess: function(txt) { //Only returns text if there was an error //Output any error/success message and reset the submission button if (txt != "success") { $('ajaxmessage').innerHTML = txt; $('submitquotebutton').value = "Submit Quote"; $('submitquotebutton').disabled = false; } else { $('ajaxmessage').innerHTML = 'Your quote has been submitted! A representative will be contacting you within one business day. Please check your spam filters if you do not receive an e-mail within the next few minutes.
Go to homepage'; } }, onFailure: function() { $('ajaxmessage').innerHTML = "Sending Quote Failed"; } }); myRequest.send(params); } function sum(myArray) { var result = 0; for (i=0; i