/* 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[16392] = new paymentOption(16392,'5&quot;x7.5&quot; (13x19cm) Glossy','12.00');
paymentOptions[16393] = new paymentOption(16393,'5&quot;x7.5&quot; (13x19cm) Matt','12.00');
paymentOptions[16394] = new paymentOption(16394,'6&quot;x9&quot; (15x23cm) Glossy','14.00');
paymentOptions[16395] = new paymentOption(16395,'6&quot;x9&quot; (15x23cm) Matt','14.00');
paymentOptions[16396] = new paymentOption(16396,'8&quot;x12&quot;  (20x30cm) Glossy','16.00');
paymentOptions[16397] = new paymentOption(16397,'12&quot;x18&quot;  (30x46cm) Glossy','20.00');
paymentOptions[16398] = new paymentOption(16398,'16&quot;x24&quot; (41x61cm) Matt','25.00');
paymentOptions[16399] = new paymentOption(16399,'20&quot;x30&quot; (51x76cm) Matt','31.00');
paymentOptions[16400] = new paymentOption(16400,'24&quot;x36&quot; (61x91cm) Matt','38.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','16392,16393,16394,16395,16396,16397,16398,16399,16400');
/***************************************************************************
* 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;
}


