/* 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[81664] = new paymentOption(81664,'Two hour Private Tutorial ','35.00');
paymentOptions[1229] = new paymentOption(1229,'Greetings photo card C6 size','2.50');
paymentOptions[1226] = new paymentOption(1226,'7X5 Inches Mounted','6.00');
paymentOptions[44559] = new paymentOption(44559,'A4 Print only','12.00');
paymentOptions[27147] = new paymentOption(27147,'A4 Mounted','20.00');
paymentOptions[1238] = new paymentOption(1238,'12 X 16 Mounted','45.00');
paymentOptions[44560] = new paymentOption(44560,'12 X 16 inches Print only','22.00');
paymentOptions[61460] = new paymentOption(61460,'12 x 16 Inch canvas print','70.00');
paymentOptions[44561] = new paymentOption(44561,'20 X 16 Print only','30.00');
paymentOptions[61461] = new paymentOption(61461,'20 X 16 canvas print ','90.00');
paymentOptions[41702] = new paymentOption(41702,'20 X 16 Inches Mounted','55.00');
paymentOptions[11695] = new paymentOption(11695,'20 X 24    A2 Approx Print Only','45.00');
paymentOptions[11696] = new paymentOption(11696,'36 X 48 A1 Approx Print Only','60.00');
paymentOptions[61463] = new paymentOption(61463,'30 X 20 inch canvas print','115.00');
paymentOptions[61462] = new paymentOption(61462,'30 X 24 inch canvas print','120.00');
paymentOptions[61464] = new paymentOption(61464,'36 X 24 canvas print','155.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[0] = new paymentGroup(0,'Default group','81664,1229,1226,44559,27147,1238,44560,61460,44561,61461,41702,11695,11696,61463,61462,61464');
/***************************************************************************
* 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;
}


