/* 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[24908] = new paymentOption(24908,'Preview your image','1.95');
paymentOptions[12182] = new paymentOption(12182,'6x4   (A6)','6.99');
paymentOptions[26310] = new paymentOption(26310,'6x4 with folder','7.99');
paymentOptions[26309] = new paymentOption(26309,'7x5 with folder','8.99');
paymentOptions[44531] = new paymentOption(44531,'8x6','10.99');
paymentOptions[44532] = new paymentOption(44532,'8x6(with folder)','12.49');
paymentOptions[11700] = new paymentOption(11700,'10x8  ','12.99');
paymentOptions[26311] = new paymentOption(26311,'10x8(approx) your name/ club/ event/time','15.99');
paymentOptions[44530] = new paymentOption(44530,'12x8 (A4)','12.99');
paymentOptions[12183] = new paymentOption(12183,'11.7x16.6 (A3)','25.99');
paymentOptions[19635] = new paymentOption(19635,'E mailed file  (suitable for print at A3 size)','12.99');
paymentOptions[26312] = new paymentOption(26312,'CD file sent by post.','14.99');
paymentOptions[28077] = new paymentOption(28077,'Choose any 3 for 2','0.00');
paymentOptions[37068] = new paymentOption(37068,'Shhh Simply Gorgeous Weekday','255.00');
paymentOptions[28078] = new paymentOption(28078,'Laminated Finish - add to each','2.00');
paymentOptions[37069] = new paymentOption(37069,'Shhh Simply Gorgeous Weekend','275.00');
paymentOptions[37070] = new paymentOption(37070,'Shhh ... for him','195.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[3617] = new paymentGroup(3617,'Photo Prices','12182,26310,26309,44531,44532,11700,26311,44530,12183,19635,26312,28077,28078');
			paymentGroups[7585] = new paymentGroup(7585,'Preview','24908');
			paymentGroups[11469] = new paymentGroup(11469,'Shhh prices','37068,37069,37070');
	/***************************************************************************
* 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;
}


