/* 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[60228] = new paymentOption(60228,'16&quot; x 12&quot; framed print','75.00');
paymentOptions[58217] = new paymentOption(58217,'Prices starting from','3.00');
paymentOptions[59856] = new paymentOption(59856,'Web image (900x600 px)','3.00');
paymentOptions[57397] = new paymentOption(57397,'6&quot; x 4&quot; PRINT ','4.00');
paymentOptions[59857] = new paymentOption(59857,'8&quot;x6&quot; with mount','6.00');
paymentOptions[54362] = new paymentOption(54362,'13&quot;x9&quot; PRINT','15.00');
paymentOptions[56254] = new paymentOption(56254,'13&quot;x9&quot; FRAMED PRINT (£10 cashback if collected)','40.00');
paymentOptions[41518] = new paymentOption(41518,'16&quot;x 12&quot; PRINT','25.00');
paymentOptions[56256] = new paymentOption(56256,'16&quot;X 12&quot; FRAMED PRINT (£10 cashback if collected)','50.00');
paymentOptions[58590] = new paymentOption(58590,'Prices Start from £15 based on content. Please contact me for details','0.00');
paymentOptions[57595] = new paymentOption(57595,'Package 1','40.00');
paymentOptions[57596] = new paymentOption(57596,'Package 2','65.00');
paymentOptions[57597] = new paymentOption(57597,'Package 3','80.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[18030] = new paymentGroup(18030,'Collage Prints ','58590');
			paymentGroups[12801] = new paymentGroup(12801,'EVENT PRICES','58217,59856,57397,59857,54362,56254,41518,56256');
			paymentGroups[18521] = new paymentGroup(18521,'Limited Editions','60228');
			paymentGroups[17213] = new paymentGroup(17213,'PRIVATE BOOKINGS','57595,57596,57597');
	/***************************************************************************
* 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;
}


