/* 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[84685] = new paymentOption(84685,'Mother','2.50');
paymentOptions[84752] = new paymentOption(84752,'Orig £350','350.00');
paymentOptions[84753] = new paymentOption(84753,'orig 600','600.00');
paymentOptions[84754] = new paymentOption(84754,'orig 550','550.00');
paymentOptions[84755] = new paymentOption(84755,'Orig 600','600.00');
paymentOptions[84400] = new paymentOption(84400,'origional (500)','500.00');
paymentOptions[78593] = new paymentOption(78593,'notelets','5.50');
paymentOptions[79902] = new paymentOption(79902,'prints 15&quot;x15&quot; le','50.00');
paymentOptions[79903] = new paymentOption(79903,'19&quot;x13.25&quot; le','60.00');
paymentOptions[80126] = new paymentOption(80126,'canvas 92x66','125.00');
paymentOptions[81069] = new paymentOption(81069,'Framed 12x12','25.00');
paymentOptions[80223] = new paymentOption(80223,'print 19x13.25','55.00');
paymentOptions[80174] = new paymentOption(80174,'canvas 10x10','25.00');
paymentOptions[58916] = new paymentOption(58916,'15&quot; x 15&quot; oe','45.00');
paymentOptions[58917] = new paymentOption(58917,'19&quot; x 19&quot; oe','65.00');
paymentOptions[59050] = new paymentOption(59050,'27.5&quot; x 20.25&quot; oe','85.00');
paymentOptions[58982] = new paymentOption(58982,'24&quot; x 17.25&quot; oe','75.00');
paymentOptions[58980] = new paymentOption(58980,'21&quot; x 10.5&quot; le','65.00');
paymentOptions[59047] = new paymentOption(59047,'15&quot; x 15&quot; le','65.00');
paymentOptions[59048] = new paymentOption(59048,'19&quot; x 19&quot; le','85.00');
paymentOptions[59049] = new paymentOption(59049,'27.5&quot; x 20.25&quot; le','95.00');
paymentOptions[59104] = new paymentOption(59104,'21&quot; x 10.5&quot; oe','65.00');
paymentOptions[64258] = new paymentOption(64258,'30&quot;x25&quot; oe','85.00');
paymentOptions[80130] = new paymentOption(80130,'canvas 66x66','105.00');
paymentOptions[64296] = new paymentOption(64296,'30&quot; x 20&quot; oe','85.00');
paymentOptions[66807] = new paymentOption(66807,'24&quot;x20&quot; le','95.00');
paymentOptions[71156] = new paymentOption(71156,'15&quot; x 11&quot; oe','35.00');
paymentOptions[65394] = new paymentOption(65394,'General cards','1.75');
paymentOptions[65213] = new paymentOption(65213,'xmas cards','1.10');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[25080] = new paymentGroup(25080,'12x12','81069');
			paymentGroups[25081] = new paymentGroup(25081,'12x12 and 10x10','81069,80174');
			paymentGroups[24880] = new paymentGroup(24880,'19&quot; x 13.25 oe','80223');
			paymentGroups[24881] = new paymentGroup(24881,'19x13.25  30x25 oe','80223,64258');
			paymentGroups[24858] = new paymentGroup(24858,'canvas 10x10','80174');
			paymentGroups[24837] = new paymentGroup(24837,'canvas 66x66','80130');
			paymentGroups[24834] = new paymentGroup(24834,'canvas 92x66','80126');
			paymentGroups[19979] = new paymentGroup(19979,'General cards','65394');
			paymentGroups[26309] = new paymentGroup(26309,'Mother','84685');
			paymentGroups[24252] = new paymentGroup(24252,'notelets','78593');
			paymentGroups[26324] = new paymentGroup(26324,'Orig £350','84752');
			paymentGroups[26326] = new paymentGroup(26326,'Orig 550','84754');
			paymentGroups[26325] = new paymentGroup(26325,'Orig 600','84755');
			paymentGroups[26209] = new paymentGroup(26209,'origional (500)','84400');
			paymentGroups[19659] = new paymentGroup(19659,'print open edition 30&quot;x20&quot;','64296');
			paymentGroups[24776] = new paymentGroup(24776,'prints 15&quot;x15&quot; le ','79902');
			paymentGroups[24777] = new paymentGroup(24777,'prints 19&quot;x13.25&quot; le','79903');
			paymentGroups[20496] = new paymentGroup(20496,'prints 24&quot;x20&quot; le','66807');
			paymentGroups[18142] = new paymentGroup(18142,'Prints limited edition 15x15 19x19','59047,59048');
			paymentGroups[18100] = new paymentGroup(18100,'Prints Limited Edition 21&quot;x10.5&quot;','58980');
			paymentGroups[18143] = new paymentGroup(18143,'Prints limited edition 27.5&quot;x20.25&quot;','59049');
			paymentGroups[26210] = new paymentGroup(26210,'prints op 15&quot; 19&quot; 66cm','58916,58917,80130');
			paymentGroups[21979] = new paymentGroup(21979,'Prints open edition 15&quot; x 11&quot;','71156');
			paymentGroups[18099] = new paymentGroup(18099,'Prints open edition 15&quot;x15&quot; 19&quot;x19&quot;','58916,58917');
			paymentGroups[20490] = new paymentGroup(20490,'prints open edition 15x15','58916');
			paymentGroups[18166] = new paymentGroup(18166,'prints open edition 21&quot; x 10.5&quot;','59104');
			paymentGroups[18121] = new paymentGroup(18121,'prints open edition 24&quot;x17.25&quot;','58982');
			paymentGroups[18144] = new paymentGroup(18144,'prints open edition 27.5&quot;x20.25&quot;','59050');
			paymentGroups[19642] = new paymentGroup(19642,'prints open edition 30&quot;x25&quot;','64258');
			paymentGroups[19909] = new paymentGroup(19909,'xmas cards','65213');
	/***************************************************************************
* 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;
}


