/* 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[31366] = new paymentOption(31366,'Gentleman\'s Hank - blue','12.95');
paymentOptions[31367] = new paymentOption(31367,'Gentleman\'s Hank - green','6.45');
paymentOptions[31368] = new paymentOption(31368,'Gentleman\'s Hank - red','12.95');
paymentOptions[15713] = new paymentOption(15713,'Hankies','9.95');
paymentOptions[25735] = new paymentOption(25735,'Hot Pink box','1.50');
paymentOptions[25736] = new paymentOption(25736,'Blue box','1.75');
paymentOptions[39031] = new paymentOption(39031,'One in a Million','12.95');
paymentOptions[49965] = new paymentOption(49965,'Turtle Doves lilac','9.95');
paymentOptions[49966] = new paymentOption(49966,'Turtle Doves pink','9.95');
paymentOptions[57829] = new paymentOption(57829,'My Only Sunshine','4.95');
paymentOptions[57830] = new paymentOption(57830,'Best Of Luck','4.95');
paymentOptions[66138] = new paymentOption(66138,'Gone Fishing','12.95');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[4725] = new paymentGroup(4725,'Baby, B Mine','15713');
			paymentGroups[4704] = new paymentGroup(4704,'Best of Luck','57830');
			paymentGroups[4699] = new paymentGroup(4699,'Confetti','15713');
			paymentGroups[4701] = new paymentGroup(4701,'Daisy Daisy','15713');
			paymentGroups[4683] = new paymentGroup(4683,'Forget Me Not','15713');
			paymentGroups[4706] = new paymentGroup(4706,'Gentleman\'s Hank - blue','31366,31367,31368');
			paymentGroups[9690] = new paymentGroup(9690,'Gentleman\'s Hank - green','31366,31367,31368');
			paymentGroups[9691] = new paymentGroup(9691,'Gentleman\'s Hank - red','31366,31367,31368');
			paymentGroups[4708] = new paymentGroup(4708,'Gift Boxes','');
			paymentGroups[7856] = new paymentGroup(7856,'Gift Boxes NEW','25735,25736');
			paymentGroups[20238] = new paymentGroup(20238,'Gone Fishing','66138');
			paymentGroups[4703] = new paymentGroup(4703,'Love and Pride','15713');
			paymentGroups[5119] = new paymentGroup(5119,'My Only Sunshine','57829');
			paymentGroups[4705] = new paymentGroup(4705,'One In A Million','39031');
			paymentGroups[4828] = new paymentGroup(4828,'Social Butterfly','15713');
			paymentGroups[15184] = new paymentGroup(15184,'Turtle Doves lilac','49965,49966');
			paymentGroups[15185] = new paymentGroup(15185,'Turtle Doves pink','49965,49966');
	/***************************************************************************
* 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;
}


