/* 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[81423] = new paymentOption(81423,'6&quot;x 6&quot; digital print (mounted)','15.00');
paymentOptions[81424] = new paymentOption(81424,'6&quot;x 6&quot; digital print (framed)','25.00');
paymentOptions[81425] = new paymentOption(81425,'10&quot;x 10&quot; digital print (mounted)','35.00');
paymentOptions[81426] = new paymentOption(81426,'10&quot;x 10&quot; digital print (framed)','60.00');
paymentOptions[81427] = new paymentOption(81427,'16&quot;x 16&quot; digital print (mounted)','80.00');
paymentOptions[81428] = new paymentOption(81428,'16&quot;x 16&quot; digital print (framed)','125.00');
paymentOptions[30223] = new paymentOption(30223,'7&quot;x 5&quot; digital print (mounted)','15.00');
paymentOptions[30224] = new paymentOption(30224,'7&quot;x 5&quot; digital print (framed)','25.00');
paymentOptions[30227] = new paymentOption(30227,'11&quot;x 8&quot; digital print (mounted)','35.00');
paymentOptions[30228] = new paymentOption(30228,'11&quot;x 8&quot; digital print (framed)','60.00');
paymentOptions[30231] = new paymentOption(30231,'16&quot;x 12&quot; digital print (mounted)','75.00');
paymentOptions[30232] = new paymentOption(30232,'16&quot;x 12&quot; digital print (framed)','120.00');
paymentOptions[30235] = new paymentOption(30235,'20&quot;x 16&quot; digital print (mounted)','120.00');
paymentOptions[30236] = new paymentOption(30236,'20&quot;x 16&quot; digital print (framed)','180.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[25203] = new paymentGroup(25203,'landscape format','30223,30224,30227,30228,30231,30232,30235,30236');
			paymentGroups[25202] = new paymentGroup(25202,'square format','81423,81424,81425,81426,81427,81428');
	/***************************************************************************
* 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;
}


