jcTEST1var VATRate = 20; promoOffers[5] = new Array; promoOffers[5][-1] = new Array(88, '', '', '', '', '', ''); promoOffers[5][1] = new Array(32, '', '', '', '', '', ''); promoOffers[5][2] = new Array(31, '', '', '', '', '', ''); promoOffers[5][3] = new Array(30, '', '', '', '', '', ''); var costs = new Array; costs[30] = new Array; costs[30][1] = new Array(390, 195, 390, 195); costs[30][2] = new Array(300, 150, 300, 150); costs[30][3] = new Array(360, 180, 360, 180); costs[30][8] = new Array(360, 180, 360, 180); costs[31] = new Array; costs[31][1] = new Array(300, 150, 300, 150); costs[31][2] = new Array(240, 120, 240, 120); costs[31][8] = new Array(288, 144, 288, 144); costs[32] = new Array; costs[32][1] = new Array(90, 45, 90, 45); costs[32][2] = new Array(60, 30, 60, 30); costs[33] = new Array; costs[33][1] = new Array(70, 70, 70, 70); costs[33][2] = new Array(60, 60, 60, 60); costs[88] = new Array; costs[88][1] = new Array(135, 67.5, 135, 67.5); costs[88][2] = new Array(120, 60, 120, 60); function subscriptionCostsUpdateTIO() { var sectorID = 5; var paymentMethodID =2; var productID = $('#SubscriptionProduct').val(); promo = promoOffers[sectorID][productID]; prices = costs[promo[0]][paymentMethodID]; additionalRetailOutlets = $('#SubscriptionAdditionalRetailOutlets').val(); if (isUnsignedInteger(additionalRetailOutlets)) { intAdditionalRetailOutlets = parseInt(additionalRetailOutlets, 10); } else { intAdditionalRetailOutlets = 0; } listPrice = (prices[0] + (prices[1] * intAdditionalRetailOutlets)); finalPrice = (prices[0] + (prices[1] * intAdditionalRetailOutlets)); listPrice = listPrice.toFixed(2); finalPrice = finalPrice.toFixed(2); $('#finalpricevalue').html( finalPrice); $('#totalcost').val(finalPrice); var finalPriceVAT = (finalPrice * (( VATRate)/100)).toFixed(2);; $('#finalpricevalueVAT').html( finalPriceVAT); } function isUnsignedInteger(s) { return (s.toString().search(/^[0-9]+$/) == 0); }