var Template_Config = {
	applications: [
		{value: 100, label: 'Select Your Program'},				// Comma after each line
		{value: 1, label: 'Illustrator'},						// Comma after each line
		{value: 2, label: 'InDesign'},							// No comma after last line
		{value: 3, label: 'Photoshop'},
		{value: 4, label: 'QuarkXpress'}

	],
	
	products: [
		{value: 100, label: 'Select A Product'},				// Comma after each line
		{value: 1, label: 'Bookmarks'},							// Comma after each line
		{value: 2, label: 'Booklets and Catalogs'},				// No comma after last line
		{value: 22, label: 'Brochures'},						// No comma after last line
		{value: 3, label: 'Business Cards'},
		{value: 4, label: 'CD Tray Liners'},
		{value: 5, label: 'CD Products'},
		{value: 6, label: 'Door Hangers'},
		{value: 7, label: 'Envelopes'},
		{value: 8, label: 'Flyers'},
		{value: 9, label: 'Folders'},
		{value: 10, label: 'Greeting Cards'},
		{value: 11, label: 'Postcards'},
		{value: 12, label: 'Posters'},
		{value: 13, label: 'Rackcards'}

	],
	
	sizes: [
		{value: 100, parent: 100, label: 'Select Size'},		// Comma after each line
		{value: 1, parent: 1, label: '2 x 7'},					// Comma after each line
		{value: 2, parent: 1, label: '2.5 x 8'},				// No comma after last line
		{value: 3, parent: 1, label: '2.5 x 8.5'},
		{value: 41, parent: 2, label: '4-Page Booklet / Catalog 8.5 x 5.5'},
		{value: 42, parent: 2, label: '8-Page Booklet / Catalog 8.5 x 5.5'},
		{value: 43, parent: 2, label: '8-Page Booklet / Catalog 8.5 x 11'},
		{value: 401, parent: 22, label: '8.5 x 11 Trifold'},
		{value: 402, parent: 22, label: '8.5 x 14 Trifold'},
		{value: 403, parent: 22, label: '11 x 17 Trifold'},
		{value: 404, parent: 22, label: '8.5 x 11 Z-Fold'},
		{value: 405, parent: 22, label: '8.5 x 14 Z-Fold'},
		{value: 406, parent: 22, label: '11 x 17 Z-Fold'},
		
		{value: 9, parent: 3, label: '3.5 x 2'},		
		
		{value: 10, parent: 4, label: 'Tray Insert'},
		{value: 11, parent: 5, label: 'Single Page'},
		{value: 12, parent: 5, label: 'Four Page'},
		{value: 13, parent: 5, label: 'Six Page Trifold'},
		{value: 133, parent: 5, label: 'Six Page Z-Fold'},
		{value: 14, parent: 6, label: '4.25 x 11'},
		
		{value: 15, parent: 7, label: '#9 Business Reply'},
		{value: 16, parent: 7, label: '#10 Standard'},
		{value: 17, parent: 7, label: 'A2 Announcement'},
		{value: 18, parent: 7, label: 'A7 Announcement'},
		{value: 19, parent: 7, label: '6 x 9'},
		{value: 20, parent: 7, label: '9 x 12'},
		{value: 21, parent: 8, label: '3.5 x 8.5'},
		{value: 22, parent: 8, label: '4.25 x 5.5'},
		{value: 23, parent: 8, label: '5.5 x 8.5'},
		{value: 24, parent: 8, label: '8.5 x 11'},	
		{value: 244, parent: 8, label: '8.5 x 14'},	
		{value: 25, parent: 9, label: '9 x 12'},
		{value: 26, parent: 10, label: 'A2 Panel Card'},	
		{value: 27, parent: 10, label: 'A2 Scored for Folding'},
		{value: 28, parent: 10, label: 'A7 Panel Card'},
		{value: 29, parent: 10, label: 'A7 Scored for Folding'},
		{value: 30, parent: 11, label: '4 x 6'},
		{value: 31, parent: 11, label: '4.25 x 6'},
		{value: 32, parent: 11, label: '5 x 7'},
		{value: 33, parent: 11, label: '5.5 x 8.5'},
		{value: 34, parent: 11, label: '6 x 9'},
		{value: 35, parent: 11, label: '6 x 11'},
		{value: 37, parent: 12, label: '11 x 17'}, 
		{value: 38, parent: 12, label: '12 x 18'}, 
		{value: 39, parent: 12, label: '18 x 24'},
		{value: 41, parent: 13, label: '4 x 9'},  
		{value: 42, parent: 13, label: '4.25 x 11'}

	],
	
	links: [
<!-- Bookmarks -->
		{parent: '1_1_1', link: '/templates/templates/illustrator/AI-Bookmark_2x7.zip'},// Paths to zip files
		{parent: '2_1_1', link: '/templates/templates/indesign/IN-Bookmark_2x7.zip'},	
		{parent: '3_1_1', link: '/templates/templates/photoshop/PS-Bookmark_2x7.zip'},	
		{parent: '4_1_1', link: '/templates/templates/quarkxpress/QX-Bookmark_2x7.zip'},
		
		{parent: '1_1_2', link: '/templates/templates/illustrator/AI-Bookmark_2.5x8.zip'},
		{parent: '2_1_2', link: '/templates/templates/indesign/IN-Bookmark_2.5x8.zip'},	
		{parent: '3_1_2', link: '/templates/templates/photoshop/PS-Bookmark_2.5x8.zip'},
		{parent: '4_1_2', link: '/templates/templates/quarkxpress/QX-Bookmark_2.5x8.zip'},
		
		{parent: '1_1_3', link: '/templates/templates/illustrator/AI-Bookmark_2.5x8.5.zip'},
		{parent: '2_1_3', link: '/templates/templates/indesign/IN-Bookmark_2.5x8.5.zip'},
		{parent: '3_1_3', link: '/templates/templates/photoshop/PS-Bookmark_2.5x8.5.zip'},
		{parent: '4_1_3', link: '/templates/templates/quarkxpress/QX-Bookmark_2.5x8.5.zip'},

<!-- Booklets -->		
		{parent: '2_2_41', link: '/templates/templates/indesign/IN-4pg_Booklet-Catalog_8.5x5.5.zip'},
		{parent: '4_2_41', link: '/templates/templates/quarkxpress/QX-4pg_Booklet-Catalog_8.5x5.5.zip'},
		
		{parent: '2_2_42', link: '/templates/templates/indesign/IN-8pg_Booklet-Catalog_8.5x5.5.zip'},
		{parent: '4_2_42', link: '/templates/templates/quarkxpress/QX-8pg_Booklet-Catalog_8.5x5.5.zip'},
		
		{parent: '2_2_43', link: '/templates/templates/indesign/IN-8pg_Booklet-Catalog_8.5x11.zip'},
		{parent: '4_2_43', link: '/templates/templates/quarkxpress/QX-8pg_Booklet-Catalog_8.5x11.zip'},

<!-- Brochures -->					
		{parent: '1_22_401', link: '/templates/templates/illustrator/AI-Brochure_Trifold_8.5x11.zip'},
		{parent: '2_22_401', link: '/templates/templates/indesign/IN-Brochure_Trifold_8.5x11.zip'},	
		{parent: '3_22_401', link: '/templates/templates/photoshop/PS-Brochure_Trifold_8.5x11.zip'},
		{parent: '4_22_401', link: '/templates/templates/quarkxpress/QX-Brochure_Trifold_8.5x11.zip'},
		
		{parent: '1_22_402', link: '/templates/templates/illustrator/AI-Brochure_Trifold_8.5x14.zip'},
		{parent: '2_22_402', link: '/templates/templates/indesign/IN-Brochure_Trifold_8.5x14.zip'},	
		{parent: '3_22_402', link: '/templates/templates/photoshop/PS-Brochure_Trifold_8.5x14.zip'},
		{parent: '4_22_402', link: '/templates/templates/quarkxpress/QX-Brochure_Trifold_8.5x14.zip'},
		
		{parent: '1_22_403', link: '/templates/templates/illustrator/AI-Brochure_Trifold_11x17.zip'},
		{parent: '2_22_403', link: '/templates/templates/indesign/IN-Brochure_Trifold_11x17.zip'},	
		{parent: '3_22_403', link: '/templates/templates/photoshop/PS-Brochure_Trifold_11x17.zip'},	
		{parent: '4_22_403', link: '/templates/templates/quarkxpress/QX-Brochure_Trifold_11x17.zip'},					
		{parent: '1_22_404', link: '/templates/templates/illustrator/AI-Brochure_Z-fold_8.5x11.zip'},
		{parent: '2_22_404', link: '/templates/templates/indesign/IN-Brochure_Z-fold_8.5x11.zip'},	
		{parent: '3_22_404', link: '/templates/templates/photoshop/PS-Brochure_Z-fold_8.5x11.zip'},
		{parent: '4_22_404', link: '/templates/templates/quarkxpress/QX-Brochure_Z-fold_8.5x11.zip'},
		
		{parent: '1_22_405', link: '/templates/templates/illustrator/AI-Brochure_Z-fold_8.5x14.zip'},
		{parent: '2_22_405', link: '/templates/templates/indesign/IN-Brochure_Z-fold_8.5x14.zip'},	
		{parent: '3_22_405', link: '/templates/templates/photoshop/PS-Brochure_Z-fold_8.5x14.zip'},
		{parent: '4_22_405', link: '/templates/templates/quarkxpress/QX-Brochure_Z-fold_8.5x14.zip'},
		
		{parent: '1_22_406', link: '/templates/templates/illustrator/AI-Brochure_Z-fold_11x17.zip'},
		{parent: '2_22_406', link: '/templates/templates/indesign/IN-Brochure_Z-fold_11x17.zip'},	
		{parent: '3_22_406', link: '/templates/templates/photoshop/PS-Brochure_Z-fold_11x17.zip'},	
		{parent: '4_22_406', link: '/templates/templates/quarkxpress/QX-Brochure_Z-fold_11x17.zip'},
					
<!-- Business Cards -->	
		{parent: '1_3_9', link: '/templates/templates/illustrator/AI-Business_Card.zip'},
		{parent: '2_3_9', link: '/templates/templates/indesign/IN-Business_Card.zip'},	
		{parent: '3_3_9', link: '/templates/templates/photoshop/PS-Business_Card.zip'},	
		{parent: '4_3_9', link: '/templates/templates/quarkxpress/QX-Business_Card.zip'},
		
<!-- CD Products -->		
		{parent: '1_4_10', link: '/templates/templates/illustrator/AI-CD_Tray_Liner.zip'},	
		{parent: '2_4_10', link: '/templates/templates/indesign/IN-CD_Tray_Liner.zip'},	
		{parent: '3_4_10', link: '/templates/templates/photoshop/PS-CD_Tray_Liner.zip'},	
		{parent: '4_4_10', link: '/templates/templates/quarkxpress/QX-CD_Tray_Liner.zip'},	
		
		{parent: '1_5_11', link: '/templates/templates/illustrator/AI-CD_Inserts_1-2pgs.zip'},	
		{parent: '2_5_11', link: '/templates/templates/indesign/IN-CD_Inserts_1-2pgs.zip'},	
		{parent: '3_5_11', link: '/templates/templates/photoshop/PS-CD_Inserts_1-2pgs.zip'},	
		{parent: '4_5_11', link: '/templates/templates/quarkxpress/QX-CD_Inserts_1-2pgs.zip'},	
		
		{parent: '1_5_12', link: '/templates/templates/illustrator/AI-CD_Inserts-4pgs.zip'},	
		{parent: '2_5_12', link: '/templates/templates/indesign/IN-CD_Inserts-4pgs.zip'},	
		{parent: '3_5_12', link: '/templates/templates/photoshop/PS-CD_Inserts-4pgs.zip'},	
		{parent: '4_5_12', link: '/templates/templates/quarkxpress/QX-CD_Inserts-4pgs.zip'},	
		
		{parent: '1_5_13', link: '/templates/templates/illustrator/AI-CD_Inserts-6pgs_Trifold.zip'},	
		{parent: '2_5_13', link: '/templates/templates/indesign/IN-CD_Inserts-6pgs_Trifold.zip'},	
		{parent: '3_5_13', link: '/templates/templates/photoshop/PS-CD_Inserts-6pgs_Trifold.zip'},	
		{parent: '4_5_13', link: '/templates/templates/quarkxpress/QX-CD_Inserts-6pgs_Trifold.zip'},	
		
		{parent: '1_5_133', link: '/templates/templates/illustrator/AI-CD_Inserts-6pgs_Z-Fold.zip'},
		{parent: '2_5_133', link: '/templates/templates/indesign/IN-CD_Inserts-6pgs_Z-Fold.zip'},	
		{parent: '3_5_133', link: '/templates/templates/photoshop/PS-CD_Inserts-6pgs_Z-Fold.zip'},	
		{parent: '4_5_133', link: '/templates/templates/quarkxpress/QX-CD_Inserts-6pgs_Z-Fold.zip'},	
		
<!-- Door Hangers -->		
		{parent: '1_6_14', link: '/templates/templates/illustrator/AI-DoorHanger_4.25x11.zip'},
		{parent: '2_6_14', link: '/templates/templates/indesign/IN-DoorHanger_4.25x11.zip'},
		{parent: '3_6_14', link: '/templates/templates/photoshop/PS-DoorHanger_4.25x11.zip'},
		{parent: '4_6_14', link: '/templates/templates/quarkxpress/QX-DoorHanger_4.25x11.zip'},
				
<!-- Envelopes -->	
		{parent: '1_7_15', link: '/templates/templates/illustrator/AI-Envelope_No9.zip'},
		{parent: '2_7_15', link: '/templates/templates/indesign/IN-Envelope_No9.zip'},	
		{parent: '3_7_15', link: '/templates/templates/photoshop/PS-Envelope_No9.zip'},	
		{parent: '4_7_15', link: '/templates/templates/quarkxpress/QX-Envelope_No9.zip'},
				
		{parent: '1_7_16', link: '/templates/templates/illustrator/AI-Envelope_No10.zip'},
		{parent: '2_7_16', link: '/templates/templates/indesign/IN-Envelope_No10.zip'},	
		{parent: '3_7_16', link: '/templates/templates/photoshop/PS-Envelope_No10.zip'},
		{parent: '4_7_16', link: '/templates/templates/quarkxpress/QX-Envelope_No10.zip'},
				
		{parent: '1_7_17', link: '/templates/templates/illustrator/AI-Envelope_A2.zip'},
		{parent: '2_7_17', link: '/templates/templates/indesign/IN-Envelope_A2.zip'},	
		{parent: '3_7_17', link: '/templates/templates/photoshop/PS-Envelope_A2.zip'},	
		{parent: '4_7_17', link: '/templates/templates/quarkxpress/QX-Envelope_A2.zip'},
		
		{parent: '1_7_18', link: '/templates/templates/illustrator/AI-Envelope_A7.zip'},
		{parent: '2_7_18', link: '/templates/templates/indesign/IN-Envelope_A7.zip'},	
		{parent: '3_7_18', link: '/templates/templates/photoshop/PS-Envelope_A7.zip'},	
		{parent: '4_7_18', link: '/templates/templates/quarkxpress/QX-Envelope_A7.zip'},
		
		{parent: '1_7_19', link: '/templates/templates/illustrator/AI-Envelope_6x9.zip'},
		{parent: '2_7_19', link: '/templates/templates/indesign/IN-Envelope_6x9.zip'},	
		{parent: '3_7_19', link: '/templates/templates/photoshop/PS-Envelope_6x9.zip'},	
		{parent: '4_7_19', link: '/templates/templates/quarkxpress/QX-Envelope_6x9.zip'},
		
		{parent: '1_7_20', link: '/templates/templates/illustrator/AI-Envelope_9x12.zip'},
		{parent: '2_7_20', link: '/templates/templates/indesign/IN-Envelope_9x12.zip'},	
		{parent: '3_7_20', link: '/templates/templates/photoshop/PS-Envelope_9x12.zip'},	
		{parent: '4_7_20', link: '/templates/templates/quarkxpress/QX-Envelope_9x12.zip'},

<!-- Flyers -->			
		{parent: '1_8_21', link: '/templates/templates/illustrator/AI-Flyer_3.5x8.5.zip'},
		{parent: '2_8_21', link: '/templates/templates/indesign/IN-Flyer_3.5x8.5.zip'},	
		{parent: '3_8_21', link: '/templates/templates/photoshop/PS-Flyer_3.5x8.5.zip'},
		{parent: '4_8_21', link: '/templates/templates/quarkxpress/QX-Flyer_3.5x8.5.zip'},
		
		{parent: '1_8_22', link: '/templates/templates/illustrator/AI-Flyer_4.25x5.5.zip'},
		{parent: '2_8_22', link: '/templates/templates/indesign/IN-Flyer_4.25x5.5.zip'},
		{parent: '3_8_22', link: '/templates/templates/photoshop/PS-Flyer_4.25x5.5.zip'},
		{parent: '4_8_22', link: '/templates/templates/quarkxpress/QX-Flyer_4.25x5.5.zip'},
		
		{parent: '1_8_23', link: '/templates/templates/illustrator/AI-Flyer_5.5x8.5.zip'},
		{parent: '2_8_23', link: '/templates/templates/indesign/IN-Flyer_5.5x8.5.zip'},	
		{parent: '3_8_23', link: '/templates/templates/photoshop/PS-Flyer_5.5x8.5.zip'},
		{parent: '4_8_23', link: '/templates/templates/quarkxpress/QX-Flyer_5.5x8.5.zip'},
		
		{parent: '1_8_24', link: '/templates/templates/illustrator/AI-Flyer_8.5x11.zip'},
		{parent: '2_8_24', link: '/templates/templates/indesign/IN-Flyer_8.5x11.zip'},	
		{parent: '3_8_24', link: '/templates/templates/photoshop/PS-Flyer_8.5x11.zip'},	
		{parent: '4_8_24', link: '/templates/templates/quarkxpress/QX-Flyer_8.5x11.zip'},
		
		{parent: '1_8_244', link: '/templates/templates/illustrator/AI-Flyer_8.5x14.zip'},
		{parent: '2_8_244', link: '/templates/templates/indesign/IN-Flyer_8.5x14.zip'},	
		{parent: '3_8_244', link: '/templates/templates/photoshop/PS-Flyer_8.5x14.zip'},	
		{parent: '4_8_244', link: '/templates/templates/quarkxpress/QX-Flyer_8.5x14.zip'},

<!-- Pocket Folders -->			
		{parent: '1_9_25', link: '/templates/templates/illustrator/AI-Pocket_Folder_9x12.zip'},
		{parent: '2_9_25', link: '/templates/templates/indesign/IN-Pocket_Folder_9x12.zip'},
		{parent: '3_9_25', link: '/templates/templates/photoshop/PS-Pocket_Folder_9x12.zip'},
		{parent: '4_9_25', link: '/templates/templates/quarkxpress/QX-Pocket_Folder_9x12.zip'},

<!-- Greeting Cards -->			
		{parent: '1_10_26', link: '/templates/templates/illustrator/AI-Panel_Card_A2-flat.zip'},
		{parent: '2_10_26', link: '/templates/templates/indesign/IN-Panel_Card_A2-panel-flat.zip'},
		{parent: '3_10_26', link: '/templates/templates/photoshop/PS-Panel_Card_A2-flat.zip'},
		{parent: '4_10_26', link: '/templates/templates/quarkxpress/QX-Panel_Card_A2-flat.zip'},
		
		{parent: '1_10_27', link: '/templates/templates/illustrator/AI-Panel_Card_A2-scored.zip'},
		{parent: '2_10_27', link: '/templates/templates/indesign/IN-Panel_Card_A2-scored.zip'},
		{parent: '3_10_27', link: '/templates/templates/photoshop/PS-Panel_Card_A2-scored.zip'},
		{parent: '4_10_27', link: '/templates/templates/quarkxpress/QX-Panel_Card_A2-scored.zip'},
		
		{parent: '1_10_28', link: '/templates/templates/illustrator/AI-Panel_Card_A7-flat.zip'},
		{parent: '2_10_28', link: '/templates/templates/indesign/IN-Panel_Card_A7-flat.zip'},
		{parent: '3_10_28', link: '/templates/templates/photoshop/PS-Panel_Card_A7-flat.zip'},
		{parent: '4_10_28', link: '/templates/templates/quarkxpress/QX-Panel_Card_A7-flat.zip'},
		
		{parent: '1_10_29', link: '/templates/templates/illustrator/AI-Panel_Card_A7-scored.zip'},
		{parent: '2_10_29', link: '/templates/templates/indesign/IN-Panel_Card_A7-scored.zip'},
		{parent: '3_10_29', link: '/templates/templates/photoshop/PS-Panel_Card_A7-scored.zip'},
		{parent: '4_10_29', link: '/templates/templates/quarkxpress/QX-Panel_Card_A7-scored.zip'},

<!-- Postcards -->			
		{parent: '1_11_30', link: '/templates/templates/illustrator/AI-Postcard_4x6.zip'},
		{parent: '2_11_30', link: '/templates/templates/indesign/IN-Postcard_4x6.zip'},	
		{parent: '3_11_30', link: '/templates/templates/photoshop/PS-Postcard_4x6.zip'},
		{parent: '4_11_30', link: '/templates/templates/quarkxpress/QX-Postcard_4x6.zip'},
		
		{parent: '1_11_31', link: '/templates/templates/illustrator/AI-Postcard_4.25x6.zip'},
		{parent: '2_11_31', link: '/templates/templates/indesign/IN-Postcard_4.25x6.zip'},
		{parent: '3_11_31', link: '/templates/templates/photoshop/PS-Postcard_4.25x6.zip'},
		{parent: '4_11_31', link: '/templates/templates/quarkxpress/QX-Postcard_4.25x6.zip'},
		
		{parent: '1_11_32', link: '/templates/templates/illustrator/AI-Postcard_5x7.zip'},
		{parent: '2_11_32', link: '/templates/templates/indesign/IN-Postcard_5x7.zip'},	
		{parent: '3_11_32', link: '/templates/templates/photoshop/PS-Postcard_5x7.zip'},
		{parent: '4_11_32', link: '/templates/templates/quarkxpress/QX-Postcard_5x7.zip'},
		
		{parent: '1_11_34', link: '/templates/templates/illustrator/AI-Postcard_6x9.zip'},
		{parent: '2_11_34', link: '/templates/templates/indesign/IN-Postcard_6x9.zip'},	
		{parent: '3_11_34', link: '/templates/templates/photoshop/PS-Postcard_6x9.zip'},
		{parent: '4_11_34', link: '/templates/templates/quarkxpress/QX-Postcard_6x9.zip'},
		
		{parent: '1_11_35', link: '/templates/templates/illustrator/AI-Postcard_6x11.zip'},
		{parent: '2_11_35', link: '/templates/templates/indesign/IN-Postcard_6x11.zip'},
		{parent: '3_11_35', link: '/templates/templates/photoshop/PS-Postcard_6x11.zip'},
		{parent: '4_11_35', link: '/templates/templates/quarkxpress/QX-Postcard_6x11.zip'},
		
		{parent: '1_11_33', link: '/templates/templates/illustrator/AI-Postcard_8.5x5.5.zip'},
		{parent: '2_11_33', link: '/templates/templates/indesign/IN-Postcard_8.5x5.5.zip'},
		{parent: '3_11_33', link: '/templates/templates/photoshop/PS-Postcard_8.5x5.5.zip'},
		{parent: '4_11_33', link: '/templates/templates/quarkxpress/QX-Postcard_8.5x5.5.zip'},
		
<!-- Posters -->			
		{parent: '1_12_37', link: '/templates/templates/illustrator/AI-Poster_11x17.zip'},
		{parent: '2_12_37', link: '/templates/templates/indesign/IN-Poster_11x17.zip'},	
		{parent: '3_12_37', link: '/templates/templates/photoshop/PS-Poster_11x17.zip'},
		{parent: '4_12_37', link: '/templates/templates/quarkxpress/QX-Poster_11x17.zip'},
		
		{parent: '1_12_38', link: '/templates/templates/illustrator/AI-Poster_12x18.zip'},
		{parent: '2_12_38', link: '/templates/templates/indesign/IN-Poster_12x18.zip'},	
		{parent: '3_12_38', link: '/templates/templates/photoshop/PS-Poster_12x18.zip'},
		{parent: '4_12_38', link: '/templates/templates/quarkxpress/QX-Poster_12x18.zip'},
		
		{parent: '1_12_39', link: '/templates/templates/illustrator/AI-Poster_18x24.zip'},
		{parent: '2_12_39', link: '/templates/templates/indesign/IN-Poster_18x24.zip'},	
		{parent: '3_12_39', link: '/templates/templates/photoshop/PS-Poster_18x24.zip'},
		{parent: '4_12_39', link: '/templates/templates/quarkxpress/QX-Poster_18x24.zip'},
		
<!-- Rackcards -->	
		{parent: '1_13_41', link: '/templates/templates/illustrator/AI-Rackcard_4x9.zip'},
		{parent: '2_13_41', link: '/templates/templates/indesign/IN-Rackcard_4x9.zip'},	
		{parent: '3_13_41', link: '/templates/templates/photoshop/PS-Rackcard_4x9.zip'},
		{parent: '4_13_41', link: '/templates/templates/quarkxpress/QX-Rackcard_4x9.zip'},
		
		{parent: '1_13_42', link: '/templates/templates/illustrator/AI-Rackcard_4.25x11.zip'},
		{parent: '2_13_42', link: '/templates/templates/indesign/IN-Rackcard_4.25x11.zip'},
		{parent: '3_13_42', link: '/templates/templates/photoshop/PS-Rackcard_4.25x11.zip'},
		{parent: '4_13_42', link: '/templates/templates/quarkxpress/QX-Rackcard_4.25x11.zip'}  // No comma after last line

		
	]
};

