/* 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[48016] = new paymentOption(48016,'GICLEE PRINT A4 - 21.0cm x 29.7cm','80.00');
paymentOptions[48017] = new paymentOption(48017,'GICLEE PRINT A3 - 29.7cm x 42.0cm','150.00');
paymentOptions[48018] = new paymentOption(48018,'GICLEE PRINT A2 - 42.cm x 59.4cm','200.00');
paymentOptions[48019] = new paymentOption(48019,'GICLEE CANVAS 12&quot; x 24&quot;','200.00');
paymentOptions[48020] = new paymentOption(48020,'GICLEE CANVAS 24&quot; x 28&quot;','350.00');
paymentOptions[48021] = new paymentOption(48021,'GICLEE CANVAS 28&quot; x 36&quot;','400.00');
paymentOptions[48022] = new paymentOption(48022,'GICLEE CANVAS 36&quot; x 36&quot;','450.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[14609] = new paymentGroup(14609,'GICLEE PRINTS','48016,48017,48018,48019,48020,48021,48022');
	/***************************************************************************
* 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;
}


