/* 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[24385] = new paymentOption(24385,'7&quot; x 5&quot; in folder','7.95');
paymentOptions[38498] = new paymentOption(38498,'Event 6&quot; x 4&quot; in folder','5.00');
paymentOptions[26019] = new paymentOption(26019,'7&quot; x 5&quot; in folder','19.95');
paymentOptions[37110] = new paymentOption(37110,'£10','10.00');
paymentOptions[37111] = new paymentOption(37111,'£20','20.00');
paymentOptions[26020] = new paymentOption(26020,'8&quot; x 6&quot; in folder','19.95');
paymentOptions[38499] = new paymentOption(38499,'Event 7&quot; x 5&quot; in folder','7.50');
paymentOptions[24386] = new paymentOption(24386,'8&quot; x 6&quot; in folder','9.95');
paymentOptions[24387] = new paymentOption(24387,'10&quot; x 8&quot; in folder','13.95');
paymentOptions[38500] = new paymentOption(38500,'Event 8&quot; x 6&quot; in folder','10.00');
paymentOptions[26021] = new paymentOption(26021,'10&quot; x 8&quot; in folder','24.95');
paymentOptions[37112] = new paymentOption(37112,'£30','30.00');
paymentOptions[37113] = new paymentOption(37113,'£40','40.00');
paymentOptions[26022] = new paymentOption(26022,'12&quot; x 8&quot; or 10&quot; in folder','29.95');
paymentOptions[38501] = new paymentOption(38501,'Event 10&quot; x 8&quot; in folder','15.00');
paymentOptions[24388] = new paymentOption(24388,'12&quot; x 8&quot; or 10&quot; in folder','19.95');
paymentOptions[24389] = new paymentOption(24389,'14&quot; x 11&quot;','24.95');
paymentOptions[38502] = new paymentOption(38502,'Event Double 8&quot; x 6&quot; in special mount','20.00');
paymentOptions[26023] = new paymentOption(26023,'14&quot; x 11&quot;','34.95');
paymentOptions[37114] = new paymentOption(37114,'£50','50.00');
paymentOptions[37115] = new paymentOption(37115,'£100','100.00');
paymentOptions[29738] = new paymentOption(29738,'18&quot; x 12&quot;','29.95');
paymentOptions[29739] = new paymentOption(29739,'18&quot; x 12&quot;','39.95');
paymentOptions[24872] = new paymentOption(24872,'20&quot; x 16&quot;','39.95');
paymentOptions[37116] = new paymentOption(37116,'Other amount, please contact me.','0.00');
paymentOptions[56031] = new paymentOption(56031,'Wedding package deposit £200','200.00');
paymentOptions[26024] = new paymentOption(26024,'20&quot; x 16&quot;','49.95');
paymentOptions[24390] = new paymentOption(24390,'24&quot; x 20&quot;','49.95');
paymentOptions[24391] = new paymentOption(24391,'30&quot; x 20&quot;','59.95');
paymentOptions[82900] = new paymentOption(82900,'Portrait sitting & three 8&quot; x 6&quot; prints','49.95');
paymentOptions[26025] = new paymentOption(26025,'30&quot; x 20&quot;','69.95');
paymentOptions[24392] = new paymentOption(24392,'Quailty 36&quot; x 24&quot; Canvas','195.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[11902] = new paymentGroup(11902,'Events','38498,38499,38500,38501,38502');
			paymentGroups[11482] = new paymentGroup(11482,'Gift Voucher','37110,37111,37112,37113,37114,37115,37116,56031,82900');
			paymentGroups[7982] = new paymentGroup(7982,'Portraits','26019,26020,26021,26022,26023,29739,26024,82900,26025,24392');
			paymentGroups[7983] = new paymentGroup(7983,'Wedding reprints','24385,24386,24387,24388,24389,29738,24872,56031,24390,24391,24392');
	/***************************************************************************
* 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;
}


