/* 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[52920] = new paymentOption(52920,'SMEI FRAMED A4 PRINT','80.00');
paymentOptions[7772] = new paymentOption(7772,'Canvas','345.00');
paymentOptions[52921] = new paymentOption(52921,'SMEI CANVAS (750mm x 500mm)','180.00');
paymentOptions[3568] = new paymentOption(3568,'electronic image (hi-res)','65.00');
paymentOptions[1530] = new paymentOption(1530,'6&quot; x 4&quot; PRINT  incl.p&p in the UK*','7.00');
paymentOptions[1531] = new paymentOption(1531,'7&quot; x 5&quot; PRINT*','9.00');
paymentOptions[1532] = new paymentOption(1532,'A4 PRINT*','20.00');
paymentOptions[1533] = new paymentOption(1533,'A4 PRINT (framed & mounted)*','49.00');
paymentOptions[1534] = new paymentOption(1534,'A3 PRINT*','45.00');
paymentOptions[1535] = new paymentOption(1535,'A3 PRINT (framed & mounted)*','90.00');
paymentOptions[1537] = new paymentOption(1537,'Canvas 300mm x 300mm*','120.00');
paymentOptions[1538] = new paymentOption(1538,'Canvas 600mm x 400mm*','165.00');
paymentOptions[1539] = new paymentOption(1539,'CANVAS 600mm x 600mm*','220.00');
paymentOptions[1540] = new paymentOption(1540,'Canvas 1000mm x 700mm*','275.00');
paymentOptions[11289] = new paymentOption(11289,'Deposit','150.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[16047] = new paymentGroup(16047,'SMEI CHARITY CALENDAR ','52920,52921');
			paymentGroups[3380] = new paymentGroup(3380,'Wedding deposit','11289');
	/***************************************************************************
* 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;
}


