/* 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[82508] = new paymentOption(82508,'Christmas Cards - pack of 4 English','7.00');
paymentOptions[82509] = new paymentOption(82509,'Christmas Cards - pack of 4 Gaelic','7.00');
paymentOptions[82510] = new paymentOption(82510,'Christmas Cards - pack of 4 mixed','7.00');
paymentOptions[82511] = new paymentOption(82511,'Christmas Cards - pack of 10 - English','12.00');
paymentOptions[82512] = new paymentOption(82512,'Christmas Cards - pack of 10 - Gaelic','12.00');
paymentOptions[82513] = new paymentOption(82513,'Christmas Cards - pack of 10 - mixed','12.00');
paymentOptions[82447] = new paymentOption(82447,'Christmas Cards - Individual','2.00');
paymentOptions[17085] = new paymentOption(17085,'A4  (29.7cm X 21cm)','15.00');
paymentOptions[17086] = new paymentOption(17086,'A3 (42cm x 29.7cm)','25.00');
paymentOptions[17087] = new paymentOption(17087,'A2 (59.4cm x 42cm)','30.00');
paymentOptions[17088] = new paymentOption(17088,'30&quot; x 20&quot;  (76cm x 51cm)','40.00');
paymentOptions[17096] = new paymentOption(17096,'12&quot; x 12&quot; (30 cm x 30 cm)','23.00');
paymentOptions[17097] = new paymentOption(17097,'12&quot; x 5&quot; (30½cm x 13cm)','15.00');
paymentOptions[17098] = new paymentOption(17098,'8&quot; x 8&quot; (20 cm x 20 cm)','15.00');
paymentOptions[17127] = new paymentOption(17127,'20&quot; x 8&quot; (51¾cm x 21½cm) ','23.00');
paymentOptions[24702] = new paymentOption(24702,'20&quot; x 16&quot; (51¾cm x 41cm) ','30.00');
paymentOptions[27023] = new paymentOption(27023,'A4 Calendar','9.00');
paymentOptions[28135] = new paymentOption(28135,'10&quot; x 8&quot;','14.00');
paymentOptions[81287] = new paymentOption(81287,'Islay\'s Coastline - outside UK (rest of world)','14.99');
paymentOptions[81278] = new paymentOption(81278,'Islay\'s Coastline - outside UK (Europe)','12.99');
paymentOptions[69266] = new paymentOption(69266,'A4 Calendar - outside UK (Europe)','8.00');
paymentOptions[69267] = new paymentOption(69267,'A4 Calendar - outside UK (rest of world)','11.20');
paymentOptions[74846] = new paymentOption(74846,'A3 poster Butterflies of Islay','4.50');
paymentOptions[73340] = new paymentOption(73340,'Islay\'s Coastline Book','10.99');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[8644] = new paymentGroup(8644,'10&quot; x 8&quot;','28135');
			paymentGroups[5127] = new paymentGroup(5127,'12&quot; x 12&quot;','17096');
			paymentGroups[5129] = new paymentGroup(5129,'12&quot; x 12&quot;, 8&quot; x 8&quot;','17096,17098');
			paymentGroups[7496] = new paymentGroup(7496,'12&quot; x 16&quot; (51¾cm x 41cm) ','');
			paymentGroups[5128] = new paymentGroup(5128,'12&quot; x 5&quot;','17097');
			paymentGroups[5142] = new paymentGroup(5142,'20&quot; x 8&quot;  12&quot; x 5&quot;','17097,17127');
			paymentGroups[5123] = new paymentGroup(5123,'30&quot; x 20&quot; (76cm x 51cm)','17088');
			paymentGroups[5126] = new paymentGroup(5126,'8&quot; x 8&quot;','17098');
			paymentGroups[5122] = new paymentGroup(5122,'A2 (59.4cm x 42cm)','17087');
			paymentGroups[5131] = new paymentGroup(5131,'A2, A3, A4','17085,17086,17087');
			paymentGroups[5121] = new paymentGroup(5121,'A3 (42cm x 29.7cm)','17086');
			paymentGroups[5120] = new paymentGroup(5120,'A4','17085');
			paymentGroups[21366] = new paymentGroup(21366,'A4 calendar - outside UK (Europe)','27023,69266');
			paymentGroups[21367] = new paymentGroup(21367,'A4 Calendar - outside UK (rest of world)','27023,69267');
			paymentGroups[5125] = new paymentGroup(5125,'A4, A3, A2, 30&quot; x 20&quot;','17085,17086,17087,17088');
			paymentGroups[23116] = new paymentGroup(23116,'Butterflies of Islay poster','74846');
			paymentGroups[8318] = new paymentGroup(8318,'Calendar','27023,69266,69267');
			paymentGroups[25588] = new paymentGroup(25588,'Christmas Cards - Individual','82447');
			paymentGroups[25609] = new paymentGroup(25609,'Christmas cards - pack of 10 - English','82511');
			paymentGroups[25610] = new paymentGroup(25610,'Christmas Cards - pack of 10 - Gaelic','82512');
			paymentGroups[25611] = new paymentGroup(25611,'Christmas Cards - pack of 10 - mixed','82513');
			paymentGroups[25607] = new paymentGroup(25607,'Christmas Cards - pack of 4 - Gaelic','82509');
			paymentGroups[25608] = new paymentGroup(25608,'Christmas Cards - pack of 4 - mixed','82510');
			paymentGroups[25606] = new paymentGroup(25606,'Christmas Cards - pack of 4 English','82508');
			paymentGroups[22649] = new paymentGroup(22649,'Islay\'s Coastline','81287,81278,73340');
			paymentGroups[25148] = new paymentGroup(25148,'Islay\'s Coastline - outside UK (Europe)','81278,73340');
			paymentGroups[25149] = new paymentGroup(25149,'Islay\'s Coastline - outside UK (rest of world)','81287,73340');
	/***************************************************************************
* 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;
}


