/* 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[21894] = new paymentOption(21894,'12&quot;x8&quot; matt print','17.50');
paymentOptions[22056] = new paymentOption(22056,'12&quot;x8&quot; gloss print','17.50');
paymentOptions[21895] = new paymentOption(21895,'16&quot;x20&quot; matt print','24.50');
paymentOptions[22057] = new paymentOption(22057,'16&quot;x20&quot; gloss print','24.50');
paymentOptions[22222] = new paymentOption(22222,'8&quot;x14&quot; matt print','17.50');
paymentOptions[22223] = new paymentOption(22223,'8&quot;x14&quot; gloss print','17.50');
paymentOptions[22224] = new paymentOption(22224,'22&quot;x12&quot; matt print','24.50');
paymentOptions[22225] = new paymentOption(22225,'22&quot;x12&quot; gloss print','24.50');
paymentOptions[22226] = new paymentOption(22226,'7&quot;x14&quot; matt print','17.50');
paymentOptions[22227] = new paymentOption(22227,'7&quot;x14&quot; gloss print','17.50');
paymentOptions[22889] = new paymentOption(22889,'22&quot;x11&quot; matt print','24.50');
paymentOptions[22890] = new paymentOption(22890,'22&quot;x11&quot; gloss print','24.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[6582] = new paymentGroup(6582,'1','21894,22056,21895,22057');
			paymentGroups[6699] = new paymentGroup(6699,'2','22222,22223,22224,22225');
			paymentGroups[6700] = new paymentGroup(6700,'3','22226,22227,22889,22890');
	/***************************************************************************
* 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;
}


