/* 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[63408] = new paymentOption(63408,'Single Stereoscope & One set of Views','20.00');
paymentOptions[56629] = new paymentOption(56629,'5&quot;x7&quot; Single Print','12.00');
paymentOptions[63409] = new paymentOption(63409,'Stereoscope and Set of Views','25.00');
paymentOptions[63410] = new paymentOption(63410,'Set of Views Only','15.00');
paymentOptions[49478] = new paymentOption(49478,'5&quot;x7&quot; Single Print','13.00');
paymentOptions[49479] = new paymentOption(49479,'8&quot;x12&quot; Single Print','25.00');
paymentOptions[49480] = new paymentOption(49480,'12&quot;x18&quot; Single Print','40.00');
paymentOptions[59442] = new paymentOption(59442,'5&quot;x7&quot; Single Print','11.00');
paymentOptions[62739] = new paymentOption(62739,'6&quot;x9&quot; single print','13.00');
paymentOptions[59443] = new paymentOption(59443,'8&quot;x12&quot; Single Print','16.00');
paymentOptions[62861] = new paymentOption(62861,'High Res Digital Image','20.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[19396] = new paymentGroup(19396,'3D Erotique','63409,63410');
			paymentGroups[15025] = new paymentGroup(15025,'Bishop\'s Stortford\'s Mayor Macmillan Ball','');
			paymentGroups[19191] = new paymentGroup(19191,'Finch Stage School','');
			paymentGroups[18304] = new paymentGroup(18304,'GSD Junior Showcase 2011','59442,62739,59443,62861');
			paymentGroups[18758] = new paymentGroup(18758,'Pre Wedding Shoots','56629,49479,49480');
			paymentGroups[16457] = new paymentGroup(16457,'Rhodes Pantomime 2009','49478,49479,49480');
			paymentGroups[16458] = new paymentGroup(16458,'Stortfordstarfish','49478,49479');
			paymentGroups[17336] = new paymentGroup(17336,'Valentine\'s Ball','56629,49479');
			paymentGroups[19395] = new paymentGroup(19395,'Views of Bath','63408');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


