/* 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[30250] = new paymentOption(30250,'1 pack of 6x4&quot; cards COLOUR','2.95');
paymentOptions[62566] = new paymentOption(62566,'Keyring','2.00');
paymentOptions[62567] = new paymentOption(62567,'Quote Keyring','2.00');
paymentOptions[30252] = new paymentOption(30252,'1 pack of 6x4&quot; cards BLACK&WHITE','2.95');
paymentOptions[30251] = new paymentOption(30251,'1 pack of 5x7&quot; cards COLOUR','3.95');
paymentOptions[30253] = new paymentOption(30253,'1 pack of 5x7&quot; cards BLACK&WHITE','3.95');
paymentOptions[32399] = new paymentOption(32399,'A4 Limited Edition','20.00');
paymentOptions[62565] = new paymentOption(62565,'Fridge Magnet','3.50');
paymentOptions[32400] = new paymentOption(32400,'A3 Limited Edition','30.00');
paymentOptions[32401] = new paymentOption(32401,'A2 Limited Edition','40.00');
paymentOptions[6272] = new paymentOption(6272,'A4 Mounted  Print.','15.00');
paymentOptions[11524] = new paymentOption(11524,'A3 Mounted Print.','22.00');
paymentOptions[18668] = new paymentOption(18668,'A2 Mounted Print','32.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[2806] = new paymentGroup(2806,'Abstract','62566,62565,6272,11524,18668');
			paymentGroups[2808] = new paymentGroup(2808,'Animals','62566,62565,6272,11524,18668');
			paymentGroups[9280] = new paymentGroup(9280,'Cards','30250,30252,30251,30253');
			paymentGroups[19148] = new paymentGroup(19148,'Fridge Magnet','62565');
			paymentGroups[19149] = new paymentGroup(19149,'Keyring','62567');
			paymentGroups[2807] = new paymentGroup(2807,'Landscapes','62566,62565,6272,11524,18668');
			paymentGroups[10049] = new paymentGroup(10049,'LIMITED EDITION','32399,32400,32401');
			paymentGroups[3427] = new paymentGroup(3427,'Not for Sale','');
			paymentGroups[2809] = new paymentGroup(2809,'Still Life','62566,62565,6272,11524,18668');
	/***************************************************************************
* 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;
}


