/* 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[20876] = new paymentOption(20876,'7inx5in lustre inc. U.K. p&p','10.00');
paymentOptions[20880] = new paymentOption(20880,'Not available for sale','0.00');
paymentOptions[20882] = new paymentOption(20882,'7inx5in gloss inc. U.K. p&p','10.00');
paymentOptions[20877] = new paymentOption(20877,'8inx6in lustre inc. U.K. p&p','15.00');
paymentOptions[20883] = new paymentOption(20883,'8inx6in gloss inc. U.K. p&p ','15.00');
paymentOptions[20878] = new paymentOption(20878,'10inx8in lustre inc. U.K. p&p','17.00');
paymentOptions[20884] = new paymentOption(20884,'10inx8in gloss inc. U.K. p&p ','17.00');
paymentOptions[20879] = new paymentOption(20879,'12inx10in lustre inc. U.K. p&p','20.00');
paymentOptions[20885] = new paymentOption(20885,'12inx10in gloss inc.U.K. p&p ','20.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[6217] = new paymentGroup(6217,'Cheshire','20880');
			paymentGroups[6220] = new paymentGroup(6220,'Chester','20876,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[6218] = new paymentGroup(6218,'Countryside','20876,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[7135] = new paymentGroup(7135,'Flower Abstracts','20876,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[10808] = new paymentGroup(10808,'Flowers','20876,20880,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[6221] = new paymentGroup(6221,'Gardens','20876,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[6219] = new paymentGroup(6219,'Heritage','20876,20882,20877,20883,20878,20884,20879,20885');
			paymentGroups[6222] = new paymentGroup(6222,'Places','20876,20882,20877,20883,20878,20884,20879,20885');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


