/* 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.item_price_1.value = paymentOptions[id].price;
			form.item_name_1.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[43613] = new paymentOption(43613,'Sitting Fee','45.00');
paymentOptions[43614] = new paymentOption(43614,'A6 Photo Bloc','80.00');
paymentOptions[43615] = new paymentOption(43615,'A5 Photo Bloc','95.00');
paymentOptions[43616] = new paymentOption(43616,'A4 Photo Bloc','125.00');
paymentOptions[43617] = new paymentOption(43617,'Acrylic Panel 12&quot; x 10&quot; ','135.00');
paymentOptions[43618] = new paymentOption(43618,'Acrylic Panel 16&quot; x 12&quot; ','195.00');
paymentOptions[43619] = new paymentOption(43619,'Acrylic Panel 20&quot; x 16&quot; ','255.00');
paymentOptions[43620] = new paymentOption(43620,'Acrylic Panel 24&quot; x 20&quot; ','325.00');
paymentOptions[43621] = new paymentOption(43621,'Acrylic Panel 22&quot; x 36&quot; ','345.00');
paymentOptions[43622] = new paymentOption(43622,'Acrylic Panel 23&quot; x 33&quot; ','375.00');
paymentOptions[43623] = new paymentOption(43623,'Diamond Acrylic 3 Bloc','395.00');
paymentOptions[43624] = new paymentOption(43624,'Diamond Acrylic 9 Bloc','895.00');
paymentOptions[43625] = new paymentOption(43625,'Diamond Acrylic Bloc','70.00');
paymentOptions[43626] = new paymentOption(43626,'MDF Print 12&quot; x 10&quot;','125.00');
paymentOptions[43627] = new paymentOption(43627,'MDF Print 18&quot; x 12&quot;','185.00');
paymentOptions[43628] = new paymentOption(43628,'MDF Print 20&quot; x 16&quot;','245.00');
paymentOptions[43629] = new paymentOption(43629,'MDF Print 24&quot; x 20&quot;','315.00');
paymentOptions[43630] = new paymentOption(43630,'Canvas Wrap 12&quot; x 10&quot;','125.00');
paymentOptions[43631] = new paymentOption(43631,'Canvas Wrap 18&quot; x 12&quot;','185.00');
paymentOptions[43632] = new paymentOption(43632,'Canvas Wrap 20&quot; x 16&quot;','245.00');
paymentOptions[43633] = new paymentOption(43633,'Canvas Wrap 24&quot; x 20&quot;','315.00');
paymentOptions[43634] = new paymentOption(43634,'Canvas Wrap on MDF 12&quot; x 10&quot;','145.00');
paymentOptions[43635] = new paymentOption(43635,'Canvas Wrap on MDF 16&quot; x 12&quot;','205.00');
paymentOptions[43636] = new paymentOption(43636,'Canvas Wrap on MDF 20&quot; x 16&quot;','275.00');
paymentOptions[43637] = new paymentOption(43637,'Canvas Wrap on MDF 24&quot; x 20&quot;','350.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[13286] = new paymentGroup(13286,'Payment','43613,43614,43615,43616,43617,43618,43619,43620,43621,43622,43623,43624,43625,43626,43627,43628,43629,43630,43631,43632,43633,43634,43635,43636,43637');
	/***************************************************************************
* 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;
}


