/* 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[30120] = new paymentOption(30120,'7&quot; x 5&quot;','10.00');
paymentOptions[30121] = new paymentOption(30121,'10&quot; x 7&quot;','15.00');
paymentOptions[30122] = new paymentOption(30122,'12&quot; x 8&quot;','20.00');
paymentOptions[6430] = new paymentOption(6430,'7&quot;x5&quot;','10.00');
paymentOptions[28221] = new paymentOption(28221,'10&quot;x7&quot;','15.00');
paymentOptions[6431] = new paymentOption(6431,'12&quot;x8&quot;','20.00');
paymentOptions[6432] = new paymentOption(6432,'16&quot;x12&quot;','30.00');
paymentOptions[6428] = new paymentOption(6428,'8&quot;x8&quot;','15.00');
paymentOptions[29554] = new paymentOption(29554,'12&quot;x12&quot;','20.00');
paymentOptions[50862] = new paymentOption(50862,'18&quot; x 12&quot; canvas print','70.00');
paymentOptions[50863] = new paymentOption(50863,'24&quot; x 16&quot; canvas print','100.00');
paymentOptions[50864] = new paymentOption(50864,'36&quot; x 24&quot; canvas print','160.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[9237] = new paymentGroup(9237,'Events','30120,30121,30122,50862,50863,50864');
			paymentGroups[10445] = new paymentGroup(10445,'Events 2','6430,28221,6431,50862,50863,50864');
			paymentGroups[1862] = new paymentGroup(1862,'Square format prints','6428,29554');
			paymentGroups[1861] = new paymentGroup(1861,'Standard format prints','6430,28221,6431,6432,50862,50863,50864');
			paymentGroups[8676] = new paymentGroup(8676,'Wedding Prints','6430,28221,6431,6432,6428,29554,50862,50863,50864');
	/***************************************************************************
* 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;
}


