/* 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[79095] = new paymentOption(79095,'6&quot; x 4&quot; (15cm x 10cm approx)','4.00');
paymentOptions[79096] = new paymentOption(79096,'7&quot; x 5&quot; (18cm x 13cm approx)','5.00');
paymentOptions[79097] = new paymentOption(79097,'8&quot; x 6&quot; (20cm x 15cm approx)','6.00');
paymentOptions[79098] = new paymentOption(79098,'10&quot; x 8&quot; (25cm x 20cm approx)','10.00');
paymentOptions[79099] = new paymentOption(79099,'12&quot; x 8&quot; (30cm x 20cm approx)','12.50');
paymentOptions[74579] = new paymentOption(74579,'6&quot; x 4&quot; (15cm x 10cm approx): £3.50','3.50');
paymentOptions[74565] = new paymentOption(74565,'7&quot; x 5&quot; (18cm x 13cm approx): £4.25','4.25');
paymentOptions[61673] = new paymentOption(61673,'8&quot; x 6&quot; (20cm x 15cm approx): £5.00','5.00');
paymentOptions[61674] = new paymentOption(61674,'10&quot; x 8&quot; (25cm x 20cm approx): £8.00','8.00');
paymentOptions[74580] = new paymentOption(74580,'12&quot; x 8&quot; (30cm x 20cm approx): £12.00','12.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[22883] = new paymentGroup(22883,'2010 Prices','74565,61673,61674,74580');
			paymentGroups[24506] = new paymentGroup(24506,'2011 prices','79095,79096,79097,79098,79099');
			paymentGroups[22307] = new paymentGroup(22307,'Becca & Gareth Carter','61673,61674');
			paymentGroups[21290] = new paymentGroup(21290,'QinetiQ Christmas Party','61673,61674');
	/***************************************************************************
* 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;
}


