/* 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[57215] = new paymentOption(57215,'Large print mounted to 20x16&quot;','45.00');
paymentOptions[57268] = new paymentOption(57268,'Print mounted to 20x13&quot;','45.00');
paymentOptions[57270] = new paymentOption(57270,'Large print mounted to 18x14&quot;','38.00');
paymentOptions[81401] = new paymentOption(81401,'Large print mounted to 20x15&quot;','45.00');
paymentOptions[57267] = new paymentOption(57267,'Print mounted to 14x9.5&quot;','25.00');
paymentOptions[81402] = new paymentOption(81402,'Small print mounted to 14x10&quot;','25.00');
paymentOptions[57269] = new paymentOption(57269,'12x8&quot; print mounted to 14x11&quot;','10.00');
paymentOptions[59500] = new paymentOption(59500,'3 x A6 Greeting Cards','5.00');
paymentOptions[57214] = new paymentOption(57214,'Small print mounted to 14x11&quot;','25.00');
paymentOptions[66312] = new paymentOption(66312,'Pack of Greeting Cards','10.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[21901] = new paymentGroup(21901,'Large limited edition print','57215');
			paymentGroups[17546] = new paymentGroup(17546,'Limited Edition 18x14','57270,57214');
			paymentGroups[25186] = new paymentGroup(25186,'Limited Edition 20x15','81401,81402');
			paymentGroups[19789] = new paymentGroup(19789,'Limited Edition large thin print','57268');
			paymentGroups[17543] = new paymentGroup(17543,'Limited Edition small only','57214');
			paymentGroups[17544] = new paymentGroup(17544,'Limited Edition thin print','57268,57267');
			paymentGroups[17545] = new paymentGroup(17545,'Open Edition Print','57269,59500');
			paymentGroups[20281] = new paymentGroup(20281,'Pack of Greeting Cards','66312');
			paymentGroups[17531] = new paymentGroup(17531,'Standard limited Edition Prints','57215,57214');
	/***************************************************************************
* 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;
}


