/* 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[44320] = new paymentOption(44320,'Print Set A','29.00');
paymentOptions[44321] = new paymentOption(44321,'Print Set B','24.50');
paymentOptions[44322] = new paymentOption(44322,'Print Set C','12.00');
paymentOptions[44323] = new paymentOption(44323,'Print Set D','12.50');
paymentOptions[44324] = new paymentOption(44324,'Portrait Set E','30.00');
paymentOptions[44325] = new paymentOption(44325,'CD of all images','50.00');
paymentOptions[44084] = new paymentOption(44084,'6&quot; x 4&quot; print','6.00');
paymentOptions[80120] = new paymentOption(80120,'6&quot; x 4&quot; print','8.00');
paymentOptions[62863] = new paymentOption(62863,'7.5&quot; x 5&quot; print','9.00');
paymentOptions[44085] = new paymentOption(44085,'7.5&quot; x 5&quot; print','10.00');
paymentOptions[83297] = new paymentOption(83297,'8&quot; x 6&quot; print','11.00');
paymentOptions[44086] = new paymentOption(44086,'9&quot; x 6&quot; print','12.00');
paymentOptions[44087] = new paymentOption(44087,'10&quot; x 8&quot; print','15.00');
paymentOptions[83278] = new paymentOption(83278,'16&quot; square print','35.00');
paymentOptions[80069] = new paymentOption(80069,'15&quot; x 10&quot; print','25.00');
paymentOptions[83275] = new paymentOption(83275,'24&quot; x 16&quot; print','50.00');
paymentOptions[62865] = new paymentOption(62865,'12&quot; x 8&quot; and 6&quot; x 4&quot;','20.00');
paymentOptions[83276] = new paymentOption(83276,'24&quot; square print','80.00');
paymentOptions[83277] = new paymentOption(83277,'30&quot; x 20&quot; print','80.00');
paymentOptions[83210] = new paymentOption(83210,'9&quot; x 6&quot; print','6.00');
paymentOptions[83211] = new paymentOption(83211,'10&quot; x 8&quot; print','9.00');
paymentOptions[83212] = new paymentOption(83212,'12&quot; x 8&quot; print','12.00');
paymentOptions[83213] = new paymentOption(83213,'15&quot; x 10&quot; print','18.00');
paymentOptions[83215] = new paymentOption(83215,'12&quot; x 12&quot; print','18.00');
paymentOptions[51779] = new paymentOption(51779,'CD of all individual images','95.00');
paymentOptions[76378] = new paymentOption(76378,'CD of all images including 2 composites','125.00');
paymentOptions[57216] = new paymentOption(57216,'Booking Fee','200.00');
paymentOptions[61035] = new paymentOption(61035,'6&quot; x 4&quot; print','10.00');
paymentOptions[61036] = new paymentOption(61036,'9&quot; x 6&quot; print','14.00');
paymentOptions[61040] = new paymentOption(61040,'12&quot; x 6&quot; panoramic print','18.00');
paymentOptions[61037] = new paymentOption(61037,'12&quot; x 8&quot; print','20.00');
paymentOptions[61038] = new paymentOption(61038,'18&quot; x 12&quot; print','28.00');
paymentOptions[61041] = new paymentOption(61041,'24&quot; x 12&quot; panoramic print','32.00');
paymentOptions[61039] = new paymentOption(61039,'24&quot; x 16&quot; print','35.00');
paymentOptions[61042] = new paymentOption(61042,'16&quot; x 12&quot; canvas wrap','70.00');
paymentOptions[61043] = new paymentOption(61043,'24&quot; x 12&quot; panoramic canvas wrap','90.00');
paymentOptions[61044] = new paymentOption(61044,'20&quot; x 30&quot; canvas wrap','110.00');
paymentOptions[80072] = new paymentOption(80072,'CD & copyrights to all images','500.00');
paymentOptions[80073] = new paymentOption(80073,'CD & 40 page Wedding Album','750.00');
paymentOptions[61505] = new paymentOption(61505,'Framed 12&quot;x8&quot; print: finished size 16&quot;x12&quot;','70.00');
paymentOptions[61506] = new paymentOption(61506,'Framed 18&quot;x12&quot; print: finished size 23&quot;x17&quot;','90.00');
paymentOptions[61507] = new paymentOption(61507,'Framed 24&quot;x16&quot; print: finished size 29&quot; x 21&quot;','110.00');
paymentOptions[61508] = new paymentOption(61508,'Framed 30&quot;x20&quot; print: finished size 35&quot;x25&quot;','130.00');
paymentOptions[69410] = new paymentOption(69410,'Acrylic frame with one 8&quot;x6&quot; print','50.00');
paymentOptions[63152] = new paymentOption(63152,'Acrylic frame with 4 landscape prints','80.00');
paymentOptions[63153] = new paymentOption(63153,'Acrylic frame with 5 landscape prints','100.00');
paymentOptions[63140] = new paymentOption(63140,'Acrylic frame 4x2 format including 8 square prints','125.00');
paymentOptions[63139] = new paymentOption(63139,'Acrylic frame 3x3 format including 9 prints','150.00');
paymentOptions[63141] = new paymentOption(63141,'Acrylic frame 3x3 large format including 6 prints','150.00');
paymentOptions[63142] = new paymentOption(63142,'Acrylic frame 4x4 format including 16 prints','195.00');
paymentOptions[63147] = new paymentOption(63147,'12&quot; x 16&quot; canvas wrap','100.00');
paymentOptions[63149] = new paymentOption(63149,'16&quot; x 20&quot; canvas wrap','150.00');
paymentOptions[63145] = new paymentOption(63145,'12&quot; x 24&quot; panoramic canvas wrap','150.00');
paymentOptions[63146] = new paymentOption(63146,'18&quot; x 24&quot; canvas wrap','200.00');
paymentOptions[63144] = new paymentOption(63144,'20&quot; square canvas wrap','200.00');
paymentOptions[63143] = new paymentOption(63143,'20&quot; x 30&quot; canvas wrap','225.00');
paymentOptions[63150] = new paymentOption(63150,'24&quot; x 30&quot; canvas wrap','250.00');
paymentOptions[63151] = new paymentOption(63151,'30&quot; square canvas wrap','275.00');
paymentOptions[72983] = new paymentOption(72983,'CD and copyrights to all images','300.00');
paymentOptions[72984] = new paymentOption(72984,'12&quot; x 16&quot; canvas wrap','80.00');
paymentOptions[72985] = new paymentOption(72985,'16&quot; x 20&quot; canvas wrap','120.00');
paymentOptions[72987] = new paymentOption(72987,'20&quot; x 20&quot; canvas wrap','140.00');
paymentOptions[72986] = new paymentOption(72986,'20&quot; x 30&quot; canvas wrap','160.00');
paymentOptions[57219] = new paymentOption(57219,'£10 voucher','10.00');
paymentOptions[57220] = new paymentOption(57220,'£25 voucher','25.00');
paymentOptions[57218] = new paymentOption(57218,'£50 voucher','50.00');
paymentOptions[57217] = new paymentOption(57217,'£100 voucher','100.00');
paymentOptions[80955] = new paymentOption(80955,'Studio fee','25.00');
paymentOptions[80956] = new paymentOption(80956,'Location fee','45.00');
paymentOptions[80957] = new paymentOption(80957,'Wedding booking fee','200.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[17532] = new paymentGroup(17532,'Booking Fee','80955,80956,80957');
			paymentGroups[19222] = new paymentGroup(19222,'Event','44084,62863,44086,62865');
			paymentGroups[25815] = new paymentGroup(25815,'Event gillies','83210,83211,83212,83213,83215,61038');
			paymentGroups[17533] = new paymentGroup(17533,'Gift Vouchers','57219,57220,57218,57217');
			paymentGroups[13509] = new paymentGroup(13509,'Military Baby portrait','44320,44321,44322,44323,44324,44325');
			paymentGroups[24832] = new paymentGroup(24832,'Print wedding','44084,44085,44086,44087,80069,61040,61038,61041,80072,80073,63152,63153,63140,63139,63141,63147,63149,63145,63146,63144,63143,63150,63151');
			paymentGroups[18710] = new paymentGroup(18710,'RMAS','61035,61036,61040,61037,61038,61041,61039,61042,61043,61044,61505,61506,61507,61508');
			paymentGroups[16361] = new paymentGroup(16361,'Studio packages','44320,44321,44322,44323,44324,44084,44085,44086,44087,83276');
			paymentGroups[13510] = new paymentGroup(13510,'Studio Portraits','80120,44085,83297,44086,44087,83278,80069,83275,83277,51779,69410,63152,63153,63140,63139,63141,63142,63147,63149,63145,63146,63144,63143,63150,63151');
			paymentGroups[19786] = new paymentGroup(19786,'wedding','44084,44085,44086,44087,80069,61040,61038,61041,63152,63153,63140,63139,63141,72983,72984,72985,72987,72986');
	/***************************************************************************
* 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;
}


