/* 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[45604] = new paymentOption(45604,'10&quot;x8&quot;','10.00');
paymentOptions[45626] = new paymentOption(45626,'11&quot;x9&quot; ','14.00');
paymentOptions[45605] = new paymentOption(45605,'12&quot;x10&quot;','18.00');
paymentOptions[45606] = new paymentOption(45606,'14&quot;x11&quot;','20.00');
paymentOptions[45627] = new paymentOption(45627,'14&quot;x18&quot;','24.00');
paymentOptions[45608] = new paymentOption(45608,'20&quot;x16&quot;','30.00');
paymentOptions[45609] = new paymentOption(45609,'20&quot;x9&quot;','25.00');
paymentOptions[45610] = new paymentOption(45610,'25&quot;x11.5&quot;','35.00');
paymentOptions[45611] = new paymentOption(45611,'36&quot;x17&quot;','54.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[13908] = new paymentGroup(13908,'Larger or custom sizes.','');
			paymentGroups[13907] = new paymentGroup(13907,'Panoramic Pricing','45609,45610,45611');
			paymentGroups[13913] = new paymentGroup(13913,'Standard size Pricing','45604,45626,45605,45606,45627,45608');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - 				&pound;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


