/* 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[33898] = new paymentOption(33898,'A4 (210mm x 297mm) PRINT ONLY','17.99');
paymentOptions[69268] = new paymentOption(69268,'Please contact us to purchase this print','0.00');
paymentOptions[32736] = new paymentOption(32736,'A4 (210mm x 297mm) with IVORY MOUNT','23.99');
paymentOptions[33896] = new paymentOption(33896,'A4 (210mm x 297mm) with BLACK MOUNT','23.99');
paymentOptions[56777] = new paymentOption(56777,'8 x 12 inches. PRINT ONLY','19.00');
paymentOptions[33899] = new paymentOption(33899,'A3 (297mm x 420mm) PRINT ONLY ','22.99');
paymentOptions[32737] = new paymentOption(32737,'A3 (297mm x 420mm) & IVORY Mount *UK BUYERS ONLY*','30.99');
paymentOptions[33897] = new paymentOption(33897,'A3 (297mm x 420mm) & BLACK Mount *UK BUYERS ONLY*','30.99');
paymentOptions[33276] = new paymentOption(33276,'Other sizes available. Please contact us','0.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[10169] = new paymentGroup(10169,'PRINT COSTS','33898,32736,33896,33899,32737,33897,33276');
			paymentGroups[17388] = new paymentGroup(17388,'PRINT COSTS 2','56777,33276');
			paymentGroups[21368] = new paymentGroup(21368,'Print Group 3','69268');
	/***************************************************************************
* 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;
}


