/* 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[70444] = new paymentOption(70444,'Two Hour Studio Shoot','130.00');
paymentOptions[66485] = new paymentOption(66485,'One Hour Home Portrait','75.00');
paymentOptions[73022] = new paymentOption(73022,'7&quot;x5&quot; Additional Print','6.00');
paymentOptions[73023] = new paymentOption(73023,'10x8 Additional Print ','10.00');
paymentOptions[73039] = new paymentOption(73039,'12&quot;x10 Additional Print','20.00');
paymentOptions[73040] = new paymentOption(73040,'18&quot;x12&quot; Additional Print','30.00');
paymentOptions[72362] = new paymentOption(72362,'Essential Digitial Tuition','49.99');
paymentOptions[78943] = new paymentOption(78943,'7x5 Picture Restoration','19.99');
paymentOptions[78944] = new paymentOption(78944,'A4 Photo Restoration','29.99');
paymentOptions[66484] = new paymentOption(66484,'£50.00 Gift Voucher','50.00');
paymentOptions[51880] = new paymentOption(51880,'Landscape Day','99.99');
paymentOptions[51881] = new paymentOption(51881,'Equipment Hire','25.00');
paymentOptions[73796] = new paymentOption(73796,'A4 Print','15.00');
paymentOptions[73797] = new paymentOption(73797,'7&quot;x5&quot; Print','8.00');
paymentOptions[51969] = new paymentOption(51969,'£25.00 Gift Voucher','25.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[22339] = new paymentGroup(22339,'Gift Voucher','66484,51969');
			paymentGroups[15805] = new paymentGroup(15805,'Portraits & Portfolio','70444,66485,73022,73023,73039,73040');
			paymentGroups[15802] = new paymentGroup(15802,'Prints','73796,73797');
			paymentGroups[22338] = new paymentGroup(22338,'Product Photography','');
			paymentGroups[24341] = new paymentGroup(24341,'Services','78943,78944');
			paymentGroups[15804] = new paymentGroup(15804,'Tuition','72362,51880,51881');
	/***************************************************************************
* 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;
}


