/* 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[9643] = new paymentOption(9643,' Frame to fit A4 image','15.00');
paymentOptions[15810] = new paymentOption(15810,'Miniature print up to 8x6 inch','4.00');
paymentOptions[54637] = new paymentOption(54637,'Acrylic from','85.00');
paymentOptions[69138] = new paymentOption(69138,'300 kb file for web use','30.00');
paymentOptions[9647] = new paymentOption(9647,' Frame to fit A3 image','35.00');
paymentOptions[9807] = new paymentOption(9807,'Frame for A4 image','40.00');
paymentOptions[9808] = new paymentOption(9808,'Frame for A3 image','45.00');
paymentOptions[15811] = new paymentOption(15811,'8x10 inch print','7.00');
paymentOptions[15812] = new paymentOption(15812,'5x7 inch print in blue standing mount','6.00');
paymentOptions[7605] = new paymentOption(7605,'A4 Print only','20.00');
paymentOptions[7613] = new paymentOption(7613,'A4 Print only with p&p within U.K.','23.00');
paymentOptions[9645] = new paymentOption(9645,'A3 Print only','30.00');
paymentOptions[9646] = new paymentOption(9646,'A3 print only with p&p within U.K','33.00');
paymentOptions[21094] = new paymentOption(21094,'Gallery Wrapped Canvas 20 inches x 28 inches','85.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[2893] = new paymentGroup(2893,'Images','54637,69138,7605,7613,9645,9646,21094');
			paymentGroups[2892] = new paymentGroup(2892,'Standard  A3 Frame','9647');
			paymentGroups[2932] = new paymentGroup(2932,'Superior frames','9807,9808');
	/***************************************************************************
* 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;
}


