/* 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[63723] = new paymentOption(63723,'16 x 24 ins photo signed plus £5 postage','48.00');
paymentOptions[73211] = new paymentOption(73211,'Set of 5 cards','11.00');
paymentOptions[47690] = new paymentOption(47690,'8 x 12 ins (20.3 x 30.5 cms) photo ','25.00');
paymentOptions[52341] = new paymentOption(52341,'12 x 18 ins (30.5 x 45.7 cms) photo ','30.00');
paymentOptions[47692] = new paymentOption(47692,'16 x 24 ins (40.6 x 61.0 cms) photo','48.00');
paymentOptions[47693] = new paymentOption(47693,'20 x 30 ins (50.8 x 76.2 cms) photo','60.00');
paymentOptions[47694] = new paymentOption(47694,'16 x 20 ins (40.6 x 50.8cms) photo','48.00');
paymentOptions[47695] = new paymentOption(47695,'8 x 12 ins (20.3 x 30.5 cms) plus off white mount','23.00');
paymentOptions[52343] = new paymentOption(52343,'8 x 12 ins (20.3 x 30.5 cms) plus black mount ','23.00');
paymentOptions[52342] = new paymentOption(52342,'12 x 18 ins (30.5 x 45.7 cms) plus off white mount ','30.00');
paymentOptions[52344] = new paymentOption(52344,'12 x 18 ins (30.5 x 45.7 cms) plus black mount ','30.00');
paymentOptions[47697] = new paymentOption(47697,'16 x 24 ins (40.6 x 61.0 cms) plus off white mount','45.00');
paymentOptions[52345] = new paymentOption(52345,'16 x 24 ins (40.6 x 61.0 cms) plus black mount ','45.00');
paymentOptions[48328] = new paymentOption(48328,'20 x 30 ins (50.8 x 76.2 cms) plus off white mount ','65.00');
paymentOptions[52346] = new paymentOption(52346,'20 x 30 ins (50.8 x 76.2 cms) plus black mount','65.00');
paymentOptions[47699] = new paymentOption(47699,'16 x 20 ins (40.6 x 50.8cms) plus off white mount','45.00');
paymentOptions[52347] = new paymentOption(52347,'16 x 20 ins (40.6 x 50.8cms) plus black mount','45.00');
paymentOptions[56799] = new paymentOption(56799,'Shipping to USA','12.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[14513] = new paymentGroup(14513,'Non-standard size 16 x 20 ins','47694');
			paymentGroups[14512] = new paymentGroup(14512,'Our standard prices in GBP £, including UK P&P','47690,52341,47692,47693');
			paymentGroups[22610] = new paymentGroup(22610,'Set of 5 cards','73211');
			paymentGroups[17401] = new paymentGroup(17401,'Shipping to USA','56799');
			paymentGroups[21892] = new paymentGroup(21892,'Standard to 12 x 18','47690,52341');
			paymentGroups[14511] = new paymentGroup(14511,'Standard to 16 x 24','47690,52341,47692');
			paymentGroups[14514] = new paymentGroup(14514,'Standard to 8 x 12','47690');
	/***************************************************************************
* 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;
}


