/* 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[76534] = new paymentOption(76534,'7&quot;x5&quot; photographic print','10.00');
paymentOptions[76535] = new paymentOption(76535,'8&quot;x6&quot; photographic print','12.00');
paymentOptions[76536] = new paymentOption(76536,'10&quot;x8&quot; photographic print','16.00');
paymentOptions[76537] = new paymentOption(76537,'12&quot;x8&quot; photographic print','16.00');
paymentOptions[76538] = new paymentOption(76538,'12&quot;x10&quot; photographic print','20.00');
paymentOptions[76539] = new paymentOption(76539,'16&quot;x12&quot; photographic print','30.00');
paymentOptions[15793] = new paymentOption(15793,'7&quot;x 5&quot; print in presentation cardbourd mount','7.00');
paymentOptions[15794] = new paymentOption(15794,'7&quot;x 5&quot; unmounted print','4.50');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[23601] = new paymentGroup(23601,'Baby prints','76534,76535,76536,76537,76538,76539');
			paymentGroups[4731] = new paymentGroup(4731,'Event reprints','15793,15794');
			paymentGroups[2218] = new paymentGroup(2218,'Wedding reprints','76534,76535,76536,76537,76538,76539');
	/***************************************************************************
* 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;
}


