/* 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[56178] = new paymentOption(56178,'12 x 8&quot; photo, mounted, titled and signed, limited edition, UK p&p free','35.00');
paymentOptions[71691] = new paymentOption(71691,'12 x 8&quot; photo, mounted, titled and signed,open edition, UK p&p free','31.50');
paymentOptions[56177] = new paymentOption(56177,'Hand finished photo greetings card, UK p&p free','3.00');
paymentOptions[56310] = new paymentOption(56310,'6 x 4 ins (15 x10 cm) mounted titled and signed photo, UK p&p free','10.00');
paymentOptions[71195] = new paymentOption(71195,'12 x 8 inch photo only, limited edition, with certificate, free UK p&p','25.00');
paymentOptions[71692] = new paymentOption(71692,'12 x 8 inch photo only, open edition, with profile free uk p&p','22.50');
paymentOptions[71694] = new paymentOption(71694,'18 x 12 inch photo only,open edition, with profile uk p&p free','54.00');
paymentOptions[71722] = new paymentOption(71722,'18 x 12 inch photo only,limited edition, with certificate, Uk p&p free','60.00');
paymentOptions[71723] = new paymentOption(71723,'24 x 16 inch photo only, limited edition, with certificate, free UK p&p','75.00');
paymentOptions[71726] = new paymentOption(71726,'24 x 16 inch photo only, open edition, with profile, free UK p&p','67.50');
paymentOptions[71724] = new paymentOption(71724,'20 x 30 inch photo only, open edition, with profile, free UK p&p','99.00');
paymentOptions[71725] = new paymentOption(71725,'20 x 30 inch photo only, limited edition, with certificate, free UK p&p','110.00');
paymentOptions[71693] = new paymentOption(71693,'18 x 12 inch canvas, open edition, with profile','94.50');
paymentOptions[71197] = new paymentOption(71197,'18 x 12 inch canvas, limited edition, with certificate, free UK p&p','105.00');
paymentOptions[71200] = new paymentOption(71200,'24 x 16 inch canvas, limited edition, with certificate, free UK p&p','125.00');
paymentOptions[71695] = new paymentOption(71695,'24 x 16 inch canvas, open edition, with profile, free UK p&p','112.50');
paymentOptions[71696] = new paymentOption(71696,'20 x 30 inch canvas, open edition, with profile, free UK p&p','175.50');
paymentOptions[71201] = new paymentOption(71201,'20 x 30 inch canvas, limited edition, with certificate, free UK p&p','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[17153] = new paymentGroup(17153,'Limited edition Photographs max 125 prints above 6x 4 inches','56178,56177,56310,71195,71722,71723,71725,71197,71200,71201');
			paymentGroups[22141] = new paymentGroup(22141,'Open edition photos','71691,56177,56310,71692,71694,71726,71724,71693,71695,71696');
	/***************************************************************************
* 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;
}


