/* 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[25845] = new paymentOption(25845,'A4 (210 x 297) approx  unmounted','19.99');
paymentOptions[25846] = new paymentOption(25846,'A4 (210 x 297) approx mounted in light wood frame','34.99');
paymentOptions[25847] = new paymentOption(25847,'A4 (210 x 297)  approx mounted in dark wood frame','34.99');
paymentOptions[25848] = new paymentOption(25848,'A3 (297 x 420) approx unmounted ','29.99');
paymentOptions[25849] = new paymentOption(25849,'A3 (297 x 420) approx mounted in light wood frame','59.99');
paymentOptions[25850] = new paymentOption(25850,'A3 (297 x 420) approx mounted in dark wood frame','59.99');
paymentOptions[81306] = new paymentOption(81306,'10&quot; x 8&quot; approx print with Charity donation','10.00');
paymentOptions[81305] = new paymentOption(81305,'6&quot; x 4&quot; approx print with Charity donation','7.50');
paymentOptions[81307] = new paymentOption(81307,'16&quot; x 12&quot; approx print with Charity donation','20.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[25169] = new paymentGroup(25169,'General Pricing','25845,25846,25847,25848,25849,25850');
			paymentGroups[25168] = new paymentGroup(25168,'Masonic with Charity donation','81306,81305,81307');
	/***************************************************************************
* 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;
}


