/* 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[57784] = new paymentOption(57784,'Postcards','1.50');
paymentOptions[59706] = new paymentOption(59706,'Greeting cards','2.50');
paymentOptions[49069] = new paymentOption(49069,'12 x 8 Mounted print','35.00');
paymentOptions[49068] = new paymentOption(49068,'12 x 8 Framed Print','55.00');
paymentOptions[66763] = new paymentOption(66763,'MDF Block Mounts 10 x 15','60.00');
paymentOptions[66762] = new paymentOption(66762,'MDF Block Mounts 16 x 23','90.00');
paymentOptions[66752] = new paymentOption(66752,'MDF Block Mounts 23 x 33','145.00');
paymentOptions[66757] = new paymentOption(66757,'MDF Block Mounts 33 x 46','260.00');
paymentOptions[66764] = new paymentOption(66764,'Canvas - Standard 23 x 33','120.00');
paymentOptions[66765] = new paymentOption(66765,'Canvas - Gallery 33 x 46','160.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[14918] = new paymentGroup(14918,'.','57784,59706,49069,49068,66763,66762,66752,66757,66764,66765');
	/***************************************************************************
* 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;
}


