/* 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[24017] = new paymentOption(24017,'Wedding Package ','800.00');
paymentOptions[69581] = new paymentOption(69581,'Penumbra - Blue Series','100.00');
paymentOptions[38669] = new paymentOption(38669,'Fashion Shoot & Portfolio','750.00');
paymentOptions[30814] = new paymentOption(30814,'Website Training Package','1500.00');
paymentOptions[55553] = new paymentOption(55553,'Mic Y Mochyn Lefel 3','2.00');
paymentOptions[55554] = new paymentOption(55554,'Twm yr Hwrdd Lefel 1','2.00');
paymentOptions[47002] = new paymentOption(47002,'Boudoir Photo Shoot','250.00');
paymentOptions[81667] = new paymentOption(81667,'Full Day\'s Photography Tuition','150.00');
paymentOptions[55555] = new paymentOption(55555,'Twm yr Hwrdd Lefel 2','2.00');
paymentOptions[54562] = new paymentOption(54562,'Front Cover Image','300.00');
paymentOptions[54561] = new paymentOption(54561,'Magazine Stock Image','50.00');
paymentOptions[54560] = new paymentOption(54560,'Website Stock Image','25.00');
paymentOptions[55557] = new paymentOption(55557,'Mog y Gath Lefel 1','2.00');
paymentOptions[55558] = new paymentOption(55558,'Mog y Gath Lefel 2','2.00');
paymentOptions[81668] = new paymentOption(81668,'One Hour Studio Session -  Portraits Only','60.00');
paymentOptions[28401] = new paymentOption(28401,'Passport & I.D.','30.00');
paymentOptions[55559] = new paymentOption(55559,'Mog y Gath Lefel 3','2.00');
paymentOptions[35095] = new paymentOption(35095,'12x10','25.00');
paymentOptions[24020] = new paymentOption(24020,'10x8','15.00');
paymentOptions[24059] = new paymentOption(24059,'8x6','12.00');
paymentOptions[27941] = new paymentOption(27941,'7x5','8.00');
paymentOptions[26106] = new paymentOption(26106,'6x4','5.00');
paymentOptions[81776] = new paymentOption(81776,'High Res Download','30.00');
paymentOptions[81833] = new paymentOption(81833,'Low Res Images From Studio Sessions Only','5.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[16954] = new paymentGroup(16954,'Americymru','55553,55554,55555,54562,54561,54560,55557,55558,55559');
			paymentGroups[10388] = new paymentGroup(10388,'bethanlynnenerys','35095,24020,24059,27941,26106');
			paymentGroups[21455] = new paymentGroup(21455,'Blue Series','69581');
			paymentGroups[18160] = new paymentGroup(18160,'Corran Singers Concert','35095,24020,24059');
			paymentGroups[23680] = new paymentGroup(23680,'Laugharne Concert','');
			paymentGroups[11059] = new paymentGroup(11059,'Price List 2012','24017,38669,30814,47002,81667,54562,54561,54560,81668,28401,35095,24020,24059,27941,26106,81776,81833');
			paymentGroups[20094] = new paymentGroup(20094,'Schools','35095,24020,24059,27941,26106,81776,81833');
			paymentGroups[16535] = new paymentGroup(16535,'Stock Photography','54562,54561,54560');
	/***************************************************************************
* 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;
}


