/* 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[77904] = new paymentOption(77904,'9&quot;x6&quot; - *Special Offer* Extended','10.00');
paymentOptions[76928] = new paymentOption(76928,'3 - 9&quot;x6&quot; Prints - *Special Offer* extended','20.00');
paymentOptions[76929] = new paymentOption(76929,'6&quot;x4&quot;','6.75');
paymentOptions[76188] = new paymentOption(76188,'7&quot;x5&quot;','8.75');
paymentOptions[76189] = new paymentOption(76189,'8&quot;x6&quot;','13.50');
paymentOptions[76190] = new paymentOption(76190,'8&quot;x8&quot;','14.75');
paymentOptions[17802] = new paymentOption(17802,'9&quot; x 6&quot;','14.75');
paymentOptions[76192] = new paymentOption(76192,'10&quot;x8&quot;','17.50');
paymentOptions[76193] = new paymentOption(76193,'A4 (approx 12&quot;x8&quot;)','19.75');
paymentOptions[76198] = new paymentOption(76198,'12&quot;x10&quot;','22.50');
paymentOptions[76194] = new paymentOption(76194,'A3 (approx 16&quot;x11&quot;)','29.50');
paymentOptions[76195] = new paymentOption(76195,'15&quot;x12&quot;','30.25');
paymentOptions[76196] = new paymentOption(76196,'24&quot;x20&quot;','65.00');
paymentOptions[76199] = new paymentOption(76199,'If you wish to pay by Cheque or Bank transfer, please e-mail me through the \'Contact\' section for advice','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[23509] = new paymentGroup(23509,'Events','77904,76928,76929,76188,76189,76190,17802,76192,76193,76198,76194,76195,76196,76199');
			paymentGroups[24723] = new paymentGroup(24723,'Large Groups','77904,76928,76929,76188,76189,76190,17802,76192,76193,76198,76194,76195,76196,76199');
			paymentGroups[23492] = new paymentGroup(23492,'Weddings, Portraits, Groups & Babies','76929,76188,76189,76190,17802,76192,76193,76198,76194,76195,76196,76199');
	/***************************************************************************
* 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;
}


