/* 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[66717] = new paymentOption(66717,'5&quot; x 7&quot; Mounted Print','10.00');
paymentOptions[36506] = new paymentOption(36506,'Prints -  4&quot; x 6&quot;','5.00');
paymentOptions[72226] = new paymentOption(72226,'Prints - 10 x 12&quot;','12.00');
paymentOptions[72227] = new paymentOption(72227,'Prints -10 x 20&quot;','25.00');
paymentOptions[62048] = new paymentOption(62048,'Print 4&quot; x 6&quot;','1.00');
paymentOptions[62049] = new paymentOption(62049,'Print 5 x 7&quot;','1.20');
paymentOptions[36510] = new paymentOption(36510,'Prints - 10&quot; x 14&quot;','20.00');
paymentOptions[36511] = new paymentOption(36511,'Prints - 11&quot; x 14&quot;','28.00');
paymentOptions[36507] = new paymentOption(36507,'Prints  5&quot; x 7&quot;','7.00');
paymentOptions[66718] = new paymentOption(66718,'8&quot; x 6&quot; Mounted Print','15.00');
paymentOptions[66719] = new paymentOption(66719,'9&quot; x 6&quot; Mounted Print','15.00');
paymentOptions[66715] = new paymentOption(66715,'12&quot; x 8&quot; Prints Mounted','20.00');
paymentOptions[36508] = new paymentOption(36508,'Prints  - 6&quot; x 8&quot;','9.00');
paymentOptions[62050] = new paymentOption(62050,'CD','2.00');
paymentOptions[62051] = new paymentOption(62051,'Cards','1.50');
paymentOptions[66714] = new paymentOption(66714,'10&quot; x 8&quot; Prints Mounted','20.00');
paymentOptions[48629] = new paymentOption(48629,'Prints - 6&quot; x 9&quot;','10.00');
paymentOptions[62052] = new paymentOption(62052,'Acrylic Block','30.00');
paymentOptions[36509] = new paymentOption(36509,'Prints -  8&quot; x 10&quot;','13.00');
paymentOptions[66716] = new paymentOption(66716,'10&quot; x 30&quot; Ready to mount and frame','40.00');
paymentOptions[36502] = new paymentOption(36502,'Gloss Prints - 8&quot; x 10&quot;','12.00');
paymentOptions[36500] = new paymentOption(36500,'Gloss Prints - A4','15.00');
paymentOptions[36501] = new paymentOption(36501,'Gloss Print - A3','25.00');
paymentOptions[36504] = new paymentOption(36504,'Museum Etching Paper Prints - 9&quot; x 7.5&quot;','30.00');
paymentOptions[36505] = new paymentOption(36505,'Museum Etching Paper Prints - 10&quot; x 8&quot;','30.00');
paymentOptions[72225] = new paymentOption(72225,'Price - 12x 12','20.00');
paymentOptions[36503] = new paymentOption(36503,'Museum Etching Paper Prints - 14&quot; x 11&quot;','40.00');
paymentOptions[53315] = new paymentOption(53315,'CD Montage','10.00');
paymentOptions[53316] = new paymentOption(53316,'Digital Photo Book','35.00');
paymentOptions[36499] = new paymentOption(36499,'Digitally Painted Portraits','150.00');
paymentOptions[53317] = new paymentOption(53317,'£30 Voucher','30.00');
paymentOptions[53318] = new paymentOption(53318,'£50 Voucher','50.00');
paymentOptions[53319] = new paymentOption(53319,'£100 Voucher','100.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[14798] = new paymentGroup(14798,'Additional Etching Paper Prints','36504,36505,36503');
			paymentGroups[14799] = new paymentGroup(14799,'Additional Prints','36506,36510,36511,36507,36508,48629,36509,36502');
			paymentGroups[18987] = new paymentGroup(18987,'Discont Prices','62048,62049,62050,62051,62052');
			paymentGroups[22286] = new paymentGroup(22286,'Feb 10 x 12','72226');
			paymentGroups[22287] = new paymentGroup(22287,'Feb 10 x 20&quot;','72227');
			paymentGroups[22284] = new paymentGroup(22284,'Feb 8 x 10','36509');
			paymentGroups[22285] = new paymentGroup(22285,'Feb A4','36500');
			paymentGroups[22282] = new paymentGroup(22282,'Feb Prices','72225');
			paymentGroups[11255] = new paymentGroup(11255,'Portrait Price','36499');
			paymentGroups[11256] = new paymentGroup(11256,'Prints','36506,36510,36511,36507,36508,48629,36509,36502,36500,36501,53315,53316,36499,53317,53318,53319');
			paymentGroups[20460] = new paymentGroup(20460,'Prints Mounted','66717,66718,66719,66715,66714,66716');
	/***************************************************************************
* 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;
}


