/* 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[45752] = new paymentOption(45752,'5&quot; x 7&quot; semi gloss ','7.00');
paymentOptions[45753] = new paymentOption(45753,'8&quot;x10&quot; semi gloss ','10.00');
paymentOptions[32135] = new paymentOption(32135,'6&quot;x4&quot;','7.00');
paymentOptions[69107] = new paymentOption(69107,'7x5&quot; Semi Gloss','7.00');
paymentOptions[583] = new paymentOption(583,'5&quot;x7&quot;  ','11.50');
paymentOptions[76897] = new paymentOption(76897,'Image on Cd (price per image)','1.00');
paymentOptions[52081] = new paymentOption(52081,'5x7&quot; semi gloss paper','7.00');
paymentOptions[73821] = new paymentOption(73821,'5X7&quot; print unmounted','7.00');
paymentOptions[47542] = new paymentOption(47542,'5x7&quot; unmounted print','6.50');
paymentOptions[47543] = new paymentOption(47543,'8x10&quot; unmounted print','7.50');
paymentOptions[55548] = new paymentOption(55548,'On-off-payment','11.50');
paymentOptions[73822] = new paymentOption(73822,'Image on Cd (price per image)','5.00');
paymentOptions[52082] = new paymentOption(52082,'8x10&quot; semi gloss paper','10.00');
paymentOptions[584] = new paymentOption(584,'8&quot;x10&quot;','26.70');
paymentOptions[585] = new paymentOption(585,'12&quot;x10&quot;','37.60');
paymentOptions[34352] = new paymentOption(34352,'6x8 Peter And Roshni','7.00');
paymentOptions[34462] = new paymentOption(34462,'10x8 Peter And Roshni','10.00');
paymentOptions[69108] = new paymentOption(69108,'8x10&quot; Semi Gloss','10.00');
paymentOptions[75491] = new paymentOption(75491,'A2 Semi Gloss','25.00');
paymentOptions[69106] = new paymentOption(69106,'CD of Images','10.00');
paymentOptions[586] = new paymentOption(586,'5&quot; x 7&quot; Unmounted price to parents','2.50');
paymentOptions[620] = new paymentOption(620,'8x10 unmounted price to parents','5.00');
paymentOptions[589] = new paymentOption(589,'300dpi files delivered via email - price to cover searching and resizing ','1.00');
paymentOptions[74599] = new paymentOption(74599,'A3 Semi Gloss Poster','20.00');
paymentOptions[74600] = new paymentOption(74600,'Montage of up to 5 images','25.00');
paymentOptions[17980] = new paymentOption(17980,'Standard Payment','5.00');
paymentOptions[23878] = new paymentOption(23878,'Portrait 8x10&quot; semi gloss finish','10.00');
paymentOptions[23879] = new paymentOption(23879,'Portrait 7x5&quot; semi gloss finish','7.00');
paymentOptions[23880] = new paymentOption(23880,'Portrait 6x4&quot; semi gloss finish','4.00');
paymentOptions[9957] = new paymentOption(9957,'8&quot; x 6&quot; hand printed on semi-gloss paper mounted in a strut-mount frame','10.00');
paymentOptions[13455] = new paymentOption(13455,'8&quot;x10&quot; print on semi gloss paper, presented in a cardboard mount','7.00');
paymentOptions[23748] = new paymentOption(23748,'5x7&quot; Unmounted.','2.50');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[23043] = new paymentGroup(23043,'Angela','73822,75491,74599,74600,23878,23879');
			paymentGroups[7183] = new paymentGroup(7183,'Christening (club)','76897,23748');
			paymentGroups[4047] = new paymentGroup(4047,'Class Photographs','13455');
			paymentGroups[13945] = new paymentGroup(13945,'Communion','45752,45753,76897');
			paymentGroups[16946] = new paymentGroup(16946,'Jamie','55548');
			paymentGroups[21295] = new paymentGroup(21295,'Llewellyn','69107,69108,69106');
			paymentGroups[11566] = new paymentGroup(11566,'One Off','');
			paymentGroups[1278] = new paymentGroup(1278,'Personal Use','32135,583,584,585');
			paymentGroups[7219] = new paymentGroup(7219,'Portrait Party','23880');
			paymentGroups[1277] = new paymentGroup(1277,'School','586,620,589');
			paymentGroups[22791] = new paymentGroup(22791,'Scottish Football Fans','73821,73822');
			paymentGroups[15837] = new paymentGroup(15837,'Soliman','52081,52082');
			paymentGroups[5434] = new paymentGroup(5434,'Standard payment','17980');
			paymentGroups[14444] = new paymentGroup(14444,'Triple Tipple','47542,47543');
			paymentGroups[10583] = new paymentGroup(10583,'Wedding','34352,34462');
	/***************************************************************************
* 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;
}


