/* 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[24981] = new paymentOption(24981,'A4 20cmsx30cms inkjet','40.00');
paymentOptions[25717] = new paymentOption(25717,'A4 20cmsx30cms matt','20.00');
paymentOptions[25718] = new paymentOption(25718,'A3 30cmsx40cms inkjet','50.00');
paymentOptions[25316] = new paymentOption(25316,'A3 30cmsx40cms matt','30.00');
paymentOptions[25741] = new paymentOption(25741,'A2 24&quot;x16&quot; Inkjet','95.00');
paymentOptions[25742] = new paymentOption(25742,'A2 24&quot;x16&quot; matt','60.00');
paymentOptions[25319] = new paymentOption(25319,'A2 24&quot;x16&quot; c-type on MDF','180.00');
paymentOptions[25321] = new paymentOption(25321,'A2 24&quot;x16&quot; canvas print','150.00');
paymentOptions[25745] = new paymentOption(25745,'A1 30&quot;x20&quot; Inkjet print','140.00');
paymentOptions[25744] = new paymentOption(25744,'A1 30&quot;x20&quot; matt','80.00');
paymentOptions[24980] = new paymentOption(24980,'A1 30&quot;x20&quot; c-type on MDF','250.00');
paymentOptions[25320] = new paymentOption(25320,'A1 30&quot;x20&quot; canvas print','275.00');
paymentOptions[25711] = new paymentOption(25711,'30&quot;x12&quot; c-type print','80.00');
paymentOptions[25306] = new paymentOption(25306,'30&quot;x12&quot; Inkjet Print','140.00');
paymentOptions[25317] = new paymentOption(25317,'30&quot;x12&quot; canvas print','275.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[7843] = new paymentGroup(7843,'Canvas Prints','25321,25320,25317');
			paymentGroups[7749] = new paymentGroup(7749,'Limited Editions','25319,24980');
			paymentGroups[7844] = new paymentGroup(7844,'Panoramas','25711,25306');
			paymentGroups[7748] = new paymentGroup(7748,'Unlimited Editions','24981,25717,25718,25316,25741,25742,25745,25744');
	/***************************************************************************
* 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;
}


