var promoOffers = new Array; promoOffers[1] = new Array; promoOffers[1][1] = new Array(2, '', '', '', '', '', ''); promoOffers[1][2] = new Array(3, '', '', '', '', '', ''); promoOffers[1][3] = new Array(4, '', '', '', '', '', ''); promoOffers[3] = new Array; promoOffers[3][1] = new Array(13, '', '', '', '', '', ''); promoOffers[3][2] = new Array(14, '', '', '', '', '', ''); promoOffers[3][3] = new Array(15, '', '', '', '', '', ''); promoOffers[4] = new Array; promoOffers[4][1] = new Array(17, '', '', '', '', '', ''); promoOffers[5] = new Array; promoOffers[5][1] = new Array(32, '', '', '', '', '', ''); promoOffers[5][2] = new Array(31, '', '', '', '', '', ''); promoOffers[5][3] = new Array(30, '', '', '', '', '', ''); var costs = new Array; costs[2] = new Array; costs[2][1] = new Array(99, 99, 24, 99); costs[2][2] = new Array(92.5, 92.5, 17.5, 92.5); costs[3] = new Array; costs[3][1] = new Array(250, 125, 250, 125); costs[3][2] = new Array(235, 117.5, 235, 117.5); costs[3][3] = new Array(290, 145, 290, 145); costs[4] = new Array; costs[4][1] = new Array(299, 149.5, 299, 149.5); costs[4][2] = new Array(285, 142.5, 285, 142.5); costs[4][3] = new Array(345, 172.48, 345, 172.48); costs[13] = new Array; costs[13][1] = new Array(99, 99, 24, 99); costs[13][2] = new Array(92.5, 92.5, 17.5, 92.5); costs[14] = new Array; costs[14][1] = new Array(250, 125, 175, 125); costs[14][2] = new Array(235, 117.5, 160, 117.5); costs[14][3] = new Array(290, 145, 290, 145); costs[15] = new Array; costs[15][1] = new Array(299, 149.5, 224, 149.5); costs[15][2] = new Array(285, 142.5, 210, 142.5); costs[15][3] = new Array(345, 172.48, 345, 172.48); costs[17] = new Array; costs[17][1] = new Array(99, 99, 24, 99); costs[17][2] = new Array(92.5, 92.5, 17.5, 92.5); costs[30] = new Array; costs[30][1] = new Array(299, 149.5, 224, 149.5); costs[30][2] = new Array(285, 142.5, 210, 142.5); costs[30][3] = new Array(345, 172.48, 345, 172.48); costs[31] = new Array; costs[31][1] = new Array(250, 125, 175, 125); costs[31][2] = new Array(235, 117.5, 160, 117.5); costs[31][3] = new Array(290, 145, 290, 145); costs[32] = new Array; costs[32][1] = new Array(99, 0, 24, 0); costs[32][2] = new Array(92.5, 0, 17.5, 0); function subscriptionCostsUpdate() { var sectorID = $F('SubscriptionActSmartRetailChannel'); var productID = $F('SubscriptionProduct'); var paymentMethodID = $RF('SubscriptionPaymentMethod'); if (sectorID == '' || productID == '' || paymentMethodID == null) { $('listprice', 'discount-wrapper').invoke('hide'); $('discounts').update(); $('finalpricevalue').update(); return; } promo = promoOffers[sectorID][productID]; if (costs[promo[0]] && costs[promo[0]][paymentMethodID]) { prices = costs[promo[0]][paymentMethodID]; } else { $('listprice', 'discount-wrapper').invoke('hide'); $('discounts').update(); $('finalpricevalue').update(); return; } additionalRetailOutlets = $F('SubscriptionAdditionalRetailOutlets'); if (isUnsignedInteger(additionalRetailOutlets)) { intAdditionalRetailOutlets = parseInt(additionalRetailOutlets, 10); } else { intAdditionalRetailOutlets = 0; } listPrice = prices[0] + (prices[1] * intAdditionalRetailOutlets); finalPrice = prices[2] + (prices[3] * intAdditionalRetailOutlets); listPrice = listPrice.toFixed(2); finalPrice = finalPrice.toFixed(2); $('finalpricevalue').update( finalPrice); // Is list price the same as final price? If so there aren't any promotions if (!(promo[1] && promo[2]) && !(promo[3] && promo[4]) && !(promo[5] && promo[6])) { $('listprice', 'discount-wrapper').invoke('hide'); $('discounts').update(); } else { discountHTML = ''; if (promo[1] || promo[2]) { discountHTML += '