/* 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[34512] = new paymentOption(34512,'10x15cm Postcard','6.00');
paymentOptions[34511] = new paymentOption(34511,'A4 Print 20 x 30cm','15.00');
paymentOptions[34510] = new paymentOption(34510,'A3 Print 30 x 42cm','57.00');
paymentOptions[39782] = new paymentOption(39782,'A2 Print 40 x 60cm','125.00');
paymentOptions[34513] = new paymentOption(34513,'A3 Print','100.00');
paymentOptions[44829] = new paymentOption(44829,'10x15cm Print','5.00');
paymentOptions[44830] = new paymentOption(44830,'A4 Print (20x30cm)','10.00');
paymentOptions[44831] = new paymentOption(44831,'A3 Print','25.00');
paymentOptions[44832] = new paymentOption(44832,'A2 Print','35.00');
paymentOptions[44833] = new paymentOption(44833,'West Member - 1 Image for £1 - Each image is','1.00');
paymentOptions[81503] = new paymentOption(81503,'West Member - 3 Images for £2 - Each Image is ','0.66');
paymentOptions[81504] = new paymentOption(81504,'West Member - 6 images for £3 - Each Image is','0.50');
paymentOptions[81505] = new paymentOption(81505,'West Member - 10 Images for £4 - Each image is','0.40');
paymentOptions[81502] = new paymentOption(81502,'Non West Member - Each Single Digital File is','3.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[9238] = new paymentGroup(9238,'Premium','34513');
			paymentGroups[12302] = new paymentGroup(12302,'Standard Print Cost','34512,34511,34510,39782');
			paymentGroups[25227] = new paymentGroup(25227,'West','44833,81503,81504,81505,81502');
	/***************************************************************************
* 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;
}


