/* Create a Payment option */
function paymentOption(id,payment_option,price) {
	this.id = id;
	this.payment_option = payment_option;
	this.price = price;
}

/* Create a Payment group */
function paymentGroup(id,payment_group,options) {
	this.id = id;
	this.payment_group = payment_group;
	this.options = options.split(",");
}

/***************************************************************************
* Update the payment submission form with the price and item description   *
* When a user selects an option from the list                              *
***************************************************************************/
function updateItemValues(form,id) {
					form.amount.value = paymentOptions[id].price;
			form.item_name.value = (paymentOptions[id].payment_option).replace(/&quot;/g,'"');
					}

/***************************************************************************
* Create the array of payment options. This contains all options for the   *
* site.The options available for a given photo are hardwired into the      *
* photo page whichis why we can't use the quick browse methods on payment  *
* enabled sites                                                            *
***************************************************************************/
var paymentOptions = new Object();
paymentOptions[81626] = new paymentOption(81626,'9&quot;x6&quot; Mounted Print inc delivery','17.00');
paymentOptions[82484] = new paymentOption(82484,'9x6&quot; Print inc delivery','12.00');
paymentOptions[77087] = new paymentOption(77087,'7x5&quot; Print (inc delivery)','15.00');
paymentOptions[84903] = new paymentOption(84903,'Reprint photobook inc delivery','55.00');
paymentOptions[77088] = new paymentOption(77088,'Three 7x5&quot; prints (inc delivery)','30.00');
paymentOptions[84902] = new paymentOption(84902,'New photobook inc delivery','80.00');
paymentOptions[82485] = new paymentOption(82485,'Three 9&quot;x6&quot; Prints inc delivery','25.00');
paymentOptions[81627] = new paymentOption(81627,'Three 9&quot;x6&quot; Mounted Prints inc delivery','33.00');
paymentOptions[82486] = new paymentOption(82486,'Keyring plus 2 wallet photos','12.00');
paymentOptions[73594] = new paymentOption(73594,'9&quot;x6&quot; Print inc delivery','15.00');
paymentOptions[84907] = new paymentOption(84907,'Reprint photobook with protective slipcase inc delivery','75.00');
paymentOptions[84906] = new paymentOption(84906,'New photobook with protective slipcase inc delivery','100.00');
paymentOptions[69330] = new paymentOption(69330,'Three 9&quot;x6&quot; Prints inc delivery','30.00');
paymentOptions[76970] = new paymentOption(76970,'Facebook image (lo-res web JPEG) with any print order','3.00');
paymentOptions[81913] = new paymentOption(81913,'10x Christmas Cards (inc Envelopes and Delivery)','22.00');
paymentOptions[81917] = new paymentOption(81917,'2012 Calendar (12x8&quot; Single Page)','18.00');
paymentOptions[79019] = new paymentOption(79019,'8x6&quot; Print mounted to c.12x10&quot; (inc delivery)','33.00');
paymentOptions[81918] = new paymentOption(81918,'8x6&quot; Print Framed to c.12x10&quot; (inc delivery)','73.00');
paymentOptions[32091] = new paymentOption(32091,'10&quot;x8&quot; Print Mounted to c.15x13&quot; (inc delivery)','43.00');
paymentOptions[81919] = new paymentOption(81919,'10&quot;x8&quot; Print Framed to c.15x13&quot; (inc delivery)','88.00');
paymentOptions[32092] = new paymentOption(32092,'16&quot;x12&quot; Print Mounted to 24x20&quot; (inc delivery)','53.00');
paymentOptions[81920] = new paymentOption(81920,'16&quot;x12&quot; Print Framed to 24x20&quot; (inc delivery)','128.00');
paymentOptions[81910] = new paymentOption(81910,'20x16&quot; Print mounted to 27x23&quot; (inc Delivery)','63.00');
paymentOptions[81911] = new paymentOption(81911,'30x20&quot; Print Mounted to 38x28&quot; (inc Delivery)','103.00');
paymentOptions[81921] = new paymentOption(81921,'30x20&quot; Print Framed to 38x28&quot; (inc Delivery)','298.00');
paymentOptions[32093] = new paymentOption(32093,'12&quot;x8&quot; Canvas Print (inc delivery)','93.00');
paymentOptions[32094] = new paymentOption(32094,'16&quot;x12&quot; Canvas Print (inc delivery)','113.00');
paymentOptions[81912] = new paymentOption(81912,'24&quot;x16&quot; Canvas Print (inc delivery)','178.00');
paymentOptions[69331] = new paymentOption(69331,'Personalised Printed Mug inc delivery','13.50');
paymentOptions[69332] = new paymentOption(69332,'Mousemat inc delivery','13.50');
paymentOptions[69333] = new paymentOption(69333,'Personalised iPhone skin inc delivery','17.00');
paymentOptions[73596] = new paymentOption(73596,'8&quot;x6&quot; Acrylic Desk Block (inc delivery)','48.00');
paymentOptions[79022] = new paymentOption(79022,'16&quot;x12&quot; Acrylic with wall mount (inc delivery)','178.00');
paymentOptions[73597] = new paymentOption(73597,'20&quot;x16&quot; Acrylic with wallmount (inc delivery)','198.00');
paymentOptions[81914] = new paymentOption(81914,'24&quot;x20&quot; Acrylic with wallmount (inc delivery)','228.00');
paymentOptions[81915] = new paymentOption(81915,'36&quot;x24&quot; Acrylic with wallmount (inc delivery)','278.00');
paymentOptions[81916] = new paymentOption(81916,'40&quot;x30&quot; Acrylic with wallmount (inc delivery)','328.00');
paymentOptions[32095] = new paymentOption(32095,'10x Greetings cards inc delivery','22.00');
paymentOptions[81922] = new paymentOption(81922,'16x16&quot; Montage of 4 images Mounted to c 24x24&quot;','73.00');
paymentOptions[81924] = new paymentOption(81924,'16x16&quot; Montage of 4 images Framed to c 24x24&quot;','148.00');
paymentOptions[81923] = new paymentOption(81923,'20x20&quot; Montage of 4 images Mounted to c 27x27&quot;','83.00');
paymentOptions[81925] = new paymentOption(81925,'20x20&quot; Montage of 4 images Framed to c 27x27&quot;','198.00');
paymentOptions[81927] = new paymentOption(81927,'24x24&quot; Montage of 4 or 9 images Mounted to c 32x32&quot; (inc delivery)','118.00');
paymentOptions[81926] = new paymentOption(81926,'24x24&quot; Montage of 4 or 9 images Framed to c 32x32&quot;','288.00');
paymentOptions[81930] = new paymentOption(81930,'Hi-res digital image (printable)','10.00');
paymentOptions[83030] = new paymentOption(83030,'9x6&quot; print in folder (inc delivery)','12.00');
paymentOptions[83031] = new paymentOption(83031,'9x6&quot; print mounted (inc delivery)','16.00');
paymentOptions[83032] = new paymentOption(83032,'9x6&quot; print with black frame (inc delivery)','29.00');
paymentOptions[83033] = new paymentOption(83033,'12x10&quot; print mounted (inc delivery)','24.00');
paymentOptions[83034] = new paymentOption(83034,'12x10&quot; print with black frame (inc delivery)','39.00');
paymentOptions[83035] = new paymentOption(83035,'16x12&quot; print mounted (inc delivery)','29.00');
paymentOptions[83036] = new paymentOption(83036,'16x12&quot; print with black frame (inc delivery)','55.00');
paymentOptions[83037] = new paymentOption(83037,'16x12&quot; Acrylic wall mount (inc delivery)','126.00');
paymentOptions[83038] = new paymentOption(83038,'16x12&quot; Canvas (inc delivery)','100.00');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[25275] = new paymentGroup(25275,'Ball event photography options','81626,81627,76970,32093,69333,73596');
			paymentGroups[21383] = new paymentGroup(21383,'Event Photography options','82484,82485,76970,32091,32093,69333,73596,32095');
			paymentGroups[25418] = new paymentGroup(25418,'Event Photography options inc digital','82484,82485,76970,73596,32095,81930');
			paymentGroups[25563] = new paymentGroup(25563,'Festive Photographs','82484,82485,81917,69333,73596');
			paymentGroups[26373] = new paymentGroup(26373,'Photobook offer','84903,84902,84907,84906');
			paymentGroups[25417] = new paymentGroup(25417,'Portrait Montages','81922,81924,81923,81925,81927,81926');
			paymentGroups[25415] = new paymentGroup(25415,'Portrait Studio Pricing','81917,79019,81918,32091,81919,32092,81920,81910,81911,81921,32093,32094,81912,69333,73596,79022,73597,81914,81915,81916');
			paymentGroups[25416] = new paymentGroup(25416,'Portrait Studio Pricing + Event 9x6s','73594,69330,76970,81917,79019,81918,32091,81919,32092,81920,81910,81911,81921,32093,32094,81912,69333,73596,79022,73597,81914,81915,81916');
			paymentGroups[25754] = new paymentGroup(25754,'School photography','73596,83030,83031,83032,83033,83034,83035,83036,83037,83038');
			paymentGroups[24466] = new paymentGroup(24466,'Wedding Photo Print Prices','77087,77088,76970,79019,32091,32092,32093,32094,73596,79022,73597');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		$.each(paymentGroups[payment_groups_id].options, function(i){
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


