/* 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[37780] = new paymentOption(37780,'First Selection Book (UK ONLY)','23.95');
paymentOptions[36918] = new paymentOption(36918,'Every Now & Then Book (UK ONLY)','23.95');
paymentOptions[36539] = new paymentOption(36539,'A4 (210mmx297mm) Archival Print','24.00');
paymentOptions[53575] = new paymentOption(53575,'Slide Show on DVD','17.95');
paymentOptions[36540] = new paymentOption(36540,'12&quot; x 16&quot; Archival Print','44.00');
paymentOptions[39434] = new paymentOption(39434,'16&quot; x 22&quot; Archival Print (Rolled)','60.00');
paymentOptions[36595] = new paymentOption(36595,'20&quot; x 14&quot; Canvas Print (UK ONLY)','115.00');
paymentOptions[36545] = new paymentOption(36545,'36&quot; x 26&quot; Canvas Print (UK ONLY)','220.00');
paymentOptions[36994] = new paymentOption(36994,'DVD Film','17.95');
paymentOptions[38045] = new paymentOption(38045,'Set of 8 \'Rural\' Cards','24.00');
paymentOptions[38047] = new paymentOption(38047,'Set of 8 \'Boat\' Cards','24.00');
paymentOptions[38049] = new paymentOption(38049,'Set of 8 \'Children\' Cards','24.00');
paymentOptions[38050] = new paymentOption(38050,'Set of 8 \'People\' Cards','24.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[11447] = new paymentGroup(11447,'DVD','36994');
			paymentGroups[11405] = new paymentGroup(11405,'ENT Book','36918');
			paymentGroups[11664] = new paymentGroup(11664,'First Selection Book','37780');
			paymentGroups[11746] = new paymentGroup(11746,'GC Boats','38047');
			paymentGroups[11748] = new paymentGroup(11748,'GC Children','38049');
			paymentGroups[11747] = new paymentGroup(11747,'GC people','38050');
			paymentGroups[11749] = new paymentGroup(11749,'GC Rural','38045');
			paymentGroups[11410] = new paymentGroup(11410,'Prints','36539,36540,39434,36595,36545');
			paymentGroups[16242] = new paymentGroup(16242,'Slide Show DVD','53575');
	/***************************************************************************
* 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;
}


