/* 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[66414] = new paymentOption(66414,'EU Post Rate Crosby\'s Man for all Seasons 2012 Calendar.','8.99');
paymentOptions[66412] = new paymentOption(66412,'World Post Rate Crosby\'s Man for all Seasons 2012 Calendar.','10.99');
paymentOptions[47951] = new paymentOption(47951,'Limited Ed/100 Signed Giclee Print on 48cm x 33cm','55.00');
paymentOptions[84821] = new paymentOption(84821,'Limited EdPrint mounted and framed in matt black.* (See note)','110.00');
paymentOptions[48478] = new paymentOption(48478,'Open edition Giclee print on 48cm x 33cm art paper','55.00');
paymentOptions[48827] = new paymentOption(48827,'Limited Ed/195 Signed Giclee print on 48cm x 33cm art paper.','55.00');
paymentOptions[47952] = new paymentOption(47952,'Open edition Giclee print on A4 paper unmounted','20.00');
paymentOptions[47953] = new paymentOption(47953,'Open edition Giclee print on A4 paper  mounted to 30cm x 40cm','30.00');
paymentOptions[48826] = new paymentOption(48826,'Signed Limited Edition of 50','55.00');
paymentOptions[48472] = new paymentOption(48472,'7 Contact Set Unmounted','20.00');
paymentOptions[48473] = new paymentOption(48473,'7 Contact Set Mounted to 60cm x 20cm','30.00');
paymentOptions[48271] = new paymentOption(48271,'A6 Greetings Card','3.00');
paymentOptions[56206] = new paymentOption(56206,'Giclée Print 46cm x 7cm on 48cm x 10cm paper','20.00');
paymentOptions[56207] = new paymentOption(56207,'Giclée Print 46cm x 7cm mounted to 60cm x 20cm','30.00');
paymentOptions[56209] = new paymentOption(56209,'Giclée Print 96cm x 20cm on 100cm x 33cm paper unmounted.','90.00');
paymentOptions[61305] = new paymentOption(61305,'LE of 350. Signed Giclée Print on A3 Satin Art Paper. Unmounted.','40.00');
paymentOptions[61306] = new paymentOption(61306,'LE of 350. Signed Giclée Print on A3 Satin Art Paper. Mounted to 50cmx 40cm','55.00');
paymentOptions[76829] = new paymentOption(76829,'Open Edition 46cm x 12cm on 48cm x 16cm paper, unmounted','28.00');
paymentOptions[76830] = new paymentOption(76830,'Open Edition 70cm x 20cm on 80cm x 32cm paper, unmounted.','75.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[14751] = new paymentGroup(14751,'Another Place Pictures','47951,84821,47952,47953,48271');
			paymentGroups[23684] = new paymentGroup(23684,'Another Place Specials','76829,76830');
			paymentGroups[20367] = new paymentGroup(20367,'Calendars','66414,66412');
			paymentGroups[14750] = new paymentGroup(14750,'European Contact Series','48472,48473');
			paymentGroups[14759] = new paymentGroup(14759,'General Print Prices','48478,47952,47953,48271');
			paymentGroups[14749] = new paymentGroup(14749,'Liverpool Contact Series','48472,48473');
			paymentGroups[17165] = new paymentGroup(17165,'Liverpool Panoramics','56206,56207,56209');
			paymentGroups[14847] = new paymentGroup(14847,'Painting with light','48826,48271');
			paymentGroups[14846] = new paymentGroup(14846,'Sefton Coast','48827,48271');
			paymentGroups[18757] = new paymentGroup(18757,'The Italian Collection','61305,61306');
	/***************************************************************************
* 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;
}


