/* 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[8830] = new paymentOption(8830,'Print, 39.8 cm x 29.1 cm A3, incl P&P GB only ','40.00');
paymentOptions[8832] = new paymentOption(8832,'Print, 30.1 cm x 39.8 cm A3, incl P&P GB only','40.00');
paymentOptions[8842] = new paymentOption(8842,'Print, 81.4cm x 30.0cm,  incl, P&P, GB only ','70.00');
paymentOptions[8844] = new paymentOption(8844,'Mounted Print, 50.8cm x 40.6 cm, incl  P&P GB only ','50.00');
paymentOptions[8845] = new paymentOption(8845,'Mounted Print 40.6 cm x 50.8 cm, incl P&P, GB only','50.00');
paymentOptions[8846] = new paymentOption(8846,'Mounted Print  95.2cm x 45.1cm, incl  P&P, GB only.','90.00');
paymentOptions[8847] = new paymentOption(8847,'Framed Print  50.8 cm x 40.6 cm, incl  P&P,GB only ','85.00');
paymentOptions[8848] = new paymentOption(8848,'Framed Print, 40.6 cm x 50.8 cm, incl P&P GB only ','85.00');
paymentOptions[8849] = new paymentOption(8849,'Framed Print  95.2cm x 45.1cm, incl P&P, GB only','148.00');
paymentOptions[8988] = new paymentOption(8988,'Print, 37.1 cm x 30.0 cm incl  P&P GB only  ','35.00');
paymentOptions[8998] = new paymentOption(8998,'Mounted Print 51.1 cm x 45.1 cm, incl P&P GB only  ','45.00');
paymentOptions[8999] = new paymentOption(8999,'Framed Print  51.1cm x 45.1cm, incl P&P GB only  ','70.00');
paymentOptions[9001] = new paymentOption(9001,'Print  57.9 cm x 30.0 cm, incl  P&P GB only  ','62.00');
paymentOptions[9002] = new paymentOption(9002,'Mounted Print 71.9 cm x 45.1 cm incl  P&P GB only  ','72.00');
paymentOptions[9003] = new paymentOption(9003,'Framed Print  71.9 cm x 45.1 cm incl  P&P GB only  ','100.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[2602] = new paymentGroup(2602,'1:<STRONG><font color=&quot;ffcc62&quot;>Landscape Format</STRONG></font> ','8830,8844,8847');
			paymentGroups[2603] = new paymentGroup(2603,'2:<b><font color=&quot;ffcc62&quot;>Portrait Format</b></font>','8832,8845,8848');
			paymentGroups[2613] = new paymentGroup(2613,'3:<b><font color=&quot;ffcc62&quot;>Panoramic Format</b></font> ','8842,8846,8849');
			paymentGroups[2655] = new paymentGroup(2655,'4:<b><font color=&quot;ffcc62&quot;> Special Size Panoramic Images</b></font>','9001,9002,9003');
			paymentGroups[2654] = new paymentGroup(2654,'5:<b><font color=&quot;ffcc62&quot;>Special Size Images</b></font>','8988,8998,8999');
	/***************************************************************************
* 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;
}


