/* 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[51839] = new paymentOption(51839,'limited edition of 95:  30.5 x 22.15cm','95.00');
paymentOptions[51857] = new paymentOption(51857,'limited edition of 95:  32 x 21.63cm','95.00');
paymentOptions[51859] = new paymentOption(51859,'limited edition of 95:  34 x 15.46cm','95.00');
paymentOptions[51861] = new paymentOption(51861,'limited edition of 95:  31 x 21.89cm','95.00');
paymentOptions[51863] = new paymentOption(51863,'limited edition of 95:  22 x 22cm','95.00');
paymentOptions[51865] = new paymentOption(51865,'limited edition of 295:  38 x 38cm','155.00');
paymentOptions[51867] = new paymentOption(51867,'limited edition of 95:  33 x 21.94cm','95.00');
paymentOptions[51888] = new paymentOption(51888,'limited edition of 295:  16 x 16cm','55.00');
paymentOptions[51890] = new paymentOption(51890,'limited edition of 95:  21.94 x 33cm','95.00');
paymentOptions[51998] = new paymentOption(51998,'open edition:  16 x 16cm','35.00');
paymentOptions[52000] = new paymentOption(52000,'open edition:  16 x 16cm','35.00');
paymentOptions[52003] = new paymentOption(52003,'open edition:  33 x 21.94cm','50.00');
paymentOptions[52007] = new paymentOption(52007,'open edition:  33 x 21.94cm','50.00');
paymentOptions[52009] = new paymentOption(52009,'open edition:  10 x 7cm','25.00');
paymentOptions[51814] = new paymentOption(51814,'limited edition of 95:  33 x 21.94cm','95.00');
paymentOptions[51818] = new paymentOption(51818,'limited edition of 95:  22 x 22cm','95.00');
paymentOptions[51819] = new paymentOption(51819,'limited edition of 20:  46 x 46cm','295.00');
paymentOptions[51815] = new paymentOption(51815,'limited edition of 50:  45 x 29.92cm','195.00');
paymentOptions[52010] = new paymentOption(52010,'open edition:  20 x 14cm','35.00');
paymentOptions[52008] = new paymentOption(52008,'open edition:  45 x 29.92cm','75.00');
paymentOptions[52004] = new paymentOption(52004,'open edition:  45 x 29.92cm','80.00');
paymentOptions[52001] = new paymentOption(52001,'open edition:  22 x 22cm','45.00');
paymentOptions[51999] = new paymentOption(51999,'open edition:  22 x 22cm','45.00');
paymentOptions[51891] = new paymentOption(51891,'limited edition of 50:  29.92 x 45cm','195.00');
paymentOptions[51889] = new paymentOption(51889,'limited edition of 50:  32 x 32cm','155.00');
paymentOptions[51868] = new paymentOption(51868,'limited edition of 20:  60 x 39.89cm','335.00');
paymentOptions[51866] = new paymentOption(51866,'limited edition of 20:  58 x 58cm','375.00');
paymentOptions[51864] = new paymentOption(51864,'limited edition of 50:  38 x 38cm','225.00');
paymentOptions[51862] = new paymentOption(51862,'limited edition of 20:  80 x 56.5cm','395.00');
paymentOptions[51860] = new paymentOption(51860,'limited edition of 50:  50 x 22.73cm','195.00');
paymentOptions[51858] = new paymentOption(51858,'limited edition of 20:  55 x 37.17cm','295.00');
paymentOptions[51840] = new paymentOption(51840,'limited edition of 20:  55.08 x 40cm','295.00');
paymentOptions[52002] = new paymentOption(52002,'open edition:  46 x 46cm','85.00');
paymentOptions[52005] = new paymentOption(52005,'open edition:  60 x 39.89cm','120.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[15775] = new paymentGroup(15775,'group1','51814,51815');
			paymentGroups[15808] = new paymentGroup(15808,'group10','51888,51889');
			paymentGroups[15809] = new paymentGroup(15809,'group11','51890,51891');
			paymentGroups[15824] = new paymentGroup(15824,'group12','51998,51999');
			paymentGroups[15826] = new paymentGroup(15826,'group13','52000,52001,52002');
			paymentGroups[15827] = new paymentGroup(15827,'group14','52003,52004,52005');
			paymentGroups[15828] = new paymentGroup(15828,'group15','52007,52008');
			paymentGroups[15829] = new paymentGroup(15829,'group16','52009,52010');
			paymentGroups[15778] = new paymentGroup(15778,'Group2','51818,51819');
			paymentGroups[15787] = new paymentGroup(15787,'group3','51839,51840');
			paymentGroups[15792] = new paymentGroup(15792,'group4','51857,51858');
			paymentGroups[15793] = new paymentGroup(15793,'group5','51859,51860');
			paymentGroups[15794] = new paymentGroup(15794,'group6','51861,51862');
			paymentGroups[15795] = new paymentGroup(15795,'group7','51863,51864');
			paymentGroups[15796] = new paymentGroup(15796,'group8','51865,51866');
			paymentGroups[15797] = new paymentGroup(15797,'group9','51867,51868');
	/***************************************************************************
* 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;
}


