/* 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[84018] = new paymentOption(84018,'One Helium Balloon (with flower order)','5.00');
paymentOptions[84019] = new paymentOption(84019,'Front Facing Arrangement (inc delivery)','40.00');
paymentOptions[57636] = new paymentOption(57636,'Bouquet of Mixed Flowers (inc delivery)','25.00');
paymentOptions[57637] = new paymentOption(57637,'Hand-Tied in Water with mixed Flowers (inc delivery)','30.00');
paymentOptions[57638] = new paymentOption(57638,'Basket of Mixed Flowers Arrangement (inc delivery)','20.00');
paymentOptions[57639] = new paymentOption(57639,'Planted bowl (inc delivery)','30.00');
paymentOptions[57641] = new paymentOption(57641,'Vase of Flowers inc delivery','30.00');
paymentOptions[57642] = new paymentOption(57642,'Orchid Plant (inc. delivery)','23.00');
paymentOptions[57778] = new paymentOption(57778,'Designer Arrangement (inc delivery)','50.00');
paymentOptions[57780] = new paymentOption(57780,'Vase Lillies (inc delivery)','50.00');
paymentOptions[57781] = new paymentOption(57781,'12 Roses Handtied (inc delivery)','45.00');
paymentOptions[84017] = new paymentOption(84017,'Posy Arrangement (inc delivery)','20.00');
paymentOptions[84020] = new paymentOption(84020,'Classic Funeral Wreath (inc delivery)','45.00');
paymentOptions[84021] = new paymentOption(84021,'Teardrop Funeral Spray','45.00');
paymentOptions[84022] = new paymentOption(84022,'Classic Funeral Sheaf','35.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[17721] = new paymentGroup(17721,'12 Roses Handtied (inc delivery)','57781');
			paymentGroups[17671] = new paymentGroup(17671,'Basket of Mixed Flowers Arrangement (inc delivery)','57638');
			paymentGroups[17669] = new paymentGroup(17669,'Bouquet of Mixed Flowers (inc delivery)','57636');
			paymentGroups[26071] = new paymentGroup(26071,'Classic Funeral Sheaf (inc delivery)','84022');
			paymentGroups[26069] = new paymentGroup(26069,'Classic Funeral Wreath (inc delivery)','84020');
			paymentGroups[17719] = new paymentGroup(17719,'Designer Arrangement (inc delivery)','57778');
			paymentGroups[26068] = new paymentGroup(26068,'Front Facing Arrangement (inc delivery)','84019');
			paymentGroups[17670] = new paymentGroup(17670,'Hand-Tied in Water with mixed flowers (inc delivery)','57637');
			paymentGroups[26067] = new paymentGroup(26067,'One Helium Balloon (with flower order)','84018');
			paymentGroups[17674] = new paymentGroup(17674,'Orchid Plant (inc delivery)','57642');
			paymentGroups[17672] = new paymentGroup(17672,'Planted Bowl (inc delivery)','57639');
			paymentGroups[26066] = new paymentGroup(26066,'Posy Arrangement (inc delivery)','84017');
			paymentGroups[26070] = new paymentGroup(26070,'Teardrop Funeral Spray (inc delivery)','84021');
			paymentGroups[17720] = new paymentGroup(17720,'Vase Lillies (inc delivery)','57780');
			paymentGroups[17673] = new paymentGroup(17673,'Vase of Flowers (inc delivery)','57641');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		$.each(paymentGroups[payment_groups_id].options, function(i){
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - &pound;' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


