/* 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[9073] = new paymentOption(9073,'6&quot; x 4&quot; aperture (10&quot; x 8&quot; external)','2.50');
paymentOptions[9074] = new paymentOption(9074,'7&quot; x 5&quot; aperture (10&quot; x 8&quot; external)','3.00');
paymentOptions[9075] = new paymentOption(9075,'8&quot; x 6&quot; aperture (10&quot; x 8&quot; external)','4.00');
paymentOptions[9076] = new paymentOption(9076,'10&quot; x 8&quot; aperture (16&quot; x 12&quot; approx external)','5.00');
paymentOptions[20219] = new paymentOption(20219,'10&quot; x 8&quot; aperture  Metallic (16&quot; x 12&quot; external)','5.50');
paymentOptions[20220] = new paymentOption(20220,'12&quot; x 8&quot; aperture (16&quot; x 12&quot; external)','5.50');
paymentOptions[20221] = new paymentOption(20221,'12&quot; x 8&quot; aperture Metallic (16&quot; x 12&quot; external)','6.00');
paymentOptions[12159] = new paymentOption(12159,'14&quot; x 10&quot; aperture (16&quot; x 12&quot; external)','8.50');
paymentOptions[20222] = new paymentOption(20222,'14&quot; x 10&quot; aperture Metallic (16&quot; x 12&quot; external)','9.50');
paymentOptions[20474] = new paymentOption(20474,'24&quot; x 18&quot; Un-Mounted Print','35.00');
paymentOptions[20475] = new paymentOption(20475,'24&quot; x 18&quot; Metallic Un-Mounted Print','40.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[3325] = new paymentGroup(3325,'Print Sales','9073,9074,9075,9076,20219,20220,20221,12159,20222,20474,20475');
	/***************************************************************************
* 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;
}


