/* 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[40242] = new paymentOption(40242,'Prints 6&quot;x4&quot;','8.00');
paymentOptions[40243] = new paymentOption(40243,'7&quot;x5&quot;','10.00');
paymentOptions[40244] = new paymentOption(40244,'9&quot;x6&quot;','15.00');
paymentOptions[40245] = new paymentOption(40245,'10&quot;x8&quot;','20.00');
paymentOptions[80066] = new paymentOption(80066,'8&quot;x8&quot; square prints without mount','12.00');
paymentOptions[80067] = new paymentOption(80067,'10x10&quot;','22.00');
paymentOptions[80070] = new paymentOption(80070,'12&quot;x12&quot;','26.00');
paymentOptions[76012] = new paymentOption(76012,'Delux framed desk prints 7&quot;x5&quot;','65.00');
paymentOptions[76013] = new paymentOption(76013,'8&quot;x6&quot;','75.00');
paymentOptions[76014] = new paymentOption(76014,'10&quot;x8&quot;','85.00');
paymentOptions[76015] = new paymentOption(76015,'Box framed wall prints 12&quot;x10&quot;','115.00');
paymentOptions[76016] = new paymentOption(76016,'16&quot;x12&quot;','185.00');
paymentOptions[76017] = new paymentOption(76017,'24&quot;x20&quot;','265.00');
paymentOptions[76018] = new paymentOption(76018,'Canvas Prints 12&quot;x10&quot;','165.00');
paymentOptions[76023] = new paymentOption(76023,'12&quot;x12&quot;','195.00');
paymentOptions[76019] = new paymentOption(76019,'16&quot;x12&quot;','230.00');
paymentOptions[76021] = new paymentOption(76021,'16&quot;x16&quot;','295.00');
paymentOptions[76020] = new paymentOption(76020,'20&quot;x16&quot;','320.00');
paymentOptions[76022] = new paymentOption(76022,'20&quot;x20&quot;','380.00');
paymentOptions[80071] = new paymentOption(80071,'slide show from your veiwing session ','55.00');
paymentOptions[75961] = new paymentOption(75961,'Personalised dvd of 50 low res images','85.00');
paymentOptions[77342] = new paymentOption(77342,'personalised dvd of 50 high res images','350.00');
paymentOptions[80439] = new paymentOption(80439,'Photo Experience Voucher ','35.00');
paymentOptions[80440] = new paymentOption(80440,'Photo Experience with Makeover','75.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[0] = new paymentGroup(0,'Default group','40242,40243,40244,40245,80066,80067,80070,76012,76013,76014,76015,76016,76017,76018,76023,76019,76021,76020,76022,80071,75961,77342,80439,80440');
/***************************************************************************
* 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;
}


