/* 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[24877] = new paymentOption(24877,'A4 Inch Print Gloss','34.99');
paymentOptions[24878] = new paymentOption(24878,'A4 Inch Print Luster','34.99');
paymentOptions[24879] = new paymentOption(24879,'A3+ Inch Print Gloss','49.99');
paymentOptions[24880] = new paymentOption(24880,'A3+ Inch Print Luster','49.99');
paymentOptions[31284] = new paymentOption(31284,'8 x 8 Inch Gloss','34.99');
paymentOptions[31285] = new paymentOption(31285,'8 x 8 Inch Luster','34.99');
paymentOptions[31286] = new paymentOption(31286,'12 x 12 Inch Gloss','49.99');
paymentOptions[31287] = new paymentOption(31287,'12 x 12 Inch Luster','49.99');
paymentOptions[31289] = new paymentOption(31289,'19 Inch Panoramic Luster','44.99');
paymentOptions[31290] = new paymentOption(31290,'19 Inch Panoramic Gloss','44.99');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[7562] = new paymentGroup(7562,'Photobox Large','24877,24878,24879,24880');
			paymentGroups[9668] = new paymentGroup(9668,'Photobox Panoramic','31289,31290');
			paymentGroups[9667] = new paymentGroup(9667,'Photobox Small','24877,24878');
			paymentGroups[9666] = new paymentGroup(9666,'Photobox Square','31284,31285,31286,31287');
	/***************************************************************************
* 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 + ' - &euro;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


