/* 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[33904] = new paymentOption(33904,'12&quot; x 8&quot; Photo Print Mounted','18.00');
paymentOptions[33905] = new paymentOption(33905,'12&quot; x 18&quot; Photo Print Mounted','28.50');
paymentOptions[70513] = new paymentOption(70513,'German Etching 18&quot;x8&quot;','28.00');
paymentOptions[70514] = new paymentOption(70514,'German Etching  18&quot;x 8&quot; mounted','31.00');
paymentOptions[70515] = new paymentOption(70515,'German Etching 18&quot;x12&quot;','41.50');
paymentOptions[70516] = new paymentOption(70516,'German Etching 18&quot;x12&quot; mounted','46.50');
paymentOptions[70518] = new paymentOption(70518,'Canvas 27&quot;x18&quot; inc P&P','120.00');
paymentOptions[70524] = new paymentOption(70524,'Tryptich 3 panels 15&quot;x 30&quot; inc P&P','280.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[0] = new paymentGroup(0,'Default group','33904,33905,70513,70514,70515,70516,70518,70524');
/***************************************************************************
* 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;
}


