/* 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[4179] = new paymentOption(4179,'A4 Giclee Print','42.00');
paymentOptions[4182] = new paymentOption(4182,'A3  Giclee Print','75.00');
paymentOptions[72447] = new paymentOption(72447,'A2 Giclee Print','110.00');
paymentOptions[7507] = new paymentOption(7507,'6 x 18  Giclee Print (approx measurement in inches)','46.00');
paymentOptions[4183] = new paymentOption(4183,'8 1/4 x 23 1/2 Giclee Print (approx measurement in inches)','75.00');
paymentOptions[4184] = new paymentOption(4184,'8 1/4 x 33 Giclee Print (approx measurement in inches)','86.00');
paymentOptions[51718] = new paymentOption(51718,'13 x 40 Giclee Print (approx measurment in inches)','92.00');
paymentOptions[53492] = new paymentOption(53492,'13 x 55 Giclee Print ( approx measurments in inches)','110.00');
paymentOptions[7501] = new paymentOption(7501,'9 x 9 Square Giclee Print','35.00');
paymentOptions[7503] = new paymentOption(7503,'12 x 12 Square Giclee Print','44.00');
paymentOptions[7504] = new paymentOption(7504,'13 x 13 Square Giclee Print','46.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[1023] = new paymentGroup(1023,' Prints and Sizes','4179,4182,72447');
			paymentGroups[12768] = new paymentGroup(12768,'Dawn & Dusk','');
			paymentGroups[2135] = new paymentGroup(2135,'Other','7501,7503,7504');
			paymentGroups[1024] = new paymentGroup(1024,'Panoramics','7507,4183,4184');
			paymentGroups[15734] = new paymentGroup(15734,'panoramics 2','7507,4183,4184,51718');
			paymentGroups[16214] = new paymentGroup(16214,'panoramics 3','7507,4183,4184,51718,53492');
	/***************************************************************************
* 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;
}


