/* 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[50604] = new paymentOption(50604,'10\'\'x\'\'8 Fuji Cristal Archive Print','35.00');
paymentOptions[50605] = new paymentOption(50605,'12&quot; x 10&quot; Fuji Cristal Archive Print','45.00');
paymentOptions[50606] = new paymentOption(50606,'12&quot; x 16&quot; Fuji Cristal Archive Print ','60.00');
paymentOptions[50609] = new paymentOption(50609,'20&quot; x 24&quot; Fuji Cristal Archive Print ','100.00');
paymentOptions[50621] = new paymentOption(50621,'20&quot; x 24&quot; Mounted Print - Foamex ','140.00');
paymentOptions[50610] = new paymentOption(50610,'20&quot; x 24&quot; Hahnemuhle Print ','120.00');
paymentOptions[50611] = new paymentOption(50611,'30\'\' x 20\'\' Fuji Cristal Archive Print ','120.00');
paymentOptions[50622] = new paymentOption(50622,'30\'\' x 20\'\' Mounted Print - Foamex ','160.00');
paymentOptions[50612] = new paymentOption(50612,'30\'\' x 20\'\'  Hahnemuhle Print ','140.00');
paymentOptions[50619] = new paymentOption(50619,'600x500mm Artist Canvas 400gsm ','180.00');
paymentOptions[50620] = new paymentOption(50620,'750x500mm Artist Canvas 400gsm','220.00');
paymentOptions[50919] = new paymentOption(50919,'20&quot;x24&quot; Poster Print inc.P&P','35.00');
paymentOptions[50920] = new paymentOption(50920,'Greetings Card Set of 8 inc.P&P','9.90');
paymentOptions[50921] = new paymentOption(50921,'2010  A3 Calendar inc.P&P','14.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[15442] = new paymentGroup(15442,'CALENDARS','50921');
			paymentGroups[15441] = new paymentGroup(15441,'GREETINGS CARDS','50920');
			paymentGroups[15440] = new paymentGroup(15440,'POSTER','50919');
			paymentGroups[15437] = new paymentGroup(15437,'PRINTS','50604,50605,50606,50609,50621,50610,50611,50622,50612,50619,50620');
	/***************************************************************************
* 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;
}


