/* 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[47257] = new paymentOption(47257,'2011 Fire Skies REFILL Calendar UK only','5.95');
paymentOptions[32146] = new paymentOption(32146,'2011 Fire Skies Calendar UK ONLY','6.95');
paymentOptions[47256] = new paymentOption(47256,'2011 Fire Skies REFILL Calendar NON UK','8.00');
paymentOptions[34633] = new paymentOption(34633,'2011 Fire Skies Calendar NON UK','10.00');
paymentOptions[19806] = new paymentOption(19806,'CANVAS SALE','85.00');
paymentOptions[32213] = new paymentOption(32213,'1 Cuba + 1 Beaches Calendar UK ONLY','16.00');
paymentOptions[32188] = new paymentOption(32188,'2 x 2010 Cuba Calendars UK ONLY','16.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[9962] = new paymentGroup(9962,'2010 Beaches Calendar','47257,32146,47256,34633');
			paymentGroups[1226] = new paymentGroup(1226,'5D','');
			paymentGroups[5952] = new paymentGroup(5952,'CANVAS SALE','19806');
			paymentGroups[8362] = new paymentGroup(8362,'Giclee Ltd Ed','');
			paymentGroups[8363] = new paymentGroup(8363,'Giclee Pano','');
			paymentGroups[1297] = new paymentGroup(1297,'Ltd Canvas 15 x 40','');
			paymentGroups[1295] = new paymentGroup(1295,'Ltd Canvas 20 x 20','');
			paymentGroups[1296] = new paymentGroup(1296,'Ltd Canvas 20 x 30','');
			paymentGroups[1301] = new paymentGroup(1301,'Ltd PG1','');
			paymentGroups[1302] = new paymentGroup(1302,'Ltd PG2','');
			paymentGroups[1298] = new paymentGroup(1298,'Ltd Print 12 x 16','');
			paymentGroups[1294] = new paymentGroup(1294,'Ltd Print 16 x 20','');
			paymentGroups[1209] = new paymentGroup(1209,'Older pictures','');
			paymentGroups[5953] = new paymentGroup(5953,'PINS SALE','');
			paymentGroups[2780] = new paymentGroup(2780,'Yorkshire Calendar 2007','');
	/***************************************************************************
* 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;
}


