/* 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[73342] = new paymentOption(73342,'7x5&quot; in cardboard mount','10.00');
paymentOptions[73343] = new paymentOption(73343,'8x6&quot; in cardboard mount','12.00');
paymentOptions[73344] = new paymentOption(73344,'10x8&quot; in cardboard mount','15.00');
paymentOptions[73345] = new paymentOption(73345,'7x5&quot; in a silver frame','25.00');
paymentOptions[73346] = new paymentOption(73346,'8x6&quot; in a silver frame','30.00');
paymentOptions[73347] = new paymentOption(73347,'10x8&quot; in a silver frame','35.00');
paymentOptions[73348] = new paymentOption(73348,'7x5&quot; in a gold frame','25.00');
paymentOptions[73350] = new paymentOption(73350,'8x6&quot; in a gold frame','30.00');
paymentOptions[73352] = new paymentOption(73352,'10x8&quot; in a gold frame','35.00');
paymentOptions[73349] = new paymentOption(73349,'7x5&quot; in a black frame','25.00');
paymentOptions[73351] = new paymentOption(73351,'8x6&quot; in a black frame','30.00');
paymentOptions[73353] = new paymentOption(73353,'10x8&quot; in a black frame','35.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[22650] = new paymentGroup(22650,'wedding price list','73342,73343,73344,73345,73346,73347,73348,73350,73352,73349,73351,73353');
	/***************************************************************************
* 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;
}


