/* 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[79304] = new paymentOption(79304,'DVD of over 100 high resolution images','35.00');
paymentOptions[46380] = new paymentOption(46380,'BOOK MARK x 1','3.00');
paymentOptions[46381] = new paymentOption(46381,'BOOK MARKS x 3','7.50');
paymentOptions[46382] = new paymentOption(46382,'BOOK MARKS x 6','14.00');
paymentOptions[46386] = new paymentOption(46386,'Single Blank Card [ p&p included ]','2.75');
paymentOptions[52348] = new paymentOption(52348,'6&quot; X 6&quot; high res print [ UK P&P included ]','6.00');
paymentOptions[46387] = new paymentOption(46387,'3 x Blank Cards  [ p&p included ]','6.50');
paymentOptions[21020] = new paymentOption(21020,'6&quot; x 4&quot; high res print [ UK P&P inc ]','5.00');
paymentOptions[21021] = new paymentOption(21021,'7.5&quot; x 5&quot; high res print [ UK P&P included ]','6.50');
paymentOptions[21022] = new paymentOption(21022,'9&quot; x 6&quot; high res print [ UK P&P included ]','8.00');
paymentOptions[46388] = new paymentOption(46388,'6 x Blank Cards  [ p&p included ]','12.00');
paymentOptions[52351] = new paymentOption(52351,'8&quot; x 8&quot; high res print [ UK P&P included ]','8.00');
paymentOptions[53778] = new paymentOption(53778,'CHRISTMAS GIFT VOUCHER','50.00');
paymentOptions[46389] = new paymentOption(46389,'12 x Blank Cards [ p&p included ]','22.00');
paymentOptions[21023] = new paymentOption(21023,'A4 high res print [ UK P&P included ]','14.00');
paymentOptions[68162] = new paymentOption(68162,'A3 high res print [UK P&P included ]','25.00');
paymentOptions[68163] = new paymentOption(68163,'Canvas from','60.00');
paymentOptions[48060] = new paymentOption(48060,'CANVAS 22&quot; X 14&quot; [INC P&P ]','80.00');
paymentOptions[67022] = new paymentOption(67022,'JANUARY 2011 SPECIAL OFFER','80.00');
paymentOptions[53250] = new paymentOption(53250,'GIFT VOUCHER','50.00');
paymentOptions[55072] = new paymentOption(55072,'A4 PRINT PLUS HIGH RES JPG','30.00');
paymentOptions[63581] = new paymentOption(63581,'Prints x 4, no\'s 2776,2808,2469,2553','22.50');
paymentOptions[73851] = new paymentOption(73851,'Pack of 3 [ 7&quot;x5&quot; ] cards - One of each design [ P&P included]','5.75');
paymentOptions[46407] = new paymentOption(46407,'9&quot; x 6&quot; unmounted print inc p&p','12.50');
paymentOptions[46408] = new paymentOption(46408,'A4 unmounted print inc p&p','17.50');
paymentOptions[47633] = new paymentOption(47633,'canvas 32 inches x 10 inches [panoramic ]','100.00');
paymentOptions[59994] = new paymentOption(59994,'6&quot; x 4&quot; unmounted print [UK P&P included]','7.50');
paymentOptions[48163] = new paymentOption(48163,'6&quot; X 6&quot; square print [uk p&p included ]','6.00');
paymentOptions[47931] = new paymentOption(47931,'7.5&quot; x 5&quot; unmounted print [UK P&P included ]','8.50');
paymentOptions[47932] = new paymentOption(47932,'9&quot; X 6&quot; unmounted print [ UK P&P included ]','10.00');
paymentOptions[47933] = new paymentOption(47933,'A4 Unmounted print [ UK P&P included ]','25.00');
paymentOptions[48164] = new paymentOption(48164,'8&quot; x 8&quot; square print [UK P&P Included ]','8.00');
paymentOptions[50443] = new paymentOption(50443,'Mounted panoramic print approx 23&quot; x 11&quot; ','30.00');
paymentOptions[74000] = new paymentOption(74000,'Special Offer 8 cards - 2 of each design [ P&P inc ]','12.00');
paymentOptions[50446] = new paymentOption(50446,'A4 LIMITED EDITION PRINT ','50.00');
paymentOptions[67608] = new paymentOption(67608,'POSTER PRINT 23&quot; x 10&quot; ','25.00');
paymentOptions[73110] = new paymentOption(73110,'8&quot; X 8&quot; unmounted print inc p&p','12.50');
paymentOptions[73111] = new paymentOption(73111,'10&quot; x 10&quot; unmounted print inc p&p','17.50');
paymentOptions[59744] = new paymentOption(59744,'10&quot; x 8&quot; unmounted print ','12.00');
paymentOptions[59745] = new paymentOption(59745,'12&quot; x 10&quot; unmounted print ','16.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[18399] = new paymentGroup(18399,'10x8 or 12x10 prints','59744,59745');
			paymentGroups[15326] = new paymentGroup(15326,'A4 LIMITED EDITION PRINT','50446');
			paymentGroups[14126] = new paymentGroup(14126,'BOOK MARKS','46380,46381,46382');
			paymentGroups[14472] = new paymentGroup(14472,'CANVAS - PANORAMIC ','47633');
			paymentGroups[15325] = new paymentGroup(15325,'CANVAS - PORTRAIT ','48060');
			paymentGroups[20571] = new paymentGroup(20571,'Canvas 32&quot; x 14&quot; Special offer','67022');
			paymentGroups[16301] = new paymentGroup(16301,'CHRISTMAS GIFT VOUCHER','53778');
			paymentGroups[17214] = new paymentGroup(17214,'CONTACT ME','');
			paymentGroups[24594] = new paymentGroup(24594,'DVD of all images','79304');
			paymentGroups[16119] = new paymentGroup(16119,'GIFT VOUCHER','53250');
			paymentGroups[14124] = new paymentGroup(14124,'GREETINGS CARDS ','46386,46387,46388,46389');
			paymentGroups[14134] = new paymentGroup(14134,'IMAGES FOR SALE GALLERY','46407,46408');
			paymentGroups[22577] = new paymentGroup(22577,'IMAGES FOR SALE SQUARE PRINTS','73110,73111');
			paymentGroups[22845] = new paymentGroup(22845,'Pack of 8 cards- Special Offer','74000');
			paymentGroups[22799] = new paymentGroup(22799,'Pack of Cards','73851');
			paymentGroups[22364] = new paymentGroup(22364,'Panoramic Print','50443');
			paymentGroups[14578] = new paymentGroup(14578,'PORTRAIT PHOTOGRAPHY PRINTS','59994,47931,47932,47933');
			paymentGroups[20786] = new paymentGroup(20786,'Poster Print 23&quot; x 10&quot;','67608');
			paymentGroups[19455] = new paymentGroup(19455,'Prints x 4, 2776,2808,2469,2553','63581');
			paymentGroups[14656] = new paymentGroup(14656,'SQUARE PRINTS','48163,48164');
			paymentGroups[6273] = new paymentGroup(6273,'WEDDING REPRINT PRICE ','21020,21021,21022,21023,68162,68163');
			paymentGroups[15906] = new paymentGroup(15906,'WEDDING SQUARE PRINTS','52348,52351');
	/***************************************************************************
* 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;
}


