/* 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[3638] = new paymentOption(3638,'4 x 6','15.00');
paymentOptions[3639] = new paymentOption(3639,'5 x 7','25.00');
paymentOptions[3135] = new paymentOption(3135,'5 x 7','12.00');
paymentOptions[3136] = new paymentOption(3136,'6 x 8','20.00');
paymentOptions[3640] = new paymentOption(3640,'6 x 8','30.00');
paymentOptions[3641] = new paymentOption(3641,'8 x 10','40.00');
paymentOptions[3137] = new paymentOption(3137,'10 x 8','25.00');
paymentOptions[3138] = new paymentOption(3138,'14 x 12','60.00');
paymentOptions[3139] = new paymentOption(3139,'20 x 16','80.00');
paymentOptions[4235] = new paymentOption(4235,'20 x 16','90.00');
paymentOptions[3642] = new paymentOption(3642,'20 x 24','135.00');
paymentOptions[3614] = new paymentOption(3614,'T108 20 x 24 framed print','135.00');
paymentOptions[3632] = new paymentOption(3632,'T100 9 x 23 framed prints ','93.00');
paymentOptions[3633] = new paymentOption(3633,'T71 11 x 30 framed pints','131.00');
paymentOptions[3634] = new paymentOption(3634,'T72 11 x 30 framed prints','150.00');
paymentOptions[3635] = new paymentOption(3635,'T110 11 x 30 framed prints','145.50');
paymentOptions[3636] = new paymentOption(3636,'T107 20 x 24 framed prints','175.00');
paymentOptions[3637] = new paymentOption(3637,'T601 20 x 20 framed print','195.00');
paymentOptions[3776] = new paymentOption(3776,'7&quot; x 5&quot; Comb-Bound Album - containing 20 photos','200.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[773] = new paymentGroup(773,'Packages','3638,3639,3135,3136,3640,3641,3614,3632,3633,3634,3635,3636,3637,3776');
			paymentGroups[1868] = new paymentGroup(1868,'Payments','');
			paymentGroups[595] = new paymentGroup(595,'Portraits','3638,3639,3640,3641,3138,4235,3642');
			paymentGroups[596] = new paymentGroup(596,'Weddings & Special occasions','3135,3136,3137,3138,3139,3776');
	/***************************************************************************
* 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;
}


