/* 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[26839] = new paymentOption(26839,'6&quot;x4&quot;','1.50');
paymentOptions[33350] = new paymentOption(33350,'7&quot;x5&quot;','3.00');
paymentOptions[33351] = new paymentOption(33351,'7.5&quot;x5&quot;','3.00');
paymentOptions[33352] = new paymentOption(33352,'8&quot;x6&quot;','4.50');
paymentOptions[33353] = new paymentOption(33353,'8&quot;x8&quot;','12.00');
paymentOptions[33354] = new paymentOption(33354,'A4','13.50');
paymentOptions[33355] = new paymentOption(33355,'9&quot;x6&quot;','4.50');
paymentOptions[33357] = new paymentOption(33357,'10&quot;x7&quot;','10.50');
paymentOptions[26840] = new paymentOption(26840,'10&quot;x8&quot;','12.00');
paymentOptions[33358] = new paymentOption(33358,'12&quot;x5&quot;','13.50');
paymentOptions[33359] = new paymentOption(33359,'12&quot;x8&quot;','13.50');
paymentOptions[33360] = new paymentOption(33360,'12&quot;x10&quot;','30.00');
paymentOptions[33361] = new paymentOption(33361,'15&quot;x5&quot;','10.50');
paymentOptions[33362] = new paymentOption(33362,'15&quot;x10&quot;','30.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','26839,33350,33351,33352,33353,33354,33355,33357,26840,33358,33359,33360,33361,33362');
/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


