/* 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[63724] = new paymentOption(63724,'Print Only','14.99');
paymentOptions[74271] = new paymentOption(74271,'Print Only','49.99');
paymentOptions[74285] = new paymentOption(74285,'Print Only','19.99');
paymentOptions[74367] = new paymentOption(74367,'Print Only','59.99');
paymentOptions[65216] = new paymentOption(65216,'Mounted Print','24.99');
paymentOptions[74272] = new paymentOption(74272,'Mounted Print','69.99');
paymentOptions[74286] = new paymentOption(74286,'Mounted Print','29.99');
paymentOptions[74368] = new paymentOption(74368,'Mounted Print','79.99');
paymentOptions[75513] = new paymentOption(75513,'Mounted Print in White Mount Board','14.99');
paymentOptions[78273] = new paymentOption(78273,'Mounted Print in Cream Mount Board','14.99');
paymentOptions[63726] = new paymentOption(63726,'Framed Print','29.99');
paymentOptions[74273] = new paymentOption(74273,'Framed Print','149.00');
paymentOptions[74276] = new paymentOption(74276,'Framed Print','149.00');
paymentOptions[74287] = new paymentOption(74287,'Framed Print','59.99');
paymentOptions[74369] = new paymentOption(74369,'Framed Print','195.00');
paymentOptions[63919] = new paymentOption(63919,'10&quot; x 12&quot;','195.00');
paymentOptions[65217] = new paymentOption(65217,'Framed Print Black Frame White Mount','34.99');
paymentOptions[78274] = new paymentOption(78274,'Framed Print Black Frame Cream Mount','34.99');
paymentOptions[78275] = new paymentOption(78275,'Framed Print Bronze Frame White Mount','34.99');
paymentOptions[78276] = new paymentOption(78276,'Framed Print Bronze Frame Cream Mount','34.99');
paymentOptions[63920] = new paymentOption(63920,'12&quot; x 16&quot;','295.00');
paymentOptions[63921] = new paymentOption(63921,'16&quot; x 20&quot;','450.00');
paymentOptions[63922] = new paymentOption(63922,'18&quot; x 24&quot;','650.00');
paymentOptions[63923] = new paymentOption(63923,'10&quot; x 12&quot;','249.00');
paymentOptions[63924] = new paymentOption(63924,'12&quot; x 16&quot;','399.00');
paymentOptions[63925] = new paymentOption(63925,'16&quot; x 20&quot;','599.00');
paymentOptions[63926] = new paymentOption(63926,'18&quot; x 24&quot;','849.00');
paymentOptions[63927] = new paymentOption(63927,'24&quot; x 30&quot;','1250.00');
paymentOptions[64067] = new paymentOption(64067,'£50 Voucher','50.00');
paymentOptions[64068] = new paymentOption(64068,'£100 Voucher','100.00');
paymentOptions[64069] = new paymentOption(64069,'£200 Voucher','200.00');
paymentOptions[72882] = new paymentOption(72882,'8&quot; x 10&quot;','50.00');
paymentOptions[72883] = new paymentOption(72883,'10&quot; x 12&quot;','95.00');
paymentOptions[72884] = new paymentOption(72884,'12&quot; x 16&quot;','150.00');
paymentOptions[74277] = new paymentOption(74277,'Framed Original','500.00');
paymentOptions[74370] = new paymentOption(74370,'Framed Original','995.00');
paymentOptions[82584] = new paymentOption(82584,'Print Only','95.00');
paymentOptions[82586] = new paymentOption(82586,'Mounted Only','145.00');
paymentOptions[82588] = new paymentOption(82588,'Mounted and Framed','195.00');
paymentOptions[82594] = new paymentOption(82594,'Desired Framed Original','275.00');
paymentOptions[79510] = new paymentOption(79510,'Greetings Card','1.99');
paymentOptions[82695] = new paymentOption(82695,'Small Mounted Print','7.99');
paymentOptions[82696] = new paymentOption(82696,'Large Mounted Print','9.99');
paymentOptions[82697] = new paymentOption(82697,'Small Framed Print','14.99');
paymentOptions[82698] = new paymentOption(82698,'Large Framed Print','19.99');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[22915] = new paymentGroup(22915,'Affection Limited Edition Prints','74271,74272,74276');
			paymentGroups[23777] = new paymentGroup(23777,'Cartoon Pet Portrait Commissions','72882,72883,72884');
			paymentGroups[19911] = new paymentGroup(19911,'Cartoon Prints','75513,78273,65217,78274,78275,78276');
			paymentGroups[22914] = new paymentGroup(22914,'Derby County Limited Edition Prints ','63724,63726');
			paymentGroups[25635] = new paymentGroup(25635,'Desired Framed Original','82594');
			paymentGroups[25630] = new paymentGroup(25630,'Desired Range','82584,82586,82588');
			paymentGroups[25653] = new paymentGroup(25653,'Dog Breeds','82695,82696,82697,82698');
			paymentGroups[22916] = new paymentGroup(22916,'Framed Original','74277');
			paymentGroups[22951] = new paymentGroup(22951,'Framed Original','74370');
			paymentGroups[19589] = new paymentGroup(19589,'Gift Vouchers','64067,64068,64069');
			paymentGroups[22516] = new paymentGroup(22516,'Graphite Pencil Drawing Commissions','72882,72883,72884');
			paymentGroups[24644] = new paymentGroup(24644,'Greetings Card','79510');
			paymentGroups[19489] = new paymentGroup(19489,'Limited Edition Print','74285,74286,74287');
			paymentGroups[19553] = new paymentGroup(19553,'Oil Portrait Commissions','63923,63924,63925,63926,63927');
			paymentGroups[19552] = new paymentGroup(19552,'Pastel Portrait Commissions','63919,63920,63921,63922');
			paymentGroups[22917] = new paymentGroup(22917,'Peek a boo Limited Edition Prints','74285,74286,74287');
			paymentGroups[22950] = new paymentGroup(22950,'Satisfaction Limited Edition Prints','74367,74368,74369');
			paymentGroups[22913] = new paymentGroup(22913,'Serenity Limited Edition Prints','74271,74272,74273');
	/***************************************************************************
* 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;
}


