/* 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[29496] = new paymentOption(29496,'8&quot; x 6&quot; ..... Unmounted','8.50');
paymentOptions[29497] = new paymentOption(29497,'8&quot; x 6&quot; ......... Mounted','10.00');
paymentOptions[29498] = new paymentOption(29498,'10&quot; x 8&quot; ... Unmounted','9.50');
paymentOptions[29499] = new paymentOption(29499,'10&quot; x 8&quot; ....... Mounted','12.00');
paymentOptions[29500] = new paymentOption(29500,'12&quot; x 5&quot; ... Unmounted','12.50');
paymentOptions[29501] = new paymentOption(29501,'12&quot; x 5&quot; ....... Mounted','15.50');
paymentOptions[29502] = new paymentOption(29502,'12&quot; x 8&quot; ... Unmounted','11.50');
paymentOptions[29503] = new paymentOption(29503,'12&quot; x 8&quot; ....... Mounted','13.00');
paymentOptions[29504] = new paymentOption(29504,'12&quot; x 10&quot; .. Unmounted','14.00');
paymentOptions[29505] = new paymentOption(29505,'12&quot; x 10&quot; ...... Mounted','20.00');
paymentOptions[29506] = new paymentOption(29506,'A4 ........... Unmounted','11.00');
paymentOptions[29507] = new paymentOption(29507,'A4 ............... Mounted','12.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[0] = new paymentGroup(0,'Default group','29496,29497,29498,29499,29500,29501,29502,29503,29504,29505,29506,29507');
/***************************************************************************
* 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;
}


