/* 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[22510] = new paymentOption(22510,'12&quot; x 18&quot; print','29.50');
paymentOptions[27755] = new paymentOption(27755,'12&quot; x 18&quot;+ black frame.','85.00');
paymentOptions[27753] = new paymentOption(27753,'12&quot;x18&quot; print + oak frame ','85.00');
paymentOptions[27683] = new paymentOption(27683,'16&quot; x 24&quot; print','50.00');
paymentOptions[27877] = new paymentOption(27877,'16&quot; x 24&quot; fine art','75.00');
paymentOptions[75671] = new paymentOption(75671,'16&quot; x 24&quot; stretched canvas','95.00');
paymentOptions[38085] = new paymentOption(38085,'16&quot; x 24&quot;+ black frame.','115.00');
paymentOptions[38086] = new paymentOption(38086,'16&quot; x 24&quot;+ oak frame.','115.00');
paymentOptions[27733] = new paymentOption(27733,'8&quot; x 24&quot; print','22.50');
paymentOptions[27878] = new paymentOption(27878,'8&quot; x 24&quot; fine art','40.00');
paymentOptions[27760] = new paymentOption(27760,'8&quot; x 24&quot; + black frame.','85.00');
paymentOptions[27758] = new paymentOption(27758,'8&quot; x 24&quot; + oak frame.','85.00');
paymentOptions[27734] = new paymentOption(27734,'12&quot; x 36&quot; print','39.50');
paymentOptions[27879] = new paymentOption(27879,'12&quot; x 36&quot; fine art','64.50');
paymentOptions[27759] = new paymentOption(27759,'12&quot; x 36&quot;+ black frame.','125.00');
paymentOptions[27761] = new paymentOption(27761,'12&quot; x 36&quot; + oak frame.','125.00');
paymentOptions[27735] = new paymentOption(27735,'16&quot; x 48&quot; print','60.00');
paymentOptions[27880] = new paymentOption(27880,'16&quot; x 48&quot; fine art','95.00');
paymentOptions[45282] = new paymentOption(45282,'12&quot; x 24&quot; print','40.00');
paymentOptions[27728] = new paymentOption(27728,'12&quot; x 24&quot; fine art','55.00');
paymentOptions[30390] = new paymentOption(30390,'12&quot; x 24&quot; stretched canvas','65.00');
paymentOptions[46244] = new paymentOption(46244,'12&quot; x 24&quot; + black frame.','95.00');
paymentOptions[46243] = new paymentOption(46243,'12&quot; x 24&quot; + oak frame.','95.00');
paymentOptions[45283] = new paymentOption(45283,'18&quot; x 36&quot; print','55.00');
paymentOptions[27729] = new paymentOption(27729,'18&quot; x 36&quot; fine art','75.00');
paymentOptions[30391] = new paymentOption(30391,'18&quot; x 36&quot; stretched canvas','125.00');
paymentOptions[46246] = new paymentOption(46246,'18&quot; x 36&quot; + black frame.','150.00');
paymentOptions[46245] = new paymentOption(46245,'18&quot; x 36&quot; + oak frame.','150.00');
paymentOptions[51320] = new paymentOption(51320,'12&quot; x 18&quot; matte B&W print','45.00');
paymentOptions[56287] = new paymentOption(56287,'12&quot; x 18&quot; B&W + black frame','75.00');
paymentOptions[51321] = new paymentOption(51321,'16&quot; x 24&quot; matte B&W print','60.00');
paymentOptions[56288] = new paymentOption(56288,'16&quot; x 24&quot; B&W print + black frame','115.00');
paymentOptions[51380] = new paymentOption(51380,'8&quot; x 24&quot; matte B&W print','35.00');
paymentOptions[51382] = new paymentOption(51382,'12&quot; x 36&quot; matte B&W print','50.00');
paymentOptions[56289] = new paymentOption(56289,'8&quot; x 24&quot; B&W print + black frame','80.00');
paymentOptions[56290] = new paymentOption(56290,'12&quot; x 36&quot; B&W print + black frame','125.00');
paymentOptions[27730] = new paymentOption(27730,'15&quot; x 15&quot; print','35.00');
paymentOptions[27731] = new paymentOption(27731,'20&quot; x 20&quot; print','50.00');
paymentOptions[74476] = new paymentOption(74476,'43¼&quot; x 20½&quot; customer to collect','95.00');
paymentOptions[75983] = new paymentOption(75983,'43¼&quot; x 20½&quot; inc. courier delivery','120.00');
paymentOptions[74477] = new paymentOption(74477,'32&quot; x 16½&quot; customer to collect','75.00');
paymentOptions[75984] = new paymentOption(75984,'32&quot; x 16½&quot; inc. Courier delivery','95.00');
paymentOptions[76248] = new paymentOption(76248,'41&quot; x 18½&quot; Frame - customer to collect','95.00');
paymentOptions[76249] = new paymentOption(76249,'41&quot; x 18½&quot; Frame - inc. courier delivery','120.00');
paymentOptions[76250] = new paymentOption(76250,'29½ x 14½&quot; frame - customer to collect','70.00');
paymentOptions[76251] = new paymentOption(76251,'29½ x 14½&quot; frame inc. courier delivery','85.00');
paymentOptions[76259] = new paymentOption(76259,'24&quot; panoramic print','22.50');
paymentOptions[76260] = new paymentOption(76260,'36&quot; panoramic print','39.50');
paymentOptions[30392] = new paymentOption(30392,'12&quot; x 36&quot; stretched canvas','115.00');
paymentOptions[38156] = new paymentOption(38156,'16&quot; x 48&quot; stretched canvas','150.00');
paymentOptions[79060] = new paymentOption(79060,'20&quot; x 60&quot; Stretched canvas','215.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[15620] = new paymentGroup(15620,'Black & White framed panoramic prints','56289,56290');
			paymentGroups[15619] = new paymentGroup(15619,'Black & White framed prints','56287,56288');
			paymentGroups[15631] = new paymentGroup(15631,'Black & White panoramic prints','51380,51382');
			paymentGroups[10896] = new paymentGroup(10896,'Black & White prints','51320,51321');
			paymentGroups[23501] = new paymentGroup(23501,'Black Framed Prints','76248,76249,76250,76251');
			paymentGroups[6811] = new paymentGroup(6811,'new semi-pan','45282,27728,30390,46244,46243,45283,30391,46246,46245');
			paymentGroups[23002] = new paymentGroup(23002,'Oak laminate framed Prints','74476,75983,74477,75984');
			paymentGroups[1064] = new paymentGroup(1064,'Panoramic Collection','27733,27760,27758,27734,27759,27761,76259,76260,30392,38156,79060');
			paymentGroups[23523] = new paymentGroup(23523,'Panoramic Prints','76259,76260,30392,38156,79060');
			paymentGroups[247] = new paymentGroup(247,'Print options, prices and frame information','22510,27755,27753,27683,75671,38085,38086');
			paymentGroups[8543] = new paymentGroup(8543,'Square Prints','27730,27731');
	/***************************************************************************
* 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;
}


