/* 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[6255] = new paymentOption(6255,'6&quot; X 4&quot; (15cm X 10cm)','5.00');
paymentOptions[24920] = new paymentOption(24920,'Cards pack of 5','10.00');
paymentOptions[24921] = new paymentOption(24921,'Cards pack of 10','15.00');
paymentOptions[6256] = new paymentOption(6256,'7&quot; X 5&quot; (18cm x 12½cm) ','7.00');
paymentOptions[6257] = new paymentOption(6257,'9&quot;x 6&quot; (23cm x 15cm)','10.00');
paymentOptions[24922] = new paymentOption(24922,'Cards pack of 20','25.00');
paymentOptions[24982] = new paymentOption(24982,'Individual Card','2.00');
paymentOptions[6258] = new paymentOption(6258,'10&quot;x 8&quot; (25cm x 20cm)  -- LE --> 30 prints','20.00');
paymentOptions[6259] = new paymentOption(6259,'12&quot;x 8&quot; (30cm x 20cm) -- LE --> 20 prints','25.00');
paymentOptions[8169] = new paymentOption(8169,'14&quot;x 11&quot; (35½cm x 28cm) -- LE --> 30 prints','30.00');
paymentOptions[6263] = new paymentOption(6263,'15&quot; X 10&quot; (38cm x 25cm)  -- LE --> 10 prints','30.00');
paymentOptions[6264] = new paymentOption(6264,'18&quot; X 12&quot; (45¾cm x 30½cm) -- LE --> 10 prints','40.00');
paymentOptions[6277] = new paymentOption(6277,'20&quot;x16&quot; (51¾cm x 41cm) -- LE --> 10 prints ','50.00');
paymentOptions[6265] = new paymentOption(6265,'30&quot; X 20&quot; (76cm x 51cm)  -- LE --> 5 prints','75.00');
paymentOptions[8167] = new paymentOption(8167,'8&quot; X 8&quot; (20cm x 20cm) -- LE --> 30 prints','20.00');
paymentOptions[8166] = new paymentOption(8166,'12&quot; X 12&quot; (30cm x 30cm) -- LE ---> 20 prints','25.00');
paymentOptions[6268] = new paymentOption(6268,'12&quot;x 5&quot; (30½cm x 13cm) -- LE --> 20 prints','25.00');
paymentOptions[6267] = new paymentOption(6267,'20&quot; X 8&quot; (51¾cm x 21½cm) -- LE --> 20 prints ','50.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[2400] = new paymentGroup(2400,'Photo Prices for Square Images','8167,8166');
			paymentGroups[2398] = new paymentGroup(2398,'Photo Prices Normal Images','6255,6256,6257,6258,6259,8169,6263,6264,6277,6265');
			paymentGroups[2399] = new paymentGroup(2399,'Photo Prices Panoramic Images','6268,6267');
			paymentGroups[7588] = new paymentGroup(7588,'Prices for Cards','24920,24921,24922,24982');
	/***************************************************************************
* 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;
}


