/* 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[27265] = new paymentOption(27265,'10&quot; X 8&quot; GICLEE PRINT UK ONLY','35.00');
paymentOptions[27435] = new paymentOption(27435,'20&quot; X 16&quot; GICLEE PRINT UK ONLY','49.00');
paymentOptions[38173] = new paymentOption(38173,'20&quot; X 11&quot; GICLEE PRINT UK ONLY','43.00');
paymentOptions[41478] = new paymentOption(41478,'24&quot; x 14&quot; GICLEE PRINT UK ONLY','50.00');
paymentOptions[19379] = new paymentOption(19379,'12&quot; X 5&quot; GICLEE PRINT UK ONLY','35.00');
paymentOptions[26193] = new paymentOption(26193,'18 X 7.5 GICLEE PRINT UK ONLY','39.00');
paymentOptions[12262] = new paymentOption(12262,'24&quot; X 10&quot; GICLEE PRINT UK ONLY','45.00');
paymentOptions[41285] = new paymentOption(41285,'36&quot; X 15 &quot; GICLEE PRINT UK ONLY','60.00');
paymentOptions[40081] = new paymentOption(40081,'12&quot; X 6&quot; GICLEE PRINT UK ONLY','35.00');
paymentOptions[43161] = new paymentOption(43161,'18&quot; X 9&quot; GICLEE PRINT UK ONLY','40.00');
paymentOptions[40080] = new paymentOption(40080,'24&quot; X 12 &quot; GICLEE PRINT UK ONLY','47.00');
paymentOptions[41284] = new paymentOption(41284,'36&quot; X 18 &quot; GICLEE PRINT UK ONLY','66.00');
paymentOptions[55790] = new paymentOption(55790,'24&quot; x 14&quot; GICLEE PRINT UK ONLY','50.00');
paymentOptions[55791] = new paymentOption(55791,'18&quot; X 10.5&quot; GICLEE PRINT UK ONLY','42.00');
paymentOptions[55792] = new paymentOption(55792,'12&quot; X 7&quot; GICLEE PRINT UK ONLY','36.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[11780] = new paymentGroup(11780,'OTHER SIZES','38173');
			paymentGroups[3343] = new paymentGroup(3343,'PANORAMIC','19379,26193,12262,41285');
			paymentGroups[17017] = new paymentGroup(17017,'PANORAMIC 3','55790,55791,55792');
			paymentGroups[12415] = new paymentGroup(12415,'PANORAMIC SIZE 2','40081,43161,40080,41284');
			paymentGroups[8394] = new paymentGroup(8394,'STANDARD','27265,27435');
	/***************************************************************************
* 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;
}


