/* 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[70967] = new paymentOption(70967,'9x6&quot; photographic print incl P&P','10.00');
paymentOptions[70968] = new paymentOption(70968,'10x7&quot;photographic print incl P&P','15.00');
paymentOptions[70969] = new paymentOption(70969,'12x8&quot; photographic print incl P&P','20.00');
paymentOptions[70970] = new paymentOption(70970,'15x10&quot; photographic print incl P&P','30.00');
paymentOptions[70971] = new paymentOption(70971,'18x12&quot; photographic print incl P&P','40.00');
paymentOptions[70972] = new paymentOption(70972,'20x16&quot; photographic print incl P&P','50.00');
paymentOptions[70973] = new paymentOption(70973,'30x20&quot; photographic print incl P&P','65.00');
paymentOptions[70974] = new paymentOption(70974,'12x8&quot; Canvas Print, ready to hang, incl P&P','60.00');
paymentOptions[70975] = new paymentOption(70975,'18x12&quot; Canvas Print, ready to hang, incl P&P','80.00');
paymentOptions[70976] = new paymentOption(70976,'24x18&quot; Canvas Print, ready to hang, incl P&P','100.00');
paymentOptions[70977] = new paymentOption(70977,'30x24&quot; Canvas Print, ready to hang, incl P&P','120.00');
paymentOptions[70978] = new paymentOption(70978,'30x36&quot; Canvas Print, ready to hang, incl P&P','150.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','70967,70968,70969,70970,70971,70972,70973,70974,70975,70976,70977,70978');
/***************************************************************************
* 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;
}


