/* 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[84216] = new paymentOption(84216,'30&quot;x20&quot; Mounted on Aluminium','245.00');
paymentOptions[84217] = new paymentOption(84217,'30&quot;x20&quot; Print Only','145.00');
paymentOptions[84218] = new paymentOption(84218,'20&quot;x27&quot; Print Only','135.00');
paymentOptions[84219] = new paymentOption(84219,'20&quot;x27&quot; Mounted on Aluminium','235.00');
paymentOptions[84220] = new paymentOption(84220,'15&quot;x36&quot; Print Only','145.00');
paymentOptions[84221] = new paymentOption(84221,'15&quot;x36&quot; Mounted on Aluminium','245.00');
paymentOptions[84222] = new paymentOption(84222,'16&quot;x21&quot; Print Only','115.00');
paymentOptions[84223] = new paymentOption(84223,'16&quot;x24&quot; Print Only','125.00');
paymentOptions[84224] = new paymentOption(84224,'16&quot;x16&quot; Print Only','115.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[5425] = new paymentGroup(5425,'15&quot;x36&quot;','84220,84221');
			paymentGroups[26134] = new paymentGroup(26134,'16&quot;x16&quot;','84224');
			paymentGroups[19636] = new paymentGroup(19636,'16&quot;x21&quot;','84222');
			paymentGroups[26135] = new paymentGroup(26135,'16&quot;x24&quot;','84223');
			paymentGroups[19637] = new paymentGroup(19637,'20&quot;x27&quot;','84218,84219');
			paymentGroups[19635] = new paymentGroup(19635,'20&quot;x30&quot;','84216,84217');
	/***************************************************************************
* 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;
}


