/* 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[61388] = new paymentOption(61388,'POSTCARD (Full colour glossy)','1.00');
paymentOptions[75034] = new paymentOption(75034,'Thurston Manor 5 Postcard Set','2.50');
paymentOptions[75035] = new paymentOption(75035,'PEASE BAY 6 POSTCARD SET','3.00');
paymentOptions[56669] = new paymentOption(56669,'A6 BLANK GREETING CARD&nbsp;','1.95');
paymentOptions[66307] = new paymentOption(66307,'A6 BIRTHDAY CARD','1.95');
paymentOptions[66308] = new paymentOption(66308,'A6 CHRISTMAS CARD','1.95');
paymentOptions[72667] = new paymentOption(72667,'A6 GOOD LUCK CARD','1.95');
paymentOptions[72663] = new paymentOption(72663,'A6 FATHER\'S DAY CARD','1.95');
paymentOptions[72665] = new paymentOption(72665,'A6 ANNIVERSARY CARD','1.95');
paymentOptions[72666] = new paymentOption(72666,'A6 NEW HOME CARD','1.95');
paymentOptions[72668] = new paymentOption(72668,'CUSTOMISE YOUR A6 CARD','1.95');
paymentOptions[78999] = new paymentOption(78999,'Pack of 5 Blank Greeting Cards','7.50');
paymentOptions[79005] = new paymentOption(79005,'Pack of 5 Christmas Cards','7.50');
paymentOptions[52378] = new paymentOption(52378,'10x8 SIGNED MOUNTED PRINT','10.00');
paymentOptions[66018] = new paymentOption(66018,'10x8&quot; SIGNED LIMITED EDITION','20.00');
paymentOptions[84271] = new paymentOption(84271,'12x10&quot; SIGNED LIMITED EDITION','25.00');
paymentOptions[78695] = new paymentOption(78695,'12x10&quot; SIGNED MOUNTED PRINT','15.00');
paymentOptions[73939] = new paymentOption(73939,'GLOSSY WALL CALENDAR &nbsp;&nbsp;','7.50');
paymentOptions[74089] = new paymentOption(74089,'MAGNETIC CALENDAR','1.50');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[24301] = new paymentGroup(24301,'12x10 & cards','56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,78695');
			paymentGroups[24561] = new paymentGroup(24561,'12x10 & cards & postcards','61388,56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,78695');
			paymentGroups[22446] = new paymentGroup(22446,'A6 GREETING CARD OPTIONS','56669,66307,66308,72667,72665,72666,72668,78999,79005');
			paymentGroups[24293] = new paymentGroup(24293,'All Sizes Prints & Cards','56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,52378,78695');
			paymentGroups[24294] = new paymentGroup(24294,'All Sizes Prints, Cards + POSTCARDS','61388,56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,52378,78695');
			paymentGroups[22836] = new paymentGroup(22836,'GLOSSY WALL CALENDAR','73939');
			paymentGroups[19735] = new paymentGroup(19735,'Greeting cards only','56669,66307,66308,72667,72663,72665,72666,72668,78999,79005');
			paymentGroups[20193] = new paymentGroup(20193,'LIMITED EDITION PRINTS','66018,84271');
			paymentGroups[26160] = new paymentGroup(26160,'Limited Prints & Cards','56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,66018,84271');
			paymentGroups[22864] = new paymentGroup(22864,'MAGNETIC CALENDAR','74089');
			paymentGroups[15803] = new paymentGroup(15803,'Mounted Prints & Greeting Cards','56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,52378');
			paymentGroups[18772] = new paymentGroup(18772,'MOUNTED PRINTS, GREETING CARDS & POSTCARDS<br>','61388,56669,52378,78695');
			paymentGroups[22576] = new paymentGroup(22576,'PCs, Cards LTD Prints','61388,56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,66018,84271');
			paymentGroups[22320] = new paymentGroup(22320,'PCs, Cards, Prints (NOT Ltd)','61388,56669,66307,66308,72667,72663,72665,72666,72668,78999,79005,52378');
			paymentGroups[23172] = new paymentGroup(23172,'PEASE BAY 6 POSTCARD SET','61388,75035,56669,66307,66308,72667,72663,72665,72666,72668,79005,52378,78695');
			paymentGroups[22293] = new paymentGroup(22293,'Postcards & Greeting Cards','61388,56669,66307,66308,72667,72663,72665,72666,72668,78999,79005');
			paymentGroups[18778] = new paymentGroup(18778,'Postcards Only','61388');
			paymentGroups[23170] = new paymentGroup(23170,'Thurston Manor 5 Postcard Set','61388,75034,56669,66307,66308,72667,72663,72665,72666,72668,78999,52378');
	/***************************************************************************
* 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;
}


