/* 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[48121] = new paymentOption(48121,'Complimentary Print ','0.00');
paymentOptions[48122] = new paymentOption(48122,'6&quot;x4&quot; Print ','2.50');
paymentOptions[48123] = new paymentOption(48123,'7&quot;x5&quot; Print','5.00');
paymentOptions[48124] = new paymentOption(48124,'8&quot;x6&quot; Print','7.50');
paymentOptions[48125] = new paymentOption(48125,'10&quot;x8&quot; ','12.50');
paymentOptions[48126] = new paymentOption(48126,'12&quot;x8&quot; Print','15.00');
paymentOptions[48127] = new paymentOption(48127,'12&quot;x10&quot; Print','20.00');
paymentOptions[48128] = new paymentOption(48128,'15&quot;x10&quot; Print','25.00');
paymentOptions[53101] = new paymentOption(53101,'6&quot; x 4&quot; Print','4.00');
paymentOptions[53102] = new paymentOption(53102,'7.5&quot; x 5&quot; Print','8.00');
paymentOptions[53103] = new paymentOption(53103,'9&quot; x 6&quot; Print','12.00');
paymentOptions[53104] = new paymentOption(53104,'12&quot; x 8&quot; Print','20.00');
paymentOptions[53105] = new paymentOption(53105,'15&quot; x 10&quot; Print','30.00');
paymentOptions[53106] = new paymentOption(53106,'8&quot; x 12&quot; Print','35.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[16089] = new paymentGroup(16089,'Event No fee','53101,53102,53103,53104,53105,53106');
			paymentGroups[14834] = new paymentGroup(14834,'Event Standard','48122,48123,48124,48125,48126,48127,48128');
			paymentGroups[14642] = new paymentGroup(14642,'Event Standard inc Comp Print Size','48121,48122,48123,48124,48125,48126,48127,48128');
	/***************************************************************************
* 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;
}


