/* 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[52513] = new paymentOption(52513,'15x10&quot;','29.00');
paymentOptions[52494] = new paymentOption(52494,'10x8&quot;','15.00');
paymentOptions[55729] = new paymentOption(55729,'9x6&quot;','13.00');
paymentOptions[52496] = new paymentOption(52496,'8x6&quot;','10.00');
paymentOptions[52497] = new paymentOption(52497,'7x5&quot;','8.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[15925] = new paymentGroup(15925,'10x8 prints','52494,52496,52497');
			paymentGroups[15957] = new paymentGroup(15957,'15x10&quot; ONLY','52513,55729');
			paymentGroups[15924] = new paymentGroup(15924,'15x10&quot; prints','52513,52494,52496,52497');
			paymentGroups[15936] = new paymentGroup(15936,'8X6&quot; pRINTS','52496,52497');
			paymentGroups[16996] = new paymentGroup(16996,'9x6 prints','55729');
			paymentGroups[17006] = new paymentGroup(17006,'new prints','52513,55729,52497');
			paymentGroups[15919] = new paymentGroup(15919,'Print Prices','52513,52494,55729,52496,52497');
	/***************************************************************************
* 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;
}


