var deals_cols = ['network', 'sku', 'zcode', 'variantid', 'tariffid', 'months', 'upfront', 'offerend', 'monthly', 'promoamt', 'promolen'];
var deals = [
['3','','2136',0,0,24,0.00,'',13.00,13.00,0],
['3','','2116',1,1,24,0.00,'',25.00,25.00,0],
['3','','2197',2,1,24,0.00,'',30.00,30.00,0],
['3','','2230',3,2,24,0.00,'',8.89,8.89,0],
['3','','2291',4,2,24,0.00,'',7.87,7.87,0],
['3','','2332',5,0,24,129.00,'',25.00,25.00,0],
['3','','2333',6,0,24,129.00,'',25.00,25.00,0],
['3','','2406',7,3,24,0.00,'',23.00,23.00,0],
['3','','2323',8,3,24,0.00,'',18.00,18.00,0],
['3','','2409',9,3,24,0.00,'',37.00,37.00,0],
['3','','2410',10,4,24,0.00,'',18.00,18.00,0],
['3','','2247',11,3,24,0.00,'',33.00,33.00,0],
['3','','2313',12,3,24,0.00,'',33.00,33.00,0],
['3','','2410',10,3,24,0.00,'',23.00,23.00,0],
['3','','2202',13,5,24,0.00,'',18.00,18.00,0],
['3','','2312',14,3,24,0.00,'',25.00,25.00,0],
['3','','2136',0,5,24,0.00,'',18.00,18.00,0],
['3','','2230',3,6,18,19.99,'',15.99,15.99,0],
['3','','2230',3,6,18,0.00,'',17.01,17.01,0],
['3','','2230',3,7,18,0.00,'',22.01,22.01,0],
['3','','2230',3,8,24,0.00,'',17.01,17.01,0],
['3','','2274',15,7,24,229.00,'',25.00,25.00,0],
['3','','2276',16,7,24,379.00,'',25.00,25.00,0],
['3','','2277',17,7,24,229.00,'',25.00,25.00,0],
['3','','2279',18,7,24,379.00,'',25.00,25.00,0],
['3','','2323',8,0,24,0.00,'',13.00,13.00,0],
['3','','2323',8,9,24,0.00,'',15.00,15.00,0],
['3','','2248',19,9,24,0.00,'',20.00,20.00,0],
['3','','2248',19,1,24,0.00,'',25.00,25.00,0],
['3','','2288',20,9,24,0.00,'',20.00,20.00,0],
['3','','2288',20,1,24,0.00,'',27.00,27.00,0],
['3','','2151',21,0,24,0.00,'',13.00,13.00,0],
['3','','2151',21,9,24,0.00,'',15.00,15.00,0],
['3','','2124',22,0,24,0.00,'',20.00,20.00,0],
['3','','2124',22,9,24,0.00,'',22.00,22.00,0],
['3','','2124',22,1,24,0.00,'',30.00,30.00,0],
['3','','2227',23,9,24,0.00,'',25.00,25.00,0],
['3','','2227',23,1,24,0.00,'',32.00,32.00,0],
['3','','2253',24,10,24,0.00,'',18.00,18.00,0],
['3','','2253',24,0,24,0.00,'',15.00,15.00,0],
['3','','2253',24,9,24,0.00,'',20.00,20.00,0],
['3','','2253',24,1,24,0.00,'',25.00,25.00,0],
['3','','2313',12,1,24,0.00,'',35.00,35.00,0],
['3','','2321',25,0,24,0.00,'',20.00,20.00,0],
['3','','2321',25,1,24,0.00,'',30.00,30.00,0],
['3','','2315',26,9,24,0.00,'',34.00,34.00,0],
['3','','2315',26,1,24,0.00,'',40.00,40.00,0],
['3','','2325',27,9,24,0.00,'',30.00,30.00,0],
['3','','2325',27,1,24,0.00,'',37.00,37.00,0],
['3','','2411',28,9,24,0.00,'',34.00,34.00,0],
['3','','2286',29,9,24,0.00,'',30.00,30.00,0],
['3','','2286',29,1,24,0.00,'',37.00,37.00,0],
['3','','2411',28,1,24,0.00,'',40.00,40.00,0],
['3','','2136',0,9,24,0.00,'',15.00,15.00,0],
['3','','2153',30,10,24,0.00,'',15.00,15.00,0],
['3','','2153',30,0,24,0.00,'',13.00,13.00,0],
['3','','2153',30,9,24,0.00,'',15.00,15.00,0],
['3','','2263',31,9,24,0.00,'',15.00,15.00,0],
['3','','2269',32,9,24,0.00,'',15.00,15.00,0],
['3','','2414',33,1,24,0.00,'',37.00,37.00,0],
['3','','2414',33,9,24,0.00,'',30.00,30.00,0],
['3','','2273',34,0,24,0.00,'',13.00,13.00,0],
['3','','2290',35,0,24,0.00,'',13.00,13.00,0],
['3','','2290',35,9,24,0.00,'',15.00,15.00,0],
['3','','2153',30,11,24,0.00,'',10.00,10.00,0],
['3','','2196',36,1,24,0.00,'',30.00,30.00,0],
['3','','2407',37,9,24,0.00,'',28.00,28.00,0],
['3','','2407',37,1,24,0.00,'',34.00,34.00,0],
['3','','2409',9,9,24,0.00,'',34.00,34.00,0],
['3','','2409',9,1,24,0.00,'',40.00,40.00,0],
['3','','2105',38,12,24,0.00,'',20.00,20.00,0],
['3','','2105',38,9,24,0.00,'',25.00,25.00,0],
['3','','2105',38,1,24,0.00,'',30.00,30.00,0],
['3','','2333',6,9,24,49.00,'',30.00,30.00,0],
['3','','2332',5,9,24,49.00,'',30.00,30.00,0],
['3','','2332',5,1,24,99.00,'',30.00,30.00,0],
['3','','2333',6,1,24,19.00,'',35.00,35.00,0],
['3','','2332',5,1,24,19.00,'',35.00,35.00,0],
['3','','2333',6,1,24,99.00,'',30.00,30.00,0],
['3','','2327',39,1,24,99.00,'',35.00,35.00,0],
['3','','2326',40,1,24,99.00,'',35.00,35.00,0],
['3','','2326',40,1,24,49.00,'',40.00,40.00,0],
['3','','2327',39,1,24,49.00,'',40.00,40.00,0],
['3','','2326',40,0,24,129.00,'',30.00,30.00,0],
['3','','2327',39,0,24,129.00,'',30.00,30.00,0],
['3','','2136',0,0,24,0.00,'',13.00,13.00,0],
['3','','2153',30,10,24,0.00,'',15.00,15.00,0],
['3','','2327',39,9,24,49.00,'',35.00,35.00,0],
['3','','2326',40,9,24,49.00,'',35.00,35.00,0],
['3','','2326',40,13,24,0.00,'',43.00,43.00,0],
['3','','2153',30,0,24,0.00,'',13.00,13.00,0],
['3','','2153',30,9,24,0.00,'',15.00,15.00,0],
['3','','2327',39,13,24,0.00,'',43.00,43.00,0],
['3','','2328',41,0,24,219.00,'',30.00,30.00,0],
['3','','2328',41,1,24,149.00,'',35.00,35.00,0],
['3','','2328',41,1,24,139.00,'',40.00,40.00,0],
['3','','2328',41,13,24,90.00,'',43.00,43.00,0],
['3','','2269',32,9,24,0.00,'',15.00,15.00,0],
['3','','2330',42,0,24,309.00,'',30.00,30.00,0],
['3','','2331',43,0,24,309.00,'',30.00,30.00,0],
['3','','2330',42,9,24,229.00,'',35.00,35.00,0],
['3','','2331',43,9,24,229.00,'',35.00,35.00,0],
['3','','2330',42,1,24,279.00,'',35.00,35.00,0],
['3','','2331',43,1,24,279.00,'',35.00,35.00,0],
['3','','2068',44,10,24,0.00,'',15.00,15.00,0],
['3','','2331',43,1,24,229.00,'',40.00,40.00,0],
['3','','2331',43,1,24,229.00,'',40.00,40.00,0],
['3','','2330',42,13,24,180.00,'',43.00,43.00,0],
['3','','2275',45,14,1,579.00,'',15.00,15.00,0],
['3','','2331',43,13,24,180.00,'',43.00,43.00,0],
['3','','2315',26,15,0,449.99,'',0.00,0.00,0],
['3','','2329',46,1,24,139.00,'',40.00,40.00,0],
['3','','2068',44,0,24,0.00,'',13.00,13.00,0],
['3','','2068',44,9,24,0.00,'',15.00,15.00,0],
['3','','2290',35,0,24,0.00,'',13.00,13.00,0],
['3','','2275',45,7,24,279.00,'',25.00,25.00,0],
['3','','2329',46,16,0,599.99,'',0.00,0.00,0],
['3','','2329',46,13,24,90.00,'',43.00,43.00,0],
['3','','2329',46,0,24,219.00,'',30.00,30.00,0],
['3','','2329',46,1,24,149.00,'',35.00,35.00,0],
['3','','2273',34,0,24,0.00,'',13.00,13.00,0],
['3','','2290',35,9,24,0.00,'',15.00,15.00,0],
['3','','2273',34,9,24,0.00,'',15.00,15.00,0],
['3','','2293',47,7,18,0.00,'',23.99,23.99,0],
['3','','2202',13,10,24,0.00,'',18.00,18.00,0],
['3','','2202',13,0,24,0.00,'',15.00,15.00,0],
['3','','2202',13,9,24,0.00,'',20.00,20.00,0],
['3','','2202',13,1,24,0.00,'',25.00,25.00,0],
['3','','2313',12,9,24,0.00,'',30.00,30.00,0],
['3','','2406',7,12,24,0.00,'',15.00,15.00,0],
['3','','2406',7,0,24,0.00,'',18.00,18.00,0],
['3','','2406',7,1,24,0.00,'',27.00,27.00,0],
['3','','2406',7,9,24,0.00,'',20.00,20.00,0],
['3','','2404',48,10,24,0.00,'',18.00,18.00,0],
['3','','2404',48,0,24,0.00,'',15.00,15.00,0],
['3','','2404',48,9,24,0.00,'',20.00,20.00,0],
['3','','2404',48,1,24,0.00,'',25.00,25.00,0],
['3','','2168',49,10,24,0.00,'',18.00,18.00,0],
['3','','2168',49,0,24,0.00,'',15.00,15.00,0],
['3','','2168',49,9,24,0.00,'',20.00,20.00,0],
['3','','2168',49,1,24,0.00,'',25.00,25.00,0],
['3','','2228',50,0,24,0.00,'',13.00,13.00,0],
['3','','2228',50,9,24,0.00,'',15.00,15.00,0],
['3','','2167',51,10,24,0.00,'',18.00,18.00,0],
['3','','2167',51,0,24,0.00,'',15.00,15.00,0],
['3','','2167',51,9,24,0.00,'',20.00,20.00,0],
['3','','2167',51,1,24,0.00,'',25.00,25.00,0],
['3','','2314',52,10,24,0.00,'',18.00,18.00,0],
['3','','2314',52,0,24,0.00,'',15.00,15.00,0],
['3','','2314',52,9,24,0.00,'',20.00,20.00,0],
['3','','2314',52,1,24,0.00,'',25.00,25.00,0],
['3','','2322',53,9,24,0.00,'',25.00,25.00,0],
['3','','2450',54,17,1,0.00,'',15.00,15.00,0],
['3','','2322',53,1,24,0.00,'',32.00,32.00,0],
['3','','2408',55,12,24,0.00,'',15.00,15.00,0],
['3','','2408',55,0,24,0.00,'',18.00,18.00,0],
['3','','2408',55,9,24,0.00,'',20.00,20.00,0],
['3','','2408',55,1,24,0.00,'',27.00,27.00,0],
['3','','2312',14,9,24,0.00,'',22.00,22.00,0],
['3','','2312',14,1,24,0.00,'',29.00,29.00,0],
['3','','2410',10,12,24,0.00,'',15.00,15.00,0],
['3','','2410',10,9,24,0.00,'',20.00,20.00,0],
['3','','2410',10,1,24,0.00,'',27.00,27.00,0],
['3','','2332',5,13,24,0.00,'',38.00,38.00,0],
['3','','2333',6,13,24,0.00,'',38.00,38.00,0],
['3','','2266',56,9,24,0.00,'',20.00,20.00,0],
['3','','2229',57,4,24,0.00,'',18.00,18.00,0],
['3','','2250',58,9,24,0.00,'',20.00,20.00,0],
['3','','2250',58,1,24,0.00,'',25.00,25.00,0],
['3','','2242',59,9,24,0.00,'',22.00,22.00,0],
['3','','2242',59,1,24,0.00,'',29.00,29.00,0],
['3','','2287',60,9,24,0.00,'',25.00,25.00,0],
['3','','2287',60,1,24,0.00,'',32.00,32.00,0],
['3','','2247',11,9,24,0.00,'',30.00,30.00,0],
['3','','2247',11,1,24,0.00,'',35.00,35.00,0],
['3','','2229',57,12,24,0.00,'',15.00,15.00,0],
['3','','2229',57,0,24,0.00,'',18.00,18.00,0],
['3','','2229',57,9,24,0.00,'',20.00,20.00,0],
['3','','2229',57,1,24,0.00,'',27.00,27.00,0],
['3','','2400',61,9,24,0.00,'',28.00,28.00,0],
['3','','2400',61,1,24,0.00,'',34.00,34.00,0],
['3','','2315',26,3,24,0.00,'',37.00,37.00,0],
['3','','2242',59,3,24,0.00,'',25.00,25.00,0],
['3','','2406',7,5,24,0.00,'',21.00,21.00,0],
['3','','2327',39,18,24,0.00,'',46.00,46.00,0],
['3','','2124',22,3,24,0.00,'',25.00,25.00,0],
['3','','2124',22,5,24,0.00,'',23.00,23.00,0],
['3','','2321',25,5,24,0.00,'',23.00,23.00,0],
['3','','2321',25,3,24,0.00,'',25.00,25.00,0],
['3','','2322',53,3,24,0.00,'',28.00,28.00,0],
['3','','2287',60,3,24,0.00,'',28.00,28.00,0],
['3','','2411',28,3,24,0.00,'',37.00,37.00,0],
['3','','2250',58,3,24,0.00,'',23.00,23.00,0],
['3','','2105',38,4,24,0.00,'',23.00,23.00,0],
['3','','2105',38,3,24,0.00,'',28.00,28.00,0],
['3','','2407',37,3,24,0.00,'',31.00,31.00,0],
['3','','2229',57,3,24,0.00,'',23.00,23.00,0],
['3','','2229',57,5,24,0.00,'',21.00,21.00,0],
['3','','2406',7,4,24,0.00,'',18.00,18.00,0],
['3','','2291',4,19,1,0.00,'',15.99,15.99,0],
['3','','LAP001',62,20,24,0.00,'',36.41,36.41,0],
['3','','LAP004',62,21,24,99.99,'',31.31,31.31,0],
['3','','LAP005',63,21,24,99.99,'',32.33,32.33,0],
['3','','LAP002',63,20,24,0.00,'',37.43,37.43,0],
['3','','LAP001',62,22,24,69.00,'',26.20,26.20,0],
['3','','LAP002',63,22,24,69.00,'',27.22,27.22,0],
['3','','2230',3,8,24,0.00,'',21.01,21.01,0],
['3','','2324',64,19,1,49.99,'',15.99,15.99,0],
['3','','LAP002',63,22,24,69.00,'',31.31,31.31,0],
['3','','LAP005',63,21,24,69.00,'',36.42,36.42,0],
['3','','LAP004',62,23,24,0.00,'',41.53,41.53,0],
['3','','LAP005',63,23,24,0.00,'',42.55,42.55,0],
['3','','2291',4,8,24,0.00,'',19.99,19.99,0],
['3','','2293',47,8,24,0.00,'',18.99,18.99,0],
['3','','2293',47,6,18,0.00,'',18.99,18.99,0],
['3','','2324',64,8,24,0.00,'',18.99,18.99,0],
['3','','2324',64,7,18,0.00,'',23.99,23.99,0],
['3','','2324',64,2,24,0.00,'',10.87,10.87,0],
['3','','2324',64,2,18,0.00,'',10.87,10.87,0],
['3','','2324',64,6,18,0.00,'',18.99,18.99,0],
['3','','2291',4,7,18,0.00,'',20.99,20.99,0],
['3','','2291',4,8,24,0.00,'',15.99,15.99,0],
['3','','2291',4,6,18,0.00,'',15.99,15.99,0],
['3','','2291',4,19,1,4.99,'',15.99,15.99,0],
['3','','2291',4,2,18,0.00,'',7.87,7.87,0],
['3','','2230',3,2,18,0.00,'',8.89,8.89,0],
['3','','2274',15,14,1,499.00,'',15.00,15.00,0],
['3','','2277',17,14,1,499.00,'',15.00,15.00,0],
['3','','2276',16,14,1,659.00,'',15.00,15.00,0],
['3','','2279',18,14,1,659.00,'',15.00,15.00,0],
['3','','2105',38,16,0,299.99,'',0.00,0.00,0],
['3','','2326',40,16,0,499.99,'',0.00,0.00,0],
['3','','2327',39,16,0,499.99,'',0.00,0.00,0],
['3','','2332',5,16,0,399.99,'',0.00,0.00,0],
['3','','2333',6,16,0,399.99,'',0.00,0.00,0],
['3','','2328',41,16,0,599.99,'',0.00,0.00,0],
['3','','2330',42,16,0,699.99,'',0.00,0.00,0],
['3','','2331',43,16,0,699.99,'',0.00,0.00,0],
['3','','2409',9,15,0,499.99,'',0.00,0.00,0],
['3','','2321',25,15,0,149.99,'',0.00,0.00,0],
['3','','2325',27,15,0,379.99,'',0.00,0.00,0],
['3','','2250',58,15,0,129.99,'',0.00,0.00,0],
['3','','2248',19,15,0,129.99,'',0.00,0.00,0],
['3','','2287',60,15,0,399.99,'',0.00,0.00,0],
['3','','2288',20,15,0,129.99,'',0.00,0.00,0],
['3','','2286',29,15,0,449.99,'',0.00,0.00,0],
['3','','2228',50,15,0,44.99,'',0.00,0.00,0],
['3','','2167',51,15,0,109.99,'',0.00,0.00,0],
['3','','2227',23,15,0,429.99,'',0.00,0.00,0],
['3','','2247',11,15,0,429.99,'',0.00,0.00,0],
['3','','2313',12,15,0,429.99,'',0.00,0.00,0],
['3','','2406',7,15,0,129.99,'',0.00,0.00,0],
['3','','2151',21,15,0,49.99,'',0.00,0.00,0],
['3','','2323',8,15,0,49.99,'',0.00,0.00,0],
['3','','2314',52,15,0,69.99,'',0.00,0.00,0],
['3','','2253',24,15,0,69.99,'',0.00,0.00,0],
['3','','2312',14,15,0,299.99,'',0.00,0.00,0],
['3','','2410',65,15,0,99.99,'',0.00,0.00,0],
['3','','2407',37,16,0,379.99,'',0.00,0.00,0],
['3','','2411',28,15,0,409.99,'',0.00,0.00,0],
['3','','2202',13,15,0,69.99,'',0.00,0.00,0],
['3','','2322',53,15,0,229.99,'',0.00,0.00,0],
['3','','2124',22,15,0,149.99,'',0.00,0.00,0],
['3','','2229',57,15,0,129.99,'',0.00,0.00,0],
['3','','2242',59,15,0,279.99,'',0.00,0.00,0],
['3','','2408',55,15,0,119.99,'',0.00,0.00,0],
['3','','2321',25,9,24,0.00,'',22.00,22.00,0],
['3','','2136',0,9,24,0.00,'',15.00,15.00,0],
['3','','2293',47,19,1,49.99,'',15.99,15.99,0],
['3','','2293',47,2,24,0.00,'',10.87,10.87,0],
['3','','2293',47,2,18,0.00,'',10.87,10.87,0],
['3','','1001',66,24,1,0.00,'',17.00,17.00,0],
['3','','2451',67,25,1,0.00,'',7.50,7.50,0],
['3','','2451',67,14,1,0.00,'',15.00,15.00,0],
['3','','1021',68,19,1,0.00,'',15.99,15.99,0],
['3','','1021',68,25,1,0.00,'',7.50,7.50,0],
['3','','1021',68,14,1,0.00,'',15.00,15.00,0],
['3','','2454',69,26,0,10.49,'',0.00,0.00,0],
['3','','2454',69,27,0,20.49,'',0.00,0.00,0],
['3','','2454',69,28,0,70.49,'',0.00,0.00,0],
['3','','2452',70,29,0,15.00,'',0.00,0.00,0],
['3','','2452',70,30,0,10.00,'',0.00,0.00,0],
['3','','2455',71,26,0,10.49,'',0.00,0.00,0],
['3','','2455',71,27,0,20.49,'',0.00,0.00,0],
['3','','2450',54,31,1,0.00,'',25.00,25.00,0],
['3','','1001',66,31,1,0.00,'',25.00,25.00,0],
['3','','1001',66,32,1,0.00,'',10.00,10.00,0],
['3','','1001',66,33,1,0.00,'',12.00,12.00,0],
['3','','2450',54,33,1,0.00,'',12.00,12.00,0],
['3','','1001',66,34,12,0.00,'',10.00,10.00,0],
['3','','1001',66,35,12,0.00,'',12.00,12.00,0],
['3','','1001',66,36,1,0.00,'',10.21,10.21,0],
['3','','2288',20,4,24,0.00,'',18.00,18.00,0],
['3','','2288',20,3,24,0.00,'',23.00,23.00,0],
['3','','1001',66,37,12,0.00,'',15.00,15.00,0],
['3','','2230',3,19,1,19.99,'',15.99,15.99,0],
['3','','2288',20,12,24,0.00,'',15.00,15.00,0],
['3','','2414',33,15,0,399.99,'',0.00,0.00,0],
['3','','2414',33,3,24,0.00,'',33.00,33.00,0],
['3','','1001',66,17,1,0.00,'',15.00,15.00,0],
['3','','1001',66,38,1,0.00,'',20.00,20.00,0],
['3','','2291',4,26,0,29.99,'',0.00,0.00,0],
['3','','2291',4,27,0,39.99,'',0.00,0.00,0],
['3','','2291',4,28,0,89.99,'',0.00,0.00,0],
['3','','2230',3,26,0,39.99,'',0.00,0.00,0],
['3','','2230',3,27,0,49.99,'',0.00,0.00,0],
['3','','2230',3,28,0,99.99,'',0.00,0.00,0],
['3','','2293',47,27,0,84.99,'',0.00,0.00,0],
['3','','2293',47,28,0,134.99,'',0.00,0.00,0],
['3','','2324',64,27,0,84.99,'',0.00,0.00,0],
['3','','2324',64,28,0,134.99,'',0.00,0.00,0],
['3','','2067',72,0,24,0.00,'',13.00,13.00,0],
['3','','2067',72,10,24,0.00,'',15.00,15.00,0],
['3','','2067',72,9,24,0.00,'',15.00,15.00,0],
['3','','2067',72,0,24,0.00,'',10.00,10.00,0],
['3','','2179',73,9,24,0.00,'',15.00,15.00,0],
['3','','2179',73,0,24,0.00,'',13.00,13.00,0],
['3','','2328',41,3,24,99.00,'',35.00,35.00,0],
['3','','LAP005',74,23,24,0.00,'',46.64,46.64,0],
['3','','2329',46,3,24,99.00,'',35.00,35.00,0],
['3','','2417',75,8,24,0.00,'',15.99,15.99,0],
['3','','2417',75,14,1,59.99,'',15.00,15.00,0],
['3','','LAP002',74,20,24,0.00,'',41.52,41.52,0],
['3','','2412',76,9,24,0.00,'',22.00,22.00,0],
['3','','2412',76,3,24,0.00,'',25.00,25.00,0],
['3','','2412',76,1,24,0.00,'',29.00,29.00,0],
['3','','2168',49,15,0,89.99,'',0.00,0.00,0],
['3','','2412',76,16,0,199.99,'',0.00,0.00,0],
['3','','2413',77,9,24,0.00,'',28.00,28.00,0],
['3','','2413',77,1,24,0.00,'',35.00,35.00,0],
['3','','2413',77,3,24,0.00,'',31.00,31.00,0],
['3','','2413',77,15,0,319.99,'',0.00,0.00,0],
['3','','2404',48,15,0,99.99,'',0.00,0.00,0],
['3','','2400',61,16,0,379.99,'',0.00,0.00,0],
['3','','2068',44,9,24,0.00,'',10.00,10.00,0],
['3','','2219',78,0,24,0.00,'',13.00,13.00,0],
['3','','2219',78,11,24,0.00,'',10.00,10.00,0],
['3','','2219',78,9,24,0.00,'',15.00,15.00,0],
['3','','2219',78,0,24,0.00,'',10.00,10.00,0],
null];
var tariffs_cols = ['type', 'name', 'texts', 'mins'];
var tariffs = [
['Pay Monthly Handset','Text 300',5000,300],
['Pay Monthly Handset','The One Plan',5000,2000],
['Pay Monthly Mobile Broadband','Broadband Lite',0,0],
['Pay Monthly Handset','Text 500 All-you-can-eat',5000,500],
['Pay Monthly Handset','Text 100 All-you-can-eat',5000,100],
['Pay Monthly Handset','Text 300 All-you-can-eat',5000,300],
['Pay Monthly Mobile Broadband','Broadband 5GB',0,0],
['Pay Monthly Mobile Broadband','Broadband 15GB',0,0],
['Pay Monthly Mobile Broadband','Broadband 15GB 24 month',0,0],
['Pay Monthly Handset','Text 500',5000,500],
['Pay Monthly Handset','Talk 900',0,900],
['Pay Monthly Handset','Talk 100',0,100],
['Pay Monthly Handset','Text 100',5000,100],
['Pay Monthly Handset','Text 900',5000,900],
['Pay Monthly Tablet','Broadband 10GB',0,0],
['PAYG Handset','Pay As You Go',0,0],
['PAYG Handset','Pay As You Go Micro SIM',0,0],
['Sim Only','SIM 300 - 1 month All-you-can-eat data',3000,300],
['Pay Monthly Handset','Text 900 All-you-can-eat',5000,900],
['Pay Monthly Mobile Broadband','SIM Only Broadband 5GB',0,0],
['Pay Monthly Laptop','Broadband 15GB 200',200,0],
['Pay Monthly Laptop','Broadband 15GB 150',150,0],
['Pay Monthly Laptop','Broadband 15GB 100',100,0],
['Pay Monthly Laptop','Broadband 15GB 250',250,0],
['Sim Only','SIM 600 - 1 month',3000,600],
['Sim Only','Broadband 1GB',0,0],
['Sim Only','Broadband - Pay As You Go + 1',0,0],
['Sim Only','Broadband - Pay As You Go  + 3',0,0],
['Sim Only','Broadband - Pay As You Go + 12',0,0],
['Sim Only','Pay As You Go - All-in-One £15',0,0],
['Sim Only','Pay As You Go - All-in-One £10',0,0],
['Sim Only','The One Plan SIM Only - 1 month',5000,2000],
['Sim Only','SIM 100 1 month',3000,100],
['Sim Only','SIM 300 1 month',3000,300],
['Sim Only','SIM 300 12 month',3000,300],
['Sim Only','SIM 600 12 month',3000,600],
['Sim Only','SIM Only Landline',0,0],
['Sim Only','SIM 600 - 12 month All-you-can-eat data',3000,600],
['Sim Only','SIM 600 - 1 month All-you-can-eat data',3000,600],
null];
var variants_cols = ['boxid', 'color', 'image'];
var variants = [
[0,'Black Refurb','8802917580830.jpg'],
[1,'Black Refreshed','8802917711902.jpg'],
[2,'White Refresh','8802916663326.jpg'],
[3,'Black Silver','8802904801310.jpg'],
[4,'Black White','8802905784350.jpg'],
[5,'Black','8802904342558.jpg'],
[5,'White','8802904571934.jpg'],
[6,'Purple','8802907553822.jpg'],
[7,'White','8802911256606.jpg'],
[8,'Silver','8802910928926.jpg'],
[9,'White','8802907783198.jpg'],
[10,'Black','8802899296286.jpg'],
[10,'White','8802899623966.jpg'],
[11,'Black','8802918858782.jpg'],
[12,'Black','8802908274718.jpg'],
[13,'Black','8802902769694.jpg'],
[14,'Black','8802903293982.jpg'],
[13,'White','8802902900766.jpg'],
[14,'White','8802903425054.jpg'],
[15,'White','8802897100830.jpg'],
[16,'Silver and White','8802896773150.jpg'],
[17,'Black','8802900508702.jpg'],
[18,'Black','8802896445470.jpg'],
[19,'Black','8802918498334.jpg'],
[20,'Black Silver','8802901393438.jpg'],
[21,'Liquid Blue','8802914009118.jpg'],
[22,'Charcoal Black','8802896150558.jpg'],
[23,'Zinc Grey','8802918268958.jpg'],
[24,'Silver and White','8802898968606.jpg'],
[25,'Black','8802906112030.jpg'],
[17,'Black Refurb','8802912993310.jpg'],
[15,'Black Refurb','8802912436254.jpg'],
[15,'White Refurb','8802912665630.jpg'],
[26,'Black','8802915811358.jpg'],
[20,'Black Silver Refurb','8802913615902.jpg'],
[20,'Black Green Refurb','8802913386526.jpg'],
[2,'Black Refresh','8802917351454.jpg'],
[27,'Black','8802910601246.jpg'],
[28,'Black','8802901852190.jpg'],
[29,'White','8802904080414.jpg'],
[29,'Black','8802904211486.jpg'],
[30,'Black','8802903949342.jpg'],
[31,'Black','8802903687198.jpg'],
[31,'White','8802903556126.jpg'],
[32,'White Green Refurb','8802913255454.jpg'],
[33,'Black','8802903031838.jpg'],
[30,'White','8802903818270.jpg'],
[34,'Black','8802905128990.jpg'],
[35,'Grey','8802917941278.jpg'],
[36,'Pink','8802907226142.jpg'],
[37,'Black','8802906767390.jpg'],
[38,'Silver','8802907095070.jpg'],
[39,'White','8802914566174.jpg'],
[40,'Black','8802914336798.jpg'],
[41,'','8802908012574.jpg'],
[42,'Black','8802908602398.jpg'],
[43,'Black Refurb','8802911780894.jpg'],
[44,'Black','8802899951646.jpg'],
[15,'Black','8802897428510.jpg'],
[43,'Black','8802897657886.jpg'],
[45,'Grey','8802897985566.jpg'],
[46,'Cyan','8802917023774.jpg'],
[47,'Huawei 353u Dongle Black White (laptop)','8802910273566.jpg'],
[48,'','8802895691806.jpg'],
[34,'White','8802905456670.jpg'],
[9,'Black','8802907783198.jpg'],
[49,'','8802911518750.jpg'],
[50,'','8802908143646.jpg'],
[51,'','8802911387678.jpg'],
[52,'','8802909552670.jpg'],
[53,'','8802909683742.jpg'],
[54,'','8802909290526.jpg'],
[55,'i5700 Black Red Refurb','8802919186462.jpg'],
[56,'Grey Refurb','8802916401182.jpg'],
[57,'','8802895691806.jpg'],
[58,'White','8802895233054.jpg'],
[59,'Black','8802895560734.jpg'],
[60,'Black','8802895364126.jpg'],
[61,'White Refurb','8802916892702.jpg'],
null];
var boxes_cols = ['device', 'brand', 'model', 'specs'];
var boxes = [
['Mobile Phone','Nokia','E5','. Full Qwerty keypad. 5 megapixel camera with LED flash and 3x digital zoom. VGA video camera with 3x digital zoom. 2.4&quot; screen. GPS with Ovi Maps'],
['Mobile Phone','Apple','iPhone 3GS 8GB','. 3.5&quot; multi-touch capacitive screen. 3.0 megapixel camera with autofocus. GPS & Wi-Fi. Pinch & Zoom for web browsing, maps and photos'],
['Mobile Phone','Apple','iPhone 4 16GB','. 5.0 megapixel camera with LED flash. HD video recording & editing. Glass design for optical quality and scratch resistance. 3.5&quot; high-resolution screen'],
['Pay Monthly Mobile Broadband','Huawei','E367u Dongle',''],
['Pay Monthly Mobile Broadband','Huawei','353u Dongle',''],
['Mobile Phone','Apple','iPhone 4 8GB','. 5.0 megapixel camera with LED flash. Comes with iOS 5. HD video recording & editing. Glass design for optical quality and scratch resistance. 3.5&quot; high-resolution screen'],
['Mobile Phone','Samsung','Galaxy Ace','. 3.5&quot; touchscreen. Android 2.2.1 (Froyo+) operating system. Portable Wi-Fi hotspot. 5 megapixel camera with autofocus and LED flash'],
['Mobile Phone','Samsung','Europa','. 2.8&quot; display. Layar Augment Reality Browser. Built-in Wi-Fi and GPS. 2 megapixel camera with digital zoom'],
['Mobile Phone','Samsung','Galaxy Nexus','. 4.65&quot; Super AMOLED HD screen (720p). 1.2GHz dual core processor. Super&ndash;slim 8.84mm curved design. 5 megapixel camera with autofocus and LED flash. Panoramic image&ndash;capture and photo&ndash;editing'],
['Mobile Phone','Sony Ericsson','SEM Live with Walkman','. 5 megapixel camera with flash and HD video recording & playback. 3.2 display with Mobile BRAVIAâ„¢ Engine'],
['Mobile Phone','Samsung','Galaxy S II I9100','. Dual core processor for a smoother, faster experience. 4.3&quot; Super AMOLED Plus screen. 8 megapixel rear camera and 1.3 megapixel front camera. HD video capture and playback. Android 2.3 (Gingerbread) operating system. Slim design. Improved battery'],
['Mobile Phone','Sony Ericsson','SEM X8','. Android smartphone. 3&quot; scratchproof screen. 3.2 megapixel camera. One&ndash;handed control. 3.5mm headphone jack'],
['Mobile Phone','Sony Ericsson','Xperia Arc S','. 1.4GHz processor. 4.2&quot; Reality display with Sony Mobile BRAVIA&trade; Engine. Ultra&ndash;thin &ndash; only 8.7mm. 8.1 megapixel camera and HD video capture. Sony Exmor R&trade; sensor for shooting in low light'],
['Pay Monthly Tablet','Apple','iPad 2 16GB Wi-Fi + 3G',''],
['Pay Monthly Tablet','Apple','iPad 2 64GB Wi-Fi + 3G',''],
['Mobile Phone','HTC','Wildfire S','. Free in-car charger and cradle worth £30 (while stocks last, not available with refurbished phones).. Compact design. Android 2.3 (Gingerbread) operating system. 5 megapixel camera with autofocus and LED flash. 3.2&quot; high resolution touchscreen. Multi-window web browsing. 3.5mm headphone jack'],
['Mobile Phone','HTC','ChaCha','. Qwerty keyboard and touchscreen. 2.6&quot; display. Facebook button for instant sharing. Android 2.3 (Gingerbread) operating system. 5 megapixel camera with autofocus and LED flash'],
['Mobile Phone','Samsung','Galaxy Europa i5500','. 2.8&quot; display. Layar Augment Reality Browser. Built-in Wi-Fi and GPS. 2 megapixel camera with digital zoom'],
['Mobile Phone','BlackBerry','9300','. Optical Trackpad for one-handed control. 2 megapixel camera with geo-tagging. 3.5mm headphone jack. Sleek design and lightweight'],
['Mobile Phone','Nokia','E7','. 4&quot; ClearBlack AMOLED screen. Slide&ndash;out Qwerty keyboard. 8 megapixel camera with HD video. HDMI slot and cable for TV connection. 16GB internal memory. Real&ndash;time emails'],
['Mobile Phone','Samsung','Galaxy Mini','. 3.14 QVGA touchscreen. Android 2.2.1 (Froyo+). 3 megapixel camera. Portable Wi-Fi hotspot. Swype for quick and easy messaging. 3.5mm headphone jack'],
['Mobile Phone','BlackBerry','Curve 9300','. Optical Trackpad for one-handed control. 2 megapixel camera with geo-tagging. 3.5mm headphone jack. Sleek design and lightweight'],
['Mobile Phone','BlackBerry','Bold 9900','. BlackBerry\'s best ever Qwerty keypad plus touchscreen. Featuring NFC, including Smart Tags. 2.8 VGA display. 5 megapixel camera with HD video. New BlackBerry&reg; 7 operating system. Stylish stainless steel design. 8GB internal memory, expandable to 40GB. WiFi & GPS'],
['Mobile Phone','BlackBerry','Torch 9810','. 1.2GHz processor for amazing speed. BlackBerry&reg;  Services including BBM, Email & App World. 3.2&quot; display pus slide-out Qwerty keypad. 5 megapixel camera with HD video. New BlackBerry&reg; 7 operating system. Sleek, silver finish. WiFi & GPS'],
['Mobile Phone','HTC','Runnymede','. 4.7&quot; Super LCD display. Sleek design &ndash; less than 10mm thin. New Beats Audio&trade; music technology. Free urBeats headphones in the box. 8 megapixel camera and flash with low&ndash;light wide&ndash;angle lens. Android 2.3.4 (Gingerbread) operating system. Super&ndash;fast 1.5GHZ processor'],
['Mobile Phone','LG','Optimus 3D','. Dual core processor and dual channel memory for blazingly fast speed. Watch movies in 3D. Play games in 3D. 4.3&quot; touchscreen. Android 2.3 (Gingerbread) operating system. Dual 5 megapixel cameras'],
['Mobile Phone','HTC','Sensation XE','. Free urBeats headphones. 4.3 high-res display for crystal-clear movies and videos. 1.5GHz dual core processor for ultra-fast browsing. Games & apps. 8 megapixel camera with dual LED flash. 16GB memory card. Large 1730mAh battery for longer music playback'],
['Mobile Phone','Nokia','800','. 3.7&quot; WVGA curved AMOLED touchscreen. 8 megapixel camera with Carl Zeiss optics. 1.4GHz single core processor. Windows Phone 7.5 (Mango). Wi&ndash;Fi and GPS. 16GB memory'],
['Mobile Phone','Apple','iPhone 3GS 8G','. 3.5&quot; multi-touch capacitive screen. 3.0 megapixel camera with autofocus. GPS & Wi-Fi. Pinch & Zoom for web browsing, maps and photos'],
['Mobile Phone','Apple','iPhone 4S 16GB','. 3.5&ndash;inch widescreen Multi&ndash;Touch display. Dual-core A5 chip &ndash; for up to two times more power and up to seven times faster graphics. 8 megapixel camera with HD video and all&ndash;new optics. Introducing Siri &ndash; use your voice to send messages, schedule meetings, make phone calls and more. With iCloud &ndash; stores your music, photos, documents and more'],
['Mobile Phone','Apple','iPhone 4S 32GB','. 3.5&ndash;inch widescreen Multi&ndash;Touch display. Dual-core A5 chip &ndash; for up to two times more power and up to seven times faster graphics. 8 megapixel camera with HD video and all&ndash;new optics. Introducing Siri &ndash; use your voice to send messages, schedule meetings, make phone calls and more. With iCloud &ndash; stores your music, photos, documents and more'],
['Mobile Phone','Apple','iPhone 4S 64GB','. 3.5&ndash;inch widescreen Multi&ndash;Touch display. Dual&ndash;core A5 chip &ndash; for up to two times more power and up to seven times faster graphics. 8 megapixel camera with HD video and all&ndash;new optics. Introducing Siri &ndash; use your voice to send messages, schedule meetings, make phone calls and more. With iCloud &ndash; stores your music, photos, documents and more'],
['Mobile Phone','Samsung','i5700','. 3.2&quot; touchscreen display. Android operating system. 3.2 megapixel camera. Layar Reality Browser. GPS and Wi&ndash;Fi'],
['Pay Monthly Tablet','Apple','iPad 2 32GB Wi-Fi + 3G',''],
['Pay Monthly Mobile Broadband','Huawei','E586 MiFi',''],
['Mobile Phone','Nokia','E5 DARK','. Full Qwerty keypad. 5 megapixel camera with LED flash and 3x digital zoom. VGA video camera with 3x digital zoom. 2.4&quot; screen. GPS with Ovi Maps'],
['Mobile Phone','Nokia','X3-02 1Ghz','. Dedicated music key. Ovi Store for apps. 5 megapixel camera'],
['Mobile Phone','Nokia','C2-01 (Jordan)','. 2&quot; QVGA display. 3.2 megapixel camera with digital zoom. Compact design. MicroSD slot for expanding memory. Ovi Store for apps'],
['Mobile Phone','Nokia','C3-01 1Ghz','. 2.4&quot;  touchscreen plus keypad. 5 megapixel camera with flash. Stylish and hard-wearing metal design. Ovi Store for apps. Swipe to unlock screen. Wi-Fi'],
['Mobile Phone','Samsung','Mini','. 3.14 QVGA touchscreen. Android 2.2.1 (Froyo+). 3 megapixel camera. Portable Wi-Fi hotspot. Swype for quick and easy messaging. 3.5mm headphone jack'],
['Mobile Phone','BlackBerry','Curve 9360','. 2.44&quot; screen plus BlackBerry&reg;\'s famous Qwerty keypad.. Featuring NFC, including Smart Tags. 5 megapixel camera with flash. New BlackBerry&reg; 7 operating system. New design &ndash; just 11mm thin'],
['Sim Only','','Contract Micro-SIMO voice',''],
['Mobile Phone','HTC','Explorer','. 3.2&quot;touchscreen. 3 megapixel camera. Android 2.3 (Gingerbread). Scratch-resistant changeable covers'],
['Mobile Phone','HTC','Desire S','. Slimmer, stronger design. Faster, smarter web browsing. HD video out of the box. 3.7&quot; Super LCD screen. 5 megapixel camera with autofocus and power LED flash. Android 2.3 (Gingerbread) operating system'],
['Mobile Phone','Samsung','Galaxy 583 (Cooper)','. 3.5&quot; touchscreen. Android 2.2.1 (Froyo+) operating system. Portable Wi-Fi hotspot. 5 megapixel camera with autofocus and LED flash'],
['Mobile Phone','HTC','Sensation','. 4.3&quot; QHD high resolution touchscreen. 8 megapixel camera with autofocus and 2xLED flash. Speedy 1.2 GHz dual core processor. Customisable homescreens. HTC Sense v.3 with 3D. Android 2.3 (Gingerbread) operating system. Expandable memory up to 32GB'],
['Mobile Phone','Nokia','Lumia 800','. 3.7&quot; WVGA curved AMOLED touchscreen. 8 megapixel camera with Carl Zeiss optics. 1.4GHz single core processor. Windows Phone 7.5 (Mango). Wi&ndash;Fi and GPS. 16GB memory'],
['Pay Monthly Laptop','Samsung','Huawei 353u Dongle (laptop)',''],
['Pay Monthly Laptop','Samsung','Huawei E367 Dongle (Laptop)',''],
['Sim Only','','Contract SIM Only Voice',''],
['Sim Only','','Contract Micro-SIMO MBB',''],
['Sim Only','','Contract SIM Only MBB',''],
['Sim Only','','PAYG SIMO MBB',''],
['Sim Only','','PAYG SIMO Voice',''],
['Sim Only','','PAYG Micro-SIMO MBB',''],
['Mobile Phone','Samsung','i5700 Red','. 3.2&quot; touchscreen display. Android operating system. 3.2 megapixel camera. Layar Reality Browser. GPS and Wi&ndash;Fi'],
['Mobile Phone','Nokia','X3-02','. Dedicated music key. Ovi Store for apps. 5 megapixel camera'],
['Pay Monthly Laptop','Samsung','Laptop Premium dongle',''],
['Pay Monthly Mobile Broadband','Huawei','B183 WebCube',''],
['Mobile Phone','Nokia','Lumia 710','. Windows Phone 7.5 operating system.. Free turn-by-turn sat nav with spoken directions with Nokia Drive.. All your favourite artists and latest releases with Nokia Music.. Faster browsing with a 1.4GHz Snapdragon processor.'],
['Mobile Phone','BlackBerry','Bold 9790','. 2.44" touchscreen. Qwerty keypad. 5 megapixel camera with auto-focus & LED flash.. 8GB built-in memory (expandable to 32GB). BlackBerry 7 operating system'],
['Mobile Phone','Sony Ericsson','SEM Zylo','. Stylish and compact slider design. Walkman 4.0 media player. 3.2 megapixel camera with video recording. 2.6&quot; QVGA display with auto&ndash;rotate. FM radio'],
null];

