/* 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[8065] = new paymentOption(8065,'9x8&quot; Cibachrome Limited Edition','30.00');
paymentOptions[7989] = new paymentOption(7989,'10x8&quot; Cibachrome Limited Edition','30.00');
paymentOptions[7988] = new paymentOption(7988,'12x8&quot; Cibachrome Limited Edition','35.00');
paymentOptions[9833] = new paymentOption(9833,'12x8&quot; Limited Edition Digital Print','35.00');
paymentOptions[7987] = new paymentOption(7987,'15x10&quot; Cibachrome Limited Edition','40.00');
paymentOptions[9834] = new paymentOption(9834,'15x10&quot; Limited Edition Digital Print','40.00');
paymentOptions[8137] = new paymentOption(8137,'12x8&quot; Canvas Limited Edition','100.00');
paymentOptions[8518] = new paymentOption(8518,'9x8&quot; Standard Print (Matt)','12.00');
paymentOptions[8064] = new paymentOption(8064,'9x8&quot; Standard Print (Gloss)','12.00');
paymentOptions[8519] = new paymentOption(8519,'10x8&quot; Standard Print (Matt)','10.00');
paymentOptions[7990] = new paymentOption(7990,'10x8&quot; Standard Print (Gloss)','10.00');
paymentOptions[8520] = new paymentOption(8520,'12x8&quot; Standard Print (Matt)','12.00');
paymentOptions[7991] = new paymentOption(7991,'12x8&quot; Standard Print (Gloss)','12.00');
paymentOptions[8521] = new paymentOption(8521,'15x10&quot; Standard Print (Matt)','15.00');
paymentOptions[7992] = new paymentOption(7992,'15x10&quot; Standard Print (Gloss)','15.00');
paymentOptions[12937] = new paymentOption(12937,'12x8&quot; Standard Canvas','60.00');
paymentOptions[8523] = new paymentOption(8523,'12x6&quot; Standard Print (Matt)','12.00');
paymentOptions[7993] = new paymentOption(7993,'12x6&quot; Standard Print (Gloss)','12.00');
paymentOptions[9835] = new paymentOption(9835,'12x6&quot; Limited Edition Digital Print','35.00');
paymentOptions[8524] = new paymentOption(8524,'15x7.5&quot; Standard Print (Matt)','15.00');
paymentOptions[7994] = new paymentOption(7994,'15x7.5&quot; Standard Print (Gloss)','15.00');
paymentOptions[9836] = new paymentOption(9836,'15x7.5&quot; Limited Edition Digital Print','40.00');
paymentOptions[24022] = new paymentOption(24022,'8x8&quot; Standard Print (Matt)','9.00');
paymentOptions[24021] = new paymentOption(24021,'8x8&quot; Standard Print (Gloss)','9.00');
paymentOptions[24023] = new paymentOption(24023,'10x10&quot; Standard Print (Matt) ','13.00');
paymentOptions[24024] = new paymentOption(24024,'10x10&quot; Standard Print (Gloss)','13.00');
paymentOptions[24025] = new paymentOption(24025,'16x16&quot; Standard Print (Matt)','25.00');
paymentOptions[24026] = new paymentOption(24026,'16x16&quot; Standard Print (Gloss)','25.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[2946] = new paymentGroup(2946,'Digital Limited Edition (2:1 crop)','9835,9836');
			paymentGroups[2945] = new paymentGroup(2945,'Digital Limited Edition (full frame)','9833,9834,8137');
			paymentGroups[2367] = new paymentGroup(2367,'Film Limited Edition (full frame)','7988,7987,8137');
			paymentGroups[2366] = new paymentGroup(2366,'Limited Edition (10x8&quot;)','7989');
			paymentGroups[2413] = new paymentGroup(2413,'Limited Edition (9x8&quot;)','8065');
			paymentGroups[2370] = new paymentGroup(2370,'Standard Print - 10x8&quot;','8519,7990');
			paymentGroups[2490] = new paymentGroup(2490,'Standard Print - 9x8&quot;','8518,8064');
			paymentGroups[2369] = new paymentGroup(2369,'Standard Print - Full Frame','8520,7991,8521,7992,12937');
			paymentGroups[2371] = new paymentGroup(2371,'Standard Print - Panorama','8523,7993,8524,7994');
			paymentGroups[7245] = new paymentGroup(7245,'Standard print - Square','24022,24021,24023,24024,24025,24026');
	/***************************************************************************
* 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;
}


