/* 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[72514] = new paymentOption(72514,'Theatre Royal. Framed','250.00');
paymentOptions[71803] = new paymentOption(71803,'20&quot;x16&quot; Mounted Ltd Edition (Collection)','45.00');
paymentOptions[71802] = new paymentOption(71802,'20&quot;x16&quot; Framed Ltd Edition (Collection)','70.00');
paymentOptions[71801] = new paymentOption(71801,'20&quot;x16&quot; Mounted Ltd Edition inc delivery (UK Mainland)','49.95');
paymentOptions[71800] = new paymentOption(71800,'20&quot;x16&quot; Framed Ltd Edition inc Delivery (UK mainland)','79.95');
paymentOptions[76060] = new paymentOption(76060,'Size 1','10.00');
paymentOptions[76061] = new paymentOption(76061,'Size 2','25.00');
paymentOptions[76062] = new paymentOption(76062,'Size 3','35.00');
paymentOptions[76063] = new paymentOption(76063,'Size 4','35.00');
paymentOptions[71813] = new paymentOption(71813,'10&quot;x8&quot; Mounted - Collection','10.00');
paymentOptions[71812] = new paymentOption(71812,'10&quot;x8&quot; Mounted inc delivery (UK Mainland)','12.95');
paymentOptions[71811] = new paymentOption(71811,'16&quot;x12&quot; Mounted - Collection','20.00');
paymentOptions[71810] = new paymentOption(71810,'16&quot;x12&quot; Framed - Collection','40.00');
paymentOptions[71809] = new paymentOption(71809,'16&quot;x12&quot; Mounted inc delivery (UK Mainland)','24.95');
paymentOptions[71808] = new paymentOption(71808,'16&quot;x12&quot; Framed inc delivery (UK Mainland)','49.95');
paymentOptions[71807] = new paymentOption(71807,'20&quot;x16&quot; Mounted - Collection','35.00');
paymentOptions[71806] = new paymentOption(71806,'20&quot;x16&quot; Framed - Collection','60.00');
paymentOptions[71805] = new paymentOption(71805,'20&quot;x16&quot; Mounted inc delivery (UK Mainland)','39.95');
paymentOptions[71804] = new paymentOption(71804,'20&quot;x16&quot; Framed inc delivery (UK Mainland)','69.95');
paymentOptions[71817] = new paymentOption(71817,'22&quot;x10&quot; Mounted - Collection','35.00');
paymentOptions[71816] = new paymentOption(71816,'22&quot;x10&quot; Framed - Collection','60.00');
paymentOptions[71815] = new paymentOption(71815,'22&quot;x10&quot; Mounted inc delivery (UK Mainland)','44.95');
paymentOptions[71814] = new paymentOption(71814,'22&quot;x10&quot; Framed inc delivery (UK Mainland)','69.95');
paymentOptions[71821] = new paymentOption(71821,'22&quot;x10&quot; Mounted Ltd Edition - Collection','45.00');
paymentOptions[71820] = new paymentOption(71820,'22&quot;x10&quot; Framed Ltd Edition - Collection','70.00');
paymentOptions[71819] = new paymentOption(71819,'22&quot;x10&quot; Mounted Ltd Edition inc delivery (UK Mainland)','49.95');
paymentOptions[71818] = new paymentOption(71818,'22&quot;x10&quot; Framed Ltd Edition in delivery (UK Mainland)','79.95');
paymentOptions[72655] = new paymentOption(72655,'16&quot;x12&quot; Framed Limited Edition inc Delivery','54.95');
paymentOptions[72656] = new paymentOption(72656,'16&quot;x12&quot; Unframed limited edition in delivery','39.95');
paymentOptions[72657] = new paymentOption(72657,'16&quot;x12&quot; framed limited edition - Collection','45.00');
paymentOptions[72658] = new paymentOption(72658,'16&quot;x12&quot;  Unframed limited edition - Collection','35.00');
paymentOptions[72695] = new paymentOption(72695,'Tynemouth Pool - set of 3 framed inc delivery','165.00');
paymentOptions[72696] = new paymentOption(72696,'Tynemouth Pool Set of 3 - Unframed inc delivery ','95.00');
paymentOptions[72697] = new paymentOption(72697,'Tynemouth Pool Framed set of 3 - Collection','150.00');
paymentOptions[72698] = new paymentOption(72698,'Tynemouth Pool Unframed set of 3 - Collection','85.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[22443] = new paymentGroup(22443,'16x12 LE','72655,72656,72657,72658');
			paymentGroups[22165] = new paymentGroup(22165,'limited edition Pano','71821,71820,71819,71818');
			paymentGroups[22161] = new paymentGroup(22161,'Limited Edition Prints','71803,71802,71801,71800');
			paymentGroups[22164] = new paymentGroup(22164,'Open Edition Pano','71817,71816,71815,71814');
			paymentGroups[22162] = new paymentGroup(22162,'Open Edition Prints','71813,71812,71811,71810,71809,71808,71807,71806,71805,71804');
			paymentGroups[23463] = new paymentGroup(23463,'OPEN EDITION V2','76060,76061,76062,76063');
			paymentGroups[22388] = new paymentGroup(22388,'Specials','72514');
			paymentGroups[22461] = new paymentGroup(22461,'Tynemouth Pool','72695,72696,72697,72698');
	/***************************************************************************
* 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;
}


