/* 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[9400] = new paymentOption(9400,'A4 Archival Print (Worldwide)','24.00');
paymentOptions[9401] = new paymentOption(9401,'12&quot; x 16&quot;  Archival Print (UK Only)','44.00');
paymentOptions[65202] = new paymentOption(65202,'16&quot; x 22&quot; Archival Print (Worldwide)','60.00');
paymentOptions[19669] = new paymentOption(19669,'Canvas - 20&quot;x14&quot; (UK Only)','115.00');
paymentOptions[14898] = new paymentOption(14898,'Canvas - 36&quot;x24&quot;  (UK Only)','220.00');
paymentOptions[9402] = new paymentOption(9402,'Book (UK Only)','9.95');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[2818] = new paymentGroup(2818,'12&quot; x 16&quot; Archival Print','9400,9401,65202,19669,14898');
			paymentGroups[19900] = new paymentGroup(19900,'16&quot; x 22&quot; Archival Print (Rolled)','65202');
			paymentGroups[5891] = new paymentGroup(5891,'3 x Calendar','');
			paymentGroups[2817] = new paymentGroup(2817,'A4 Archival Print','9400,9401,65202,19669,14898');
			paymentGroups[2816] = new paymentGroup(2816,'Book','9402');
			paymentGroups[5880] = new paymentGroup(5880,'Calendar','');
			paymentGroups[5901] = new paymentGroup(5901,'Canvas - 20&quot;x14&quot;','9400,9401,65202,19669,14898');
			paymentGroups[4480] = new paymentGroup(4480,'Canvas - 36&quot;x24&quot;','9400,9401,65202,19669,14898');
	/***************************************************************************
* 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;
}