// ===========================
// DO NOT EDIT BELOW THIS LINE
// ===========================

var Templates = {
	init: function() {
		if ($('tpl_application')) {
			Template_Config.applications.each(function(item) {
				var el = new Element('option');
				el.value = item.value;
				el.setHTML(item.label);
				el.injectInside('tpl_application');
			});
		}
		if ($('tpl_product')) {
			Template_Config.products.each(function(item) {
				var el = new Element('option');
				el.value = item.value;
				el.setHTML(item.label);
				el.injectInside('tpl_product');
			});
			$('tpl_product').addEvent('change', function() { Templates.changeSizes(); })
		}
		if ($('tpl_size')) {
			this.changeSizes();			
		}
		if ($('tpl_button')) {
			$('tpl_button').addEvent('click', function() { Templates.getTemplate(); })
		}
	},
	
	changeSizes: function() {
		if ($('tpl_product') && $('tpl_size')) {
			var parent = $('tpl_product').value; 
			$('tpl_size').empty();
			
			Template_Config.sizes.each(function(item) { 
				if (item.parent == parent) {
					var el = new Element('option');
					el.value = item.value;
					el.setHTML(item.label);
					el.injectInside('tpl_size');
				}
			});
		}
	},
	
	getTemplate: function() {
		var link = '';
		if ($('tpl_application') && $('tpl_product') && $('tpl_size')) {
			var parent = $('tpl_application').value + '_' + $('tpl_product').value + '_' + $('tpl_size').value;
			
			Template_Config.links.each(function(item) {
				if (item.parent == parent) {
					link = item.link;
				}
			});
		}
		
		if (link == '')
			alert('The selected template is currently not available.');
		else
			$('tpl_downloader').src = link;
	}
};

window.addEvent('domready', function() {
	Templates.init();
});