/* 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[74843] = new paymentOption(74843,'40&quot;x13&quot;  - Print Only','90.00');
paymentOptions[79087] = new paymentOption(79087,'Gift Voucher ','20.00');
paymentOptions[74836] = new paymentOption(74836,'8&quot;x6&quot; Mounted Lustre','12.00');
paymentOptions[74837] = new paymentOption(74837,'6&quot;x4&quot; Lustre - Print Only','5.00');
paymentOptions[74838] = new paymentOption(74838,'7&quot;x5&quot; Lustre - Print Only','7.00');
paymentOptions[74835] = new paymentOption(74835,'10&quot;x8&quot; Mounted Lustre','16.00');
paymentOptions[77738] = new paymentOption(77738,'8&quot;x6&quot; Lustre - Print Only','9.00');
paymentOptions[74839] = new paymentOption(74839,'9&quot;x6&quot; Lustre - Print Only','10.00');
paymentOptions[79088] = new paymentOption(79088,'Gift Voucher ','50.00');
paymentOptions[73904] = new paymentOption(73904,'Portrait Session','50.00');
paymentOptions[79089] = new paymentOption(79089,'Gift Voucher ','100.00');
paymentOptions[74840] = new paymentOption(74840,'10&quot;x8&quot; Lustre - Print Only','12.00');
paymentOptions[74841] = new paymentOption(74841,'12&quot;x8&quot; Lustre - Print Only','16.00');
paymentOptions[74842] = new paymentOption(74842,'20&quot;x16&quot; Lustre - Print Only','55.00');
paymentOptions[79090] = new paymentOption(79090,'Gift Voucher ','150.00');
paymentOptions[79091] = new paymentOption(79091,'Gift Voucher ','200.00');
paymentOptions[79092] = new paymentOption(79092,'Gift Voucher','500.00');
paymentOptions[77751] = new paymentOption(77751,'Digital Download','20.00');
paymentOptions[76404] = new paymentOption(76404,'Canvas Print 16x12','250.00');
paymentOptions[76405] = new paymentOption(76405,'Canvas Print 20x16','450.00');
paymentOptions[76406] = new paymentOption(76406,'Canvas Print 24x20','550.00');
paymentOptions[81478] = new paymentOption(81478,'The Clarity Triple 8x6','195.00');
paymentOptions[81479] = new paymentOption(81479,'The Clarity triple 10x8','250.00');
paymentOptions[76407] = new paymentOption(76407,'Box Frame 12x10','130.00');
paymentOptions[76408] = new paymentOption(76408,'Box Frame 16x12','170.00');
paymentOptions[81480] = new paymentOption(81480,'The Clarity triple square 8x8','195.00');
paymentOptions[81481] = new paymentOption(81481,'The Clarity triple square 10x10','250.00');
paymentOptions[76409] = new paymentOption(76409,'Box Frame 20x16','270.00');
paymentOptions[76410] = new paymentOption(76410,'Acrylic Lifestyle 23x23 (9x 5x5)','750.00');
paymentOptions[81482] = new paymentOption(81482,'The Clarity 6up','350.00');
paymentOptions[76411] = new paymentOption(76411,'Premier Acrylic 20x16 (1x 16x12)','550.00');
paymentOptions[76412] = new paymentOption(76412,'Premier Acrylic 24x20 (1x 20x16)','650.00');
paymentOptions[76413] = new paymentOption(76413,'Premier Acrylic 30x11 (3x 8x8)','650.00');
paymentOptions[76414] = new paymentOption(76414,'Premier Acrylic 44x16 (3x 12x12)','850.00');
paymentOptions[76415] = new paymentOption(76415,'Desk Frame 7x5','30.00');
paymentOptions[76416] = new paymentOption(76416,'Desk Frame 8x6','40.00');
paymentOptions[76417] = new paymentOption(76417,'Desk Frame 10x8','50.00');
paymentOptions[79029] = new paymentOption(79029,'6x4','4.00');
paymentOptions[79030] = new paymentOption(79030,'7x5','5.00');
paymentOptions[79031] = new paymentOption(79031,'9x6','8.00');
paymentOptions[79033] = new paymentOption(79033,'10x8','10.00');
paymentOptions[79032] = new paymentOption(79032,'12x8','12.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[23115] = new paymentGroup(23115,'Fine Art','74843,81478,81479,81480,81481,81482');
			paymentGroups[24504] = new paymentGroup(24504,'Gift Vouchers','79087,79088,73904,79089,79090,79091,79092');
			paymentGroups[23114] = new paymentGroup(23114,'Headshots','74836,74835');
			paymentGroups[1712] = new paymentGroup(1712,'Individual Print Pricing','74837,74838,74839,74840,74841,74842,77751,76404,76405,76406,81478,81479,76407,76408,81480,81481,76409,76410,81482,76411,76412,76413,76414,76415,76416,76417');
			paymentGroups[13680] = new paymentGroup(13680,'Location Portrait Session','');
			paymentGroups[24470] = new paymentGroup(24470,'Op Tour','79029,79030,79031,79033,79032');
			paymentGroups[13678] = new paymentGroup(13678,'Portrait Session','73904');
			paymentGroups[15478] = new paymentGroup(15478,'Prints Packages','81478,81479,81480,81481,81482');
			paymentGroups[23993] = new paymentGroup(23993,'Summer Ball','74837,74838,77738,74839,74840,74841,77751,76415,76416');
	/***************************************************************************
* 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;
}


