/* 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[16881] = new paymentOption(16881,'Sitting Fee plus first inclusive photograph','92.50');
paymentOptions[17364] = new paymentOption(17364,'Sitting Fee plus 12 x 8 photograph','95.00');
paymentOptions[16882] = new paymentOption(16882,'Second inclusive photograph','0.00');
paymentOptions[16889] = new paymentOption(16889,'Third inclusive photograph','0.00');
paymentOptions[16890] = new paymentOption(16890,'Fourth inclusive photograph','0.00');
paymentOptions[27057] = new paymentOption(27057,'6&quot; x 4&quot; lustre print','10.00');
paymentOptions[10378] = new paymentOption(10378,'6&quot; x 4&quot; mounted lustre print','12.50');
paymentOptions[29734] = new paymentOption(29734,'6&quot; x 4&quot; gloss print','10.00');
paymentOptions[29735] = new paymentOption(29735,'6&quot; x 4&quot; mounted gloss print','12.50');
paymentOptions[29736] = new paymentOption(29736,'7.5&quot; x 5&quot; lustre print','12.50');
paymentOptions[44587] = new paymentOption(44587,'7.5&quot; x 5&quot; mounted lustre print','15.00');
paymentOptions[29737] = new paymentOption(29737,'7.5&quot; x 5&quot; gloss print','12.50');
paymentOptions[44588] = new paymentOption(44588,'7.5&quot; x 5&quot; mounted gloss print','15.00');
paymentOptions[18400] = new paymentOption(18400,'9&quot; x 6&quot; lustre print (Recommended size)','15.00');
paymentOptions[27056] = new paymentOption(27056,'9&quot; x 6&quot; mounted lustre print (Recommended size)','17.50');
paymentOptions[29800] = new paymentOption(29800,'9&quot; x 6&quot; gloss print (Recommended size)','15.00');
paymentOptions[29801] = new paymentOption(29801,'9&quot; x 6&quot; mounted gloss print (Recommended size)','17.50');
paymentOptions[21731] = new paymentOption(21731,'10&quot; x 8&quot; lustre print (This size will not contain the full image & is &quot;cropped&quot;)','20.00');
paymentOptions[10383] = new paymentOption(10383,'12&quot; x 8&quot; lustre print ','21.00');
paymentOptions[27058] = new paymentOption(27058,'12&quot; x 8&quot; mounted lustre print','24.00');
paymentOptions[27218] = new paymentOption(27218,'12&quot;x12&quot; lustre print (for square images only)','23.00');
paymentOptions[22170] = new paymentOption(22170,'15&quot; X 10&quot; lustre print','27.50');
paymentOptions[22172] = new paymentOption(22172,'18&quot; x 12&quot; lustre print','32.50');
paymentOptions[10388] = new paymentOption(10388,'6&quot; x 4&quot; matt (events)','7.50');
paymentOptions[13225] = new paymentOption(13225,'6&quot; x 4&quot; gloss (events)','7.50');
paymentOptions[10389] = new paymentOption(10389,'7.5&quot; x 5&quot; lustre (events)','9.00');
paymentOptions[13226] = new paymentOption(13226,'7.5&quot; x 5&quot; gloss (events)','9.00');
paymentOptions[10398] = new paymentOption(10398,'9&quot; x 6&quot; lustre (RECOMMENDED SIZE, events)','10.00');
paymentOptions[13227] = new paymentOption(13227,'9&quot; x 6&quot; gloss (RECOMMENDED SIZE, events)','10.00');
paymentOptions[74094] = new paymentOption(74094,'9&quot; x 6&quot; LUSTRE FREE PHOTOGRAPH (only add if you have ordered two other 9&quot;x6&quot; and this is the same horse and rider.)','0.00');
paymentOptions[74095] = new paymentOption(74095,'9&quot; x 6&quot; GLOSS FREE PHOTOGRAPH (only add if you have ordered two other 9&quot;x6&quot; and this is the same horse and rider.)','0.00');
paymentOptions[42125] = new paymentOption(42125,'9&quot; x 6&quot; gloss mounted print in cream mount','12.50');
paymentOptions[13823] = new paymentOption(13823,'9&quot; X 6&quot; lustre mounted print in cream mount','12.50');
paymentOptions[10390] = new paymentOption(10390,'12&quot; x 8&quot; lustre (events)','16.00');
paymentOptions[13229] = new paymentOption(13229,'12&quot;x 8&quot; gloss (events)','16.00');
paymentOptions[13230] = new paymentOption(13230,'18&quot; x 12&quot; matt poster (events)','25.00');
paymentOptions[64452] = new paymentOption(64452,'7.5&quot; x 5&quot; gloss','8.00');
paymentOptions[64451] = new paymentOption(64451,'7.5&quot; x 5&quot; lustre','8.00');
paymentOptions[64453] = new paymentOption(64453,'9&quot; x 6&quot; gloss','9.00');
paymentOptions[64454] = new paymentOption(64454,'9&quot; x 6&quot; lustre','9.00');
paymentOptions[64455] = new paymentOption(64455,'12&quot; x 8&quot; gloss','10.00');
paymentOptions[64456] = new paymentOption(64456,'12&quot; x 8&quot; lustre','10.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[3070] = new paymentGroup(3070,'(1) Portraits & Weddings','29736,44587,29737,44588,18400,27056,29800,29801,10383,22170,22172');
			paymentGroups[3071] = new paymentGroup(3071,'(2) Equestrian Events','10389,13226,10398,13227,74094,74095,42125,13823,10390,13229');
			paymentGroups[19696] = new paymentGroup(19696,'Events','64452,64451,64453,64454,64455,64456');
			paymentGroups[4486] = new paymentGroup(4486,'For Sale','21731');
			paymentGroups[5083] = new paymentGroup(5083,'Portrait Sitting','16881,16882,16889,16890,10383,27218,22170,22172');
			paymentGroups[5266] = new paymentGroup(5266,'Portrait Sitting (12 x 8)','17364,10383,27218,22170,22172');
			paymentGroups[4931] = new paymentGroup(4931,'Portraits','18400,27056,29800,29801,21731,10383,27058,27218,22170,22172');
	/***************************************************************************
* 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;
}