function init_phones()
{
  var i, j;

  for (i = 0; i < boxes.length - 1; i++)
  {
    var b = boxes[i];

    var box = Array();
   
    for (j = 0; j < b.length; j++)
      box[boxes_cols[j]] = b[j];

    box['variants'] = Array();
    box['id'] = i;

    boxes[i] = box;
  }

  for (i = 0; i < variants.length - 1; i++)
  {
    var v = variants[i];

    var variant = Array();
   
    for (j = 0; j < v.length; j++)
      variant[variants_cols[j]] = v[j];

    variant['deals'] = Array();

    var box = boxes[variant.boxid];

    variant['box'] = box;
    variant['id'] = i;

    variants[i] = variant; // Converted to object

    box.variants[box.variants.length] = variant;
  }

  for (i = 0; i < tariffs.length - 1; i++)
  {
    var t = tariffs[i];

    var tariff = Array();
   
    for (j = 0; j < t.length; j++)
      tariff[tariffs_cols[j]] = t[j];

    tariff['id'] = i;

    tariffs[i] = tariff; // Converted to object
  }

  for (i = 0; i < deals.length - 1; i++)
  {
    var d = deals[i];

    var deal = Array();
   
    for (j = 0; j < d.length; j++)
      deal[deals_cols[j]] = d[j];

    var variant = variants[deal.variantid];

    variant.deals[variant.deals.length] = deal;

    deal['variant'] = variant;

    var tariff = tariffs[deal.tariffid];

    deal['tariff'] = tariff;
    deal['id'] = i;

    deals[i] = deal; // Converted to object

    deal['cost'] = deal['upfront'] + deal['monthly'] * deal['months'];
  }
}

init_phones();


