/* 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[56368] = new paymentOption(56368,'8&quot;x12&quot; Print','20.00');
paymentOptions[56369] = new paymentOption(56369,'12&quot;x16&quot; Print','35.00');
paymentOptions[56367] = new paymentOption(56367,'8&quot;x12&quot; Canvas (A4)','45.00');
paymentOptions[54345] = new paymentOption(54345,'12&quot;x16&quot; Canvas (A3)','55.00');
paymentOptions[31688] = new paymentOption(31688,'16&quot;x24&quot; Canvas (A2)','70.00');
paymentOptions[68662] = new paymentOption(68662,'Izzie+Rhys 1p','0.01');
paymentOptions[54429] = new paymentOption(54429,'8&quot;x12&quot; Limited Edition Print (A4)','30.00');
paymentOptions[54430] = new paymentOption(54430,'12&quot;x16&quot; Limited Edition Print (A3)','50.00');
paymentOptions[54431] = new paymentOption(54431,'16&quot;x24&quot; Limited Edition Print (A2)','80.00');
paymentOptions[54432] = new paymentOption(54432,'12&quot;x16&quot; Limited Edition Canvas (A3)','70.00');
paymentOptions[54433] = new paymentOption(54433,'16&quot;x24&quot; Limited Edition Canvas (A2)','110.00');
paymentOptions[54434] = new paymentOption(54434,'24&quot;x32&quot; Limited Edition Canvas (A1)','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[21162] = new paymentGroup(21162,'Izzie+Rhys','68662');
			paymentGroups[16511] = new paymentGroup(16511,'Limited Edition','54429,54430,54431,54432,54433,54434');
			paymentGroups[17219] = new paymentGroup(17219,'Non-Limited Edition','56368,56369,56367,54345,31688');
			paymentGroups[9804] = new paymentGroup(9804,'Photoshoot','56367,54345,31688');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - 				&pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


