/* 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[57382] = new paymentOption(57382,'POSTER PRINT. . . . . . . . . . . . .','25.00');
paymentOptions[66504] = new paymentOption(66504,'BLACK FRAMED PRINT . . . ','59.00');
paymentOptions[40720] = new paymentOption(40720,'TRYPTYCH (Standard) . . . . . . . ','135.00');
paymentOptions[40721] = new paymentOption(40721,'TRYPTYCH (Large). . . . . . . . . .','165.00');
paymentOptions[40722] = new paymentOption(40722,'TRYPTYCH (X Large) . . . . . . . . ','195.00');
paymentOptions[66505] = new paymentOption(66505,'DARK OAK FRAMED PRINT','59.00');
paymentOptions[40723] = new paymentOption(40723,'TRYPTYCH (XX Large) . . . . . . . ','225.00');
paymentOptions[74174] = new paymentOption(74174,'LIGHT PINE FRAMED PANORAMIC PRINT','59.00');
paymentOptions[66506] = new paymentOption(66506,'TEAK FRAMED PRINT. . . . . ','59.00');
paymentOptions[53284] = new paymentOption(53284,'MOUNTED PRINT (Small) . . . . . ','15.00');
paymentOptions[29674] = new paymentOption(29674,'MOUNTED PRINT (Standard) . . ','25.00');
paymentOptions[29675] = new paymentOption(29675,'MOUNTED PRINT (Large). . . . .','45.00');
paymentOptions[53287] = new paymentOption(53287,'CANVAS (Small). . . . . . . . . . . . ','30.00');
paymentOptions[29676] = new paymentOption(29676,'CANVAS (Standard). . . . . . . . .','45.00');
paymentOptions[29677] = new paymentOption(29677,'CANVAS (Large ) . . . . . . . . . . . ','69.00');
paymentOptions[53288] = new paymentOption(53288,'MOUNTED PRINT (Standard) . .','35.00');
paymentOptions[53289] = new paymentOption(53289,'CANVAS (Standard). . . . . . . . . ','35.00');
paymentOptions[53290] = new paymentOption(53290,'CANVAS (Large ) . . . . . . . . . . .','95.00');
paymentOptions[29678] = new paymentOption(29678,'PANORAMIC CANVAS (Large)','95.00');
paymentOptions[39366] = new paymentOption(39366,'NECKLACE. . . . . . . . . . . . . . . .','20.00');
paymentOptions[39367] = new paymentOption(39367,'BRACELET . . . . . . . . . . . . . . . . ','12.00');
paymentOptions[39401] = new paymentOption(39401,'SET . . . . . . . . . . . . . . . . . . . . . ','32.00');
paymentOptions[64962] = new paymentOption(64962,'40x30cm (16&quot;x12&quot;) . . . . . . . . .  \t','39.00');
paymentOptions[64961] = new paymentOption(64961,'45x35cm (18&quot;x14&quot;) . . . . . . . . .  \t','44.00');
paymentOptions[64960] = new paymentOption(64960,'50x35cm (20&quot;x14&quot;) . . . . . . . . .  ','49.00');
paymentOptions[53741] = new paymentOption(53741,'30x20cm (12&quot;x08&quot;) . . . . . . . . .','19.00');
paymentOptions[53742] = new paymentOption(53742,'35x25cm (14&quot;x10&quot;) . . . . . . . . .','24.00');
paymentOptions[53743] = new paymentOption(53743,'40x30cm (16&quot;x12&quot;) . . . . . . . . .','29.00');
paymentOptions[53744] = new paymentOption(53744,'45x35cm (18&quot;x14&quot;) . . . . . . . . .','34.00');
paymentOptions[53745] = new paymentOption(53745,'50x35cm (20&quot;x14&quot;) . . . . . . . . .  ','39.00');
paymentOptions[53746] = new paymentOption(53746,'60x40cm (24&quot;x16&quot;) . . . . . . . . .','44.00');
paymentOptions[53748] = new paymentOption(53748,'60x40cm (24&quot;x16&quot;) . . . . . . . . .  ','54.00');
paymentOptions[53749] = new paymentOption(53749,'65x40cm (26&quot;x16&quot;) . . . . . . . . .  ','59.00');
paymentOptions[53751] = new paymentOption(53751,'70x45cm (28&quot;x18&quot;) . . . . . . . . . ','69.00');
paymentOptions[53752] = new paymentOption(53752,'80x50cm (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[12154] = new paymentGroup(12154,'<BIG>JEWELLERY</BIG>','39366,39367,39401');
			paymentGroups[16128] = new paymentGroup(16128,'<BIG>PANORAMIC OPTIONS</BIG>','57382,53288,53289,53290');
			paymentGroups[9099] = new paymentGroup(9099,'<BIG>PRINT OPTIONS</BIG>','53284,29674,29675,53287,29676,29677');
			paymentGroups[12601] = new paymentGroup(12601,'<BIG>TRIPTYCH\'S</BIG>','40720,40721,40722,40723');
			paymentGroups[16290] = new paymentGroup(16290,'<big>YOUR PHOTOS ON CANVAS</big> <font color=#950049>(20mm DEEP FRAME)</font color=#950049>','53741,53742,53743,53744,53745,53746');
			paymentGroups[19799] = new paymentGroup(19799,'<big>YOUR PHOTOS ON CANVAS</big><font color=#950049> (40mm DEEP FRAME)</font color=#950049>','64962,64961,64960,53748,53749,53751,53752');
			paymentGroups[20407] = new paymentGroup(20407,'BLACK FRAMED PANORAMIC PRINT','66504');
			paymentGroups[20408] = new paymentGroup(20408,'DARK OAK FRAMED PANORAMIC PRINT','66505');
			paymentGroups[20397] = new paymentGroup(20397,'DAVID CARVEY PRINT OPTIONS','53284,29674,53287,29676');
			paymentGroups[22886] = new paymentGroup(22886,'LIGHT PINE FRAMED PANORAMIC PRINT','');
			paymentGroups[20409] = new paymentGroup(20409,'TEAK FRAMED PANORAMIC PRINT','66506');
	/***************************************************************************
* 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;
}


