/* 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[32556] = new paymentOption(32556,'7&quot;x5&quot;','9.00');
paymentOptions[32557] = new paymentOption(32557,'8&quot;x6&quot;','9.00');
paymentOptions[32558] = new paymentOption(32558,'8&quot;x8&quot;','9.00');
paymentOptions[32560] = new paymentOption(32560,'10&quot;x7&quot;','18.00');
paymentOptions[32561] = new paymentOption(32561,'10&quot;x8&quot;','18.00');
paymentOptions[32562] = new paymentOption(32562,'10&quot;x10&quot;','15.00');
paymentOptions[32563] = new paymentOption(32563,'A4','18.00');
paymentOptions[32564] = new paymentOption(32564,'12&quot;x8&quot;','18.00');
paymentOptions[32565] = new paymentOption(32565,'12&quot;x12&quot;','20.00');
paymentOptions[32566] = new paymentOption(32566,'14&quot;x11&quot;','24.00');
paymentOptions[32567] = new paymentOption(32567,'A3','35.00');
paymentOptions[32568] = new paymentOption(32568,'16&quot;x12&quot;','35.00');
paymentOptions[32569] = new paymentOption(32569,'20&quot;x16&quot;','48.00');
paymentOptions[32570] = new paymentOption(32570,'20&quot;x20&quot;','80.00');
paymentOptions[32571] = new paymentOption(32571,'24&quot;x20&quot;','80.00');
paymentOptions[32572] = new paymentOption(32572,'30&quot;x20&quot;','100.00');
paymentOptions[32573] = new paymentOption(32573,'30&quot;x30&quot;','150.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[10110] = new paymentGroup(10110,'Standard Price List 2008','32556,32557,32558,32560,32562,32563,32564,32565,32566,32567,32568,32569,32570,32571,32572,32573');
	/***************************************************************************
* 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;
}


