/* 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[81714] = new paymentOption(81714,'PHOTOSHOOT CD IMAGE (minimum order 15 images','2.00');
paymentOptions[61245] = new paymentOption(61245,'WEDDING/SPECIAL EVENT  VIDEO - 1 HOUR SHOOT','200.00');
paymentOptions[83207] = new paymentOption(83207,'SANTA SOUVENIR PHOTO 6 x 4','3.00');
paymentOptions[83137] = new paymentOption(83137,'ALICE IN PANTOLAND SOUVENIR PHOTO 6 x 4','1.00');
paymentOptions[47303] = new paymentOption(47303,'6&quot; x 4&quot; Prints (Mounted)','3.50');
paymentOptions[33505] = new paymentOption(33505,'7&quot; x 5&quot; Prints (Mounted)','5.00');
paymentOptions[75441] = new paymentOption(75441,'8&quot; x 6&quot; Prints (Mounted)','8.00');
paymentOptions[33510] = new paymentOption(33510,'10&quot; x 8&quot; Prints (Mounted)','10.00');
paymentOptions[74148] = new paymentOption(74148,'5&quot; x 5&quot; SQUARE (Mounted)','7.00');
paymentOptions[74149] = new paymentOption(74149,'8&quot; x 8&quot; SQUARE (Mounted)','10.00');
paymentOptions[74150] = new paymentOption(74150,'10&quot; x 10&quot; SQUARE (Print only)','10.00');
paymentOptions[74151] = new paymentOption(74151,'12&quot; x 12&quot; SQUARE (Print only)','15.00');
paymentOptions[54938] = new paymentOption(54938,'A4 Prints (Print only)','10.00');
paymentOptions[46789] = new paymentOption(46789,'A3 Enlargement (Print only)','25.00');
paymentOptions[73945] = new paymentOption(73945,'A2 Enlargement (Print Only)','35.00');
paymentOptions[73946] = new paymentOption(73946,'A1 Enlargement (Print Only)','50.00');
paymentOptions[28517] = new paymentOption(28517,'<strong> 7&quot; x 5&quot; Framed Print','20.00');
paymentOptions[28515] = new paymentOption(28515,'<strong> A4 Framed Print','45.00');
paymentOptions[28514] = new paymentOption(28514,'<strong>24&quot; x 16&quot; Framed Print','75.00');
paymentOptions[47092] = new paymentOption(47092,'<strong>39&quot; x 27&quot; Framed Print','100.00');
paymentOptions[55606] = new paymentOption(55606,'<strong> Multi 3 x 8&quot; x 6&quot; Framed Prints','70.00');
paymentOptions[47093] = new paymentOption(47093,'<strong>Multi 5 x 7&quot; x 5&quot; Framed Prints','70.00');
paymentOptions[54346] = new paymentOption(54346,'<strong>10&quot; x 8&quot; Framed Print','45.00');
paymentOptions[54460] = new paymentOption(54460,'<strong>5&quot; x 5&quot; Framed Print','25.00');
paymentOptions[47094] = new paymentOption(47094,'<strong>Multi 5 x 6&quot; x 4&quot; Framed Prints','55.00');
paymentOptions[47095] = new paymentOption(47095,'<strong>Multi 9 x 6&quot; x 4&quot; Framed Prints','75.00');
paymentOptions[47096] = new paymentOption(47096,'<strong>Square 11.5&quot; x 11.5&quot; Framed Print','50.00');
paymentOptions[48522] = new paymentOption(48522,'<strong>Triptych 3 x 15&quot; x 15&quot;  Stretched Canvases','135.00');
paymentOptions[70725] = new paymentOption(70725,'<strong>15&quot; x 15&quot;  Stretched Canvas','55.00');
paymentOptions[70879] = new paymentOption(70879,'<strong>24&quot; x 16&quot; Stretched Canvas','65.00');
paymentOptions[28474] = new paymentOption(28474,'<strong>24&quot; x 24&quot; Stretched Canvas','75.00');
paymentOptions[28477] = new paymentOption(28477,'<strong>36&quot; x 24&quot; Stretched Canvas ','95.00');
paymentOptions[59967] = new paymentOption(59967,'<strong>36&quot; x 36&quot; Stretched Canvas ','115.00');
paymentOptions[59969] = new paymentOption(59969,'<strong>48&quot; x 36&quot; Stretched Canvas ','145.00');
paymentOptions[45122] = new paymentOption(45122,'<strong>7x7 BOOK 75','75.00');
paymentOptions[45125] = new paymentOption(45125,'<strong>7x7 BOOK 100','100.00');
paymentOptions[45130] = new paymentOption(45130,'<strong>8x10 BOOK 75','110.00');
paymentOptions[45131] = new paymentOption(45131,'<strong>8x10 BOOK 100','125.00');
paymentOptions[45134] = new paymentOption(45134,'<strong>12x12 BOOK 75','130.00');
paymentOptions[45135] = new paymentOption(45135,'<strong>12x12 BOOK 100','145.00');
paymentOptions[45139] = new paymentOption(45139,'<strong>13x11 BOOK 75','160.00');
paymentOptions[55337] = new paymentOption(55337,'<strong>BUDGET PORTFOLIO CD (25 Images)','75.00');
paymentOptions[62356] = new paymentOption(62356,'<strong>STANDARD PORTFOLIO CD (50 Images)','150.00');
paymentOptions[62358] = new paymentOption(62358,'<strong>DE-LUXE PORTFOLIO CD (75 Images)  + 75 Image Book','200.00');
paymentOptions[62815] = new paymentOption(62815,'<strong>THE ULTIMATE PROFESSIONAL PORTFOLIO CD (100 Images) + 100 Image Book + MODEL','250.00');
paymentOptions[55317] = new paymentOption(55317,'PERSONALISED GIFT VOUCHER','5.00');
paymentOptions[55318] = new paymentOption(55318,'PERSONALISED GIFT VOUCHER','10.00');
paymentOptions[55319] = new paymentOption(55319,'PERSONALISED GIFT VOUCHER','20.00');
paymentOptions[55320] = new paymentOption(55320,'PERSONALISED GIFT VOUCHER','50.00');
paymentOptions[55321] = new paymentOption(55321,'PERSONALISED GIFT VOUCHER','100.00');
paymentOptions[69860] = new paymentOption(69860,'A6 Invitation (Postcard)','0.30');
paymentOptions[69861] = new paymentOption(69861,'A6 Invitation (Folded)','0.40');
paymentOptions[69973] = new paymentOption(69973,'A5 Invite (Large postcard)','0.50');
paymentOptions[69974] = new paymentOption(69974,'A5 Invite (A4 folded)','0.60');
paymentOptions[70010] = new paymentOption(70010,'MULTIPLE GREETINGS CARDS','3.00');
paymentOptions[70011] = new paymentOption(70011,'SINGLE CUSTOM GREETINGS CARD','5.00');
paymentOptions[70012] = new paymentOption(70012,'A6 Leaflet printed both sides','0.15');
paymentOptions[70013] = new paymentOption(70013,'DL Leaflet printed both sides.','0.18');
paymentOptions[70014] = new paymentOption(70014,'A5 Leaflet printed both sides','0.20');
paymentOptions[70015] = new paymentOption(70015,'A4 Leaflet printed both sides.','0.30');
paymentOptions[70016] = new paymentOption(70016,'A4 LETTERHEADS','0.15');
paymentOptions[70017] = new paymentOption(70017,'DL COMPLIMENT SLIPS','0.10');
paymentOptions[70018] = new paymentOption(70018,'BUSINESS CARDS','0.10');
paymentOptions[81553] = new paymentOption(81553,'A3 POSTER','8.00');
paymentOptions[71577] = new paymentOption(71577,'Wedding Option A inc 50 image CD','150.00');
paymentOptions[71578] = new paymentOption(71578,'Wedding Option B inc 75 image CD','300.00');
paymentOptions[71579] = new paymentOption(71579,'Wedding Option C inc 100 image CD','450.00');
paymentOptions[71580] = new paymentOption(71580,'Wedding Option D inc 125 image CD','600.00');
paymentOptions[71581] = new paymentOption(71581,'Wedding Option E inc 150 image CD','900.00');
paymentOptions[71582] = new paymentOption(71582,'Wedding Option F inc 200 image CD','1200.00');
paymentOptions[71596] = new paymentOption(71596,'Wedding Option T Memories Album','150.00');
paymentOptions[71597] = new paymentOption(71597,'Wedding Option U Topflight Album','200.00');
paymentOptions[71598] = new paymentOption(71598,'Wedding Option V Acerboni Album','300.00');
paymentOptions[71599] = new paymentOption(71599,'Wedding Option W Graphistudio Album','400.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[18465] = new paymentGroup(18465,'BESPOKE ARTWORK CANVASES','28474,28477,59967,59969');
			paymentGroups[7774] = new paymentGroup(7774,'CANVAS, PRINTS & CD SALES','81714,83207,83137,47303,33505,75441,33510,74148,74149,74150,74151,54938,46789,73945,73946,28517,28515,28514,47092,55606,47093,54346,54460,47094,47095,47096,48522,70725,70879,28474,28477,59967,59969,45122,45125,45130,45131,45134,45135,45139');
			paymentGroups[23915] = new paymentGroup(23915,'CUSTOMISED PRINT SERVICE','');
			paymentGroups[16826] = new paymentGroup(16826,'GIFT VOUCHERS','55317,55318,55319,55320,55321');
			paymentGroups[12325] = new paymentGroup(12325,'MODEL PORTFOLIOS / PUBLICITY PHOTOS','55337,62356,62358,62815,55317,55318,55319,55320,55321');
			paymentGroups[21548] = new paymentGroup(21548,'PERSONALISED PRINTING / GREETINGS CARDS.','69860,69861,69973,69974,70010,70011,70012,70013,70014,70015,70016,70017,70018,81553');
			paymentGroups[24097] = new paymentGroup(24097,'WEDDING or SPECIAL EVENT VIDEO ON DVD','61245');
			paymentGroups[7350] = new paymentGroup(7350,'WEDDINGS & SPECIAL EVENTS','45122,45125,45130,45131,45134,45135,45139,71577,71578,71579,71580,71581,71582,71596,71597,71598,71599');
	/***************************************************************************
* 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;
}


