/* 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[56052] = new paymentOption(56052,'30x20cm (12&quot;x08&quot;) . . . . . . . . .  \t','19.00');
paymentOptions[30883] = new paymentOption(30883,'MOUNTED PRINT . . . . . . ','25.00');
paymentOptions[56063] = new paymentOption(56063,'TRYPTYCH (Standard) . . . . . . .','145.00');
paymentOptions[56064] = new paymentOption(56064,'TRYPTYCH (Large). . . . . . . . . .','175.00');
paymentOptions[30884] = new paymentOption(30884,'MOUNTED PRINT (Large)','50.00');
paymentOptions[56053] = new paymentOption(56053,'35x25cm (14&quot;x10&quot;) . . . . . . . . .','24.00');
paymentOptions[56054] = new paymentOption(56054,'40x30cm (16&quot;x12&quot;) . . . . . . . . .','29.00');
paymentOptions[30885] = new paymentOption(30885,'CANVAS. . . . . . . . . . . . . .  ','40.00');
paymentOptions[56065] = new paymentOption(56065,'TRYPTYCH (X Large) . . . . . . . .  \t','205.00');
paymentOptions[56066] = new paymentOption(56066,'TRYPTYCH (XX Large) . . . . . . .  \t','245.00');
paymentOptions[30886] = new paymentOption(30886,'CANVAS (Large ) . . . . . . .  ','69.00');
paymentOptions[56055] = new paymentOption(56055,'45x35cm (18&quot;x14&quot;) . . . . . . . . .  \t','34.00');
paymentOptions[56056] = new paymentOption(56056,'50x35cm (20&quot;x14&quot;) . . . . . . . . .','39.00');
paymentOptions[56057] = new paymentOption(56057,'60x40cm (24&quot;x16&quot;) . . . . . . . . .','44.00');
paymentOptions[56058] = new paymentOption(56058,'60x40cm (24&quot;x16&quot;) . . . . . . . . .','54.00');
paymentOptions[56059] = new paymentOption(56059,'65x40cm (26&quot;x16&quot;) . . . . . . . . .','59.00');
paymentOptions[56060] = new paymentOption(56060,'70x40cm (28&quot;x16&quot;) . . . . . . . . .  \t','64.00');
paymentOptions[56061] = new paymentOption(56061,'70x45cm (28&quot;x18&quot;) . . . . . . . . . ','69.00');
paymentOptions[56062] = new paymentOption(56062,'70x45cm (32&quot;x20&quot;) . . . . . . . . .','79.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[9497] = new paymentGroup(9497,'PRINT OPTIONS','30883,30884,30885,30886');
			paymentGroups[17108] = new paymentGroup(17108,'TRIPTYCH\'S','56063,56064,56065,56066');
			paymentGroups[17107] = new paymentGroup(17107,'YOUR PHOTOS ON CANVAS','56052,56053,56054,56055,56056,56057,56058,56059,56060,56061,56062');
	/***************************************************************************
* 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;
}


