/* 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[80759] = new paymentOption(80759,'6x4&quot;(or pan/sq alternative) print','8.50');
paymentOptions[80760] = new paymentOption(80760,'7x5&quot; (or pan/sq alternative) print','10.00');
paymentOptions[80761] = new paymentOption(80761,'9x6&quot;(or pan/sq alternative) print','14.00');
paymentOptions[80762] = new paymentOption(80762,'12x8&quot; (or pan/sq alternative) print','20.00');
paymentOptions[80763] = new paymentOption(80763,'5x5&quot; square','8.50');
paymentOptions[80764] = new paymentOption(80764,'8x8&quot; square','12.00');
paymentOptions[80765] = new paymentOption(80765,'10x10&quot; square','15.00');
paymentOptions[80766] = new paymentOption(80766,'8x4&quot; panoramic','10.00');
paymentOptions[80767] = new paymentOption(80767,'10x5&quot; panoramic','15.00');
paymentOptions[80769] = new paymentOption(80769,'digital image high res','25.00');
paymentOptions[80768] = new paymentOption(80768,'12x8&quot; (or pan/sq alternative) canvas','95.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[23682] = new paymentGroup(23682,'Event Photography','');
			paymentGroups[18314] = new paymentGroup(18314,'Portrait Album containing 10 selected images','');
			paymentGroups[18513] = new paymentGroup(18513,'Portrait Photography','');
			paymentGroups[9842] = new paymentGroup(9842,'Price Structure A','');
			paymentGroups[9844] = new paymentGroup(9844,'Price Structure B','');
			paymentGroups[14669] = new paymentGroup(14669,'Price Structure C - square images','80763,80764,80765,80769');
			paymentGroups[19656] = new paymentGroup(19656,'Price Structure D - Panoramic','80766,80767,80769');
			paymentGroups[18313] = new paymentGroup(18313,'Wedding Photography','80759,80760,80761,80762,80769,80768');
	/***************************************************************************
* 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;
}


