/* 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[78015] = new paymentOption(78015,'Postage and Packing','2.00');
paymentOptions[83955] = new paymentOption(83955,'7&quot;x5&quot; print in black and silver mount','11.00');
paymentOptions[55858] = new paymentOption(55858,'8&quot; x 6&quot; print in black and silver mount','13.00');
paymentOptions[83372] = new paymentOption(83372,'7&quot;x5&quot; print','11.00');
paymentOptions[55859] = new paymentOption(55859,'8&quot; x 8&quot; square','15.00');
paymentOptions[83371] = new paymentOption(83371,'8&quot;x6&quot; print','13.00');
paymentOptions[60303] = new paymentOption(60303,'10&quot; x 8&quot; print ','16.00');
paymentOptions[55850] = new paymentOption(55850,'8&quot; x 10&quot; print','17.00');
paymentOptions[60304] = new paymentOption(60304,'16&quot; x 20&quot; print','55.00');
paymentOptions[55860] = new paymentOption(55860,'10&quot; x 10&quot; print','20.00');
paymentOptions[75485] = new paymentOption(75485,'12&quot;x10&quot; Print','30.00');
paymentOptions[55855] = new paymentOption(55855,'12&quot; x 10&quot; print','25.00');
paymentOptions[55861] = new paymentOption(55861,'12&quot; x 12&quot; print','30.00');
paymentOptions[55862] = new paymentOption(55862,'16&quot; x 12&quot; print','45.00');
paymentOptions[72465] = new paymentOption(72465,'16&quot; x 16&quot; print','50.00');
paymentOptions[72466] = new paymentOption(72466,'20&quot; x 20&quot; print','75.00');
paymentOptions[58929] = new paymentOption(58929,'10&quot;x8&quot; Montage Three Images','47.00');
paymentOptions[55864] = new paymentOption(55864,'8&quot; x 12&quot; panoramic print','20.00');
paymentOptions[55865] = new paymentOption(55865,'15&quot; x 10&quot; print','35.00');
paymentOptions[55867] = new paymentOption(55867,'14&quot; x 7&quot; panoramic print ','30.00');
paymentOptions[55863] = new paymentOption(55863,'20&quot; x 16&quot; print','60.00');
paymentOptions[77353] = new paymentOption(77353,'20&quot;x10&quot; Panoramic Print','60.00');
paymentOptions[77354] = new paymentOption(77354,'26&quot; x12&quot; Panoramic Print','65.00');
paymentOptions[77355] = new paymentOption(77355,'14&quot; x 11&quot; Print','30.00');
paymentOptions[77352] = new paymentOption(77352,'16&quot;x 24&quot; Print','70.00');
paymentOptions[75091] = new paymentOption(75091,'Set of 2 Wallet Cards - One image','15.00');
paymentOptions[55866] = new paymentOption(55866,'20&quot; x 30&quot; print ','95.00');
paymentOptions[68516] = new paymentOption(68516,'1-3 High resolution images','125.00');
paymentOptions[68517] = new paymentOption(68517,'4-6 High resolution Images','150.00');
paymentOptions[55872] = new paymentOption(55872,'Set of thee keyrings (one image)','15.00');
paymentOptions[55874] = new paymentOption(55874,'Set of 2 fridge magnets (one image)','15.00');
paymentOptions[55868] = new paymentOption(55868,'16&quot; x 12&quot; Black Edged MDF Block','130.00');
paymentOptions[55869] = new paymentOption(55869,'16&quot; x 20&quot; Black Edged MDF Block','160.00');
paymentOptions[55870] = new paymentOption(55870,'16&quot; x 20&quot; Box Frame','190.00');
paymentOptions[55871] = new paymentOption(55871,'16&quot; x 12&quot; Box Frame','150.00');
paymentOptions[82115] = new paymentOption(82115,'10 High Resolution Images on Disc','350.00');
paymentOptions[20633] = new paymentOption(20633,'Baby Portrait Montage Gift Voucher Package 1','125.00');
paymentOptions[38012] = new paymentOption(38012,'Baby Portrait Montage Gift Voucher Package 2','195.00');
paymentOptions[50926] = new paymentOption(50926,'Lifestyle Black & White Portrait Session Gift Voucher','125.00');
paymentOptions[50925] = new paymentOption(50925,'Family Portrait Day','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[18104] = new paymentGroup(18104,'10&quot;x8&quot; Montage Three Images','58929');
			paymentGroups[10142] = new paymentGroup(10142,'Baby Montage','20633,38012');
			paymentGroups[11735] = new paymentGroup(11735,'Baby Portrait Montage Gift Voucher Package 2','20633,38012');
			paymentGroups[21420] = new paymentGroup(21420,'Carla Voucher','68516');
			paymentGroups[15445] = new paymentGroup(15445,'Family Portrait Day Gift Voucher','50925');
			paymentGroups[15446] = new paymentGroup(15446,'Lifestyle Black & White Portrait Gift Voucher','50926');
			paymentGroups[17040] = new paymentGroup(17040,'Prints and Products','78015,83372,55859,83371,55850,55860,55855,55861,55862,72465,72466,55864,55865,55867,55863,77353,77354,77355,77352,75091,55866,55872,55874,55868,55869,55870,55871,82115');
			paymentGroups[18542] = new paymentGroup(18542,'Prints and Products Groups','78015,83955,55858,60303,60304,75485,55862,75091,55866,68516,68517,55872,55874,55868,55869,55870,55871');
			paymentGroups[21915] = new paymentGroup(21915,'Selena Boyfield','');
	/***************************************************************************
* 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;
}


