/* 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[78388] = new paymentOption(78388,'Event Print -Image printed on A4 with lustre finish','19.95');
paymentOptions[9340] = new paymentOption(9340,'Fine Art  print on 30cm x 20cm archival paper','45.00');
paymentOptions[9341] = new paymentOption(9341,'Fine Art Ltd Edition print on 30cm x 20cm archival paper','55.00');
paymentOptions[9342] = new paymentOption(9342,'Fine Art  print on 42cm x 30cm archival paper','65.00');
paymentOptions[9343] = new paymentOption(9343,'Fine Art Ltd Edition print on 42cm x 30cm archival paper','75.00');
paymentOptions[17990] = new paymentOption(17990,'Pack of Eight assorted greetings cards (Price includes £2 P&P)','12.00');
paymentOptions[65218] = new paymentOption(65218,'Motivational Poster for Business','59.00');
paymentOptions[61818] = new paymentOption(61818,'Pack of 8 selected greeting cards','16.90');
paymentOptions[54682] = new paymentOption(54682,'Print size approximately 42cm x 42cm','65.00');
paymentOptions[64186] = new paymentOption(64186,'Fine Art  print on 59cm x 42cm archival paper','85.00');
paymentOptions[64184] = new paymentOption(64184,'Fine Art Ltd Edition print on 59cm x 42cm archival paper','99.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[24192] = new paymentGroup(24192,'Event Print','78388,9342,64186');
			paymentGroups[5438] = new paymentGroup(5438,'Greeting Cards','17990,61818');
			paymentGroups[2784] = new paymentGroup(2784,'Limited Edition Print','9341,9343,64184');
			paymentGroups[19912] = new paymentGroup(19912,'Motivational Poster for Business','65218');
			paymentGroups[2785] = new paymentGroup(2785,'Open Print','78388,9340,9342,64186');
			paymentGroups[7084] = new paymentGroup(7084,'Panoramic','9341,9343,64184');
			paymentGroups[14650] = new paymentGroup(14650,'Sorry Not for Sale - Enquire by email','');
			paymentGroups[16588] = new paymentGroup(16588,'Square','54682');
			paymentGroups[18915] = new paymentGroup(18915,'Square greeting cards','61818');
	/***************************************************************************
* 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;
}


