/* 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[23530] = new paymentOption(23530,'7.5x5&quot; Photographic Print','15.50');
paymentOptions[23539] = new paymentOption(23539,'7.5x5&quot; Photographic Print Mounted','24.50');
paymentOptions[57062] = new paymentOption(57062,'7.5x5&quot; Print Mounted & Framed','55.00');
paymentOptions[23526] = new paymentOption(23526,'12x8&quot; Photographic Print','28.00');
paymentOptions[23366] = new paymentOption(23366,'12x8&quot; Photographic Print Mounted','40.00');
paymentOptions[57063] = new paymentOption(57063,'12x8&quot; Print Mounted with Premium Frame','95.00');
paymentOptions[23527] = new paymentOption(23527,'15x10&quot; Photographic Print','39.00');
paymentOptions[23524] = new paymentOption(23524,'15x10&quot; Photographic Print Mounted','55.00');
paymentOptions[57064] = new paymentOption(57064,'15x10&quot; Print Mounted with Premium Frame','125.00');
paymentOptions[23528] = new paymentOption(23528,'24x16&quot; Photographic Print','55.00');
paymentOptions[23525] = new paymentOption(23525,'24x16&quot; Photographic Print Mounted','80.00');
paymentOptions[57065] = new paymentOption(57065,'24x16&quot; Print Mounted with Premium Frame','185.00');
paymentOptions[23531] = new paymentOption(23531,'380x190mm Photographic Print','30.00');
paymentOptions[23533] = new paymentOption(23533,'380x190mm Photographic Print Mounted','46.00');
paymentOptions[23544] = new paymentOption(23544,'560x255mm Photographic Print','50.00');
paymentOptions[23545] = new paymentOption(23545,'560x255mm Photographic Print Mounted','68.00');
paymentOptions[23543] = new paymentOption(23543,'205x205mm Photographic Print','19.00');
paymentOptions[23542] = new paymentOption(23542,'205x205mm Photographic Print Mounted','34.00');
paymentOptions[23588] = new paymentOption(23588,'305x305mm Photographic Print','28.00');
paymentOptions[23589] = new paymentOption(23589,'305x305mm Photographic Print Mounted','41.00');
paymentOptions[23940] = new paymentOption(23940,'18x12&quot; Canvas Print','95.00');
paymentOptions[23941] = new paymentOption(23941,'24x16&quot; Canvas Print','120.00');
paymentOptions[23942] = new paymentOption(23942,'36x24&quot; Canvas Print','175.00');
paymentOptions[57061] = new paymentOption(57061,'48x32&quot; Canvas  Print','225.00');
paymentOptions[57067] = new paymentOption(57067,'7.5x5&quot; Photographic Print','10.50');
paymentOptions[57068] = new paymentOption(57068,'7.5x5&quot; Photographic Print Framed','45.00');
paymentOptions[57069] = new paymentOption(57069,'9x6&quot; Photographic Print','12.50');
paymentOptions[57070] = new paymentOption(57070,'9x6&quot; Photographic Print Framed','54.00');
paymentOptions[57071] = new paymentOption(57071,'12x8&quot; Photographic Print','15.50');
paymentOptions[57072] = new paymentOption(57072,'12x8&quot; Photographic Print Framed','68.00');
paymentOptions[57073] = new paymentOption(57073,'15x10&quot; Photographic Print','25.00');
paymentOptions[57074] = new paymentOption(57074,'15x10&quot; Photographic Print Framed','85.00');
paymentOptions[57076] = new paymentOption(57076,'24x16&quot; Photographic Print','45.00');
paymentOptions[57075] = new paymentOption(57075,'24x16&quot; Photographic Print Framed','125.00');
paymentOptions[57077] = new paymentOption(57077,'18x12&quot; Canvas Print','85.00');
paymentOptions[57078] = new paymentOption(57078,'24x16&quot; Canvas Print','120.00');
paymentOptions[57083] = new paymentOption(57083,'36x24&quot; Canvas Print','175.00');
paymentOptions[36379] = new paymentOption(36379,'10 prints from this album at 7x5&quot;','86.00');
paymentOptions[36380] = new paymentOption(36380,'10 prints from this album at 9x6&quot;','95.00');
paymentOptions[36381] = new paymentOption(36381,'20 prints from this album at 7x5&quot;','130.00');
paymentOptions[36382] = new paymentOption(36382,'20 prints from this album at 9x6&quot;','142.00');
paymentOptions[57060] = new paymentOption(57060,'Larger & custom options available - Please call to discuss your requirements','0.00');
paymentOptions[57066] = new paymentOption(57066,'Depending on the dimensions of the photograph, print size may vary from those stated','0.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[7149] = new paymentGroup(7149,'Portrait Session','');
			paymentGroups[7109] = new paymentGroup(7109,'Scenic Photographic 3x2 Not Large Format','23530,23539,57062,23526,23366,57063,57065,57060,57066');
			paymentGroups[7110] = new paymentGroup(7110,'Scenic Photography 1:1','23543,23542,23588,23589,57060,57066');
			paymentGroups[7112] = new paymentGroup(7112,'Scenic Photography 2:1','23531,23533,23544,23545,57060,57066');
			paymentGroups[7081] = new paymentGroup(7081,'Scenic Photography 3x2','23530,23539,57062,23526,23366,57063,23527,23524,57064,23528,23525,57065,23940,23941,23942,57061,57060,57066');
			paymentGroups[7150] = new paymentGroup(7150,'Surf Photography','');
			paymentGroups[7347] = new paymentGroup(7347,'Wedding','57067,57068,57069,57070,57071,57072,57073,57074,57076,57075,57077,57078,57083,36379,36380,36381,36382,57060,57066');
	/***************************************************************************
* 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;
}


