/* 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[73741] = new paymentOption(73741,'10&quot; x 8&quot; print','20.00');
paymentOptions[63712] = new paymentOption(63712,'12&quot; x 18&quot; print','25.00');
paymentOptions[63713] = new paymentOption(63713,'Digital file (jpg 1600 x 1200px 72dpi)','5.00');
paymentOptions[73754] = new paymentOption(73754,'Alternative print size I','20.00');
paymentOptions[73755] = new paymentOption(73755,'Alternative print size II','25.00');
paymentOptions[73746] = new paymentOption(73746,'Wedding Booking Fee','125.00');
paymentOptions[73748] = new paymentOption(73748,'&quot;Package A&quot; balance','350.00');
paymentOptions[73749] = new paymentOption(73749,'&quot;Package B&quot; balance','425.00');
paymentOptions[73750] = new paymentOption(73750,'&quot;Package C&quot; balance','600.00');
paymentOptions[73751] = new paymentOption(73751,'&quot;Package D&quot; balance','675.00');
paymentOptions[73747] = new paymentOption(73747,'Additional Hours','50.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[14828] = new paymentGroup(14828,'Digital only','63713');
			paymentGroups[22776] = new paymentGroup(22776,'Payments','73754,73755,73746,73748,73749,73750,73751,73747');
			paymentGroups[14827] = new paymentGroup(14827,'Standard','73741,63712,63713');
	/***************************************************************************
* 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;
}


