/* 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[48822] = new paymentOption(48822,'A4 print','10.00');
paymentOptions[58272] = new paymentOption(58272,'Greeting card','1.60');
paymentOptions[48823] = new paymentOption(48823,'A3','14.00');
paymentOptions[48896] = new paymentOption(48896,'18&quot; x 12&quot;','16.00');
paymentOptions[54043] = new paymentOption(54043,'A3+','18.00');
paymentOptions[54044] = new paymentOption(54044,'16&quot; x 24&quot;','28.00');
paymentOptions[54045] = new paymentOption(54045,'20&quot; x 30&quot;','36.00');
paymentOptions[54047] = new paymentOption(54047,'wide / panoramic 13&quot; high x 22&quot; wide','35.00');
paymentOptions[54048] = new paymentOption(54048,'wide / panoramic 13&quot;high X 24&quot; wide','36.00');
paymentOptions[54049] = new paymentOption(54049,'wide / panoramic 13&quot; high x 26&quot; wide','37.00');
paymentOptions[54050] = new paymentOption(54050,'wide / panoramic 13&quot; high x 28&quot; wide','38.00');
paymentOptions[54051] = new paymentOption(54051,'wide / panoramic 13&quot; high x 30&quot; wide ','39.00');
paymentOptions[54052] = new paymentOption(54052,'wide / panoramic 13&quot; high x 32&quot; wide','40.00');
paymentOptions[54053] = new paymentOption(54053,'wide / panoramic 13&quot;high x 34&quot; wide','41.00');
paymentOptions[54054] = new paymentOption(54054,'wide / panoramic 13&quot; high x 36&quot; wide','42.00');
paymentOptions[54055] = new paymentOption(54055,'wide / panoramic 13&quot;high x 38&quot; wide','43.00');
paymentOptions[54056] = new paymentOption(54056,'wide / panoramic 13&quot;high X 40&quot;wide','44.00');
paymentOptions[78839] = new paymentOption(78839,'postage & packing ','1.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[17927] = new paymentGroup(17927,'Greeting cards','58272,78839');
			paymentGroups[24310] = new paymentGroup(24310,'Postage & Packing','58272,78839');
			paymentGroups[14865] = new paymentGroup(14865,'print prices','48822,48823,48896,54043,54044,54045,54047,54048,54049,54050,54051,54052,54053,54054,54055,54056,78839');
	/***************************************************************************
* 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;
}


