/* 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[20364] = new paymentOption(20364,'9 x 6 Print','6.00');
paymentOptions[20369] = new paymentOption(20369,'9 x 6 Print (inc P&P)','7.50');
paymentOptions[20370] = new paymentOption(20370,'12 x 8 Print (Inc P&P)','17.50');
paymentOptions[20365] = new paymentOption(20365,'12 x 8 Print','16.00');
paymentOptions[21569] = new paymentOption(21569,'30 x 20 Print (inc postage)','50.00');
paymentOptions[21570] = new paymentOption(21570,'30 x 20 Print','48.00');
paymentOptions[20367] = new paymentOption(20367,'12 Page Desk Calendar','18.00');
paymentOptions[20372] = new paymentOption(20372,'12 Page Desk Calendar (Inc P&P)','20.00');
paymentOptions[31528] = new paymentOption(31528,'Digital File','25.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[6083] = new paymentGroup(6083,'Paypal Print Prices','20369,20370,21569,20372,31528');
			paymentGroups[6082] = new paymentGroup(6082,'Print Prices','20364,20365,21570,20367');
	/***************************************************************************
* 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;
}


