/* 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[73124] = new paymentOption(73124,'Limited Edition Signed Print 33x33 (cm) - UK & Europe Delivery','195.00');
paymentOptions[73125] = new paymentOption(73125,'Limited Edition Signed Print 33x33 (cm) - Worldwide Delivery','210.00');
paymentOptions[73126] = new paymentOption(73126,'Limited Edition Signed Print 55x55 (cm) - UK & Europe Delivery','320.00');
paymentOptions[73127] = new paymentOption(73127,'Limited Edition Signed Print 55x55 (cm) - Worldwide Delivery','335.00');
paymentOptions[73128] = new paymentOption(73128,'Limited Edition Signed Print 33x22 (cm) - UK & Europe Delivery','195.00');
paymentOptions[73129] = new paymentOption(73129,'Limited Edition Signed Print 33x22 (cm) - Worldwide Delivery','210.00');
paymentOptions[73130] = new paymentOption(73130,'Limited Edition Signed Print 55x36 (cm) - UK & Europe Delivery','320.00');
paymentOptions[73131] = new paymentOption(73131,'Limited Edition Signed Print 55x36 (cm) - Worldwide Delivery','335.00');
paymentOptions[73133] = new paymentOption(73133,'Limited Edition Signed Print 33x26 (cm) - UK & Europe Delivery','195.00');
paymentOptions[73134] = new paymentOption(73134,'Limited Edition Signed Print 33x26 (cm) - Worldwide Delivery','210.00');
paymentOptions[73135] = new paymentOption(73135,'Limited Edition Signed Print 55x43 (cm) - UK & Europe Delivery','320.00');
paymentOptions[73136] = new paymentOption(73136,'Limited Edition Signed Print 55x43 (cm) - Worldwide Delivery','335.00');
paymentOptions[73137] = new paymentOption(73137,'Limited Edition Signed Print 60x20 (cm) - UK & Europe Delivery','220.00');
paymentOptions[73138] = new paymentOption(73138,'Limited Edition Signed Print 60x20 (cm) - Worldwide Delivery','235.00');
paymentOptions[73139] = new paymentOption(73139,'Limited Edition Signed Print 90x30 (cm) - UK & Europe Delivery','345.00');
paymentOptions[73140] = new paymentOption(73140,'Limited Edition Signed Print 90x30 (cm) - Worldwide Delivery','360.00');
paymentOptions[82610] = new paymentOption(82610,'Limited Edition Signed Print 33x23 (cm) - UK & Europe Delivery','195.00');
paymentOptions[82754] = new paymentOption(82754,'Limited Edition Signed Print 33x23 (cm) - Worldwide Delivery','210.00');
paymentOptions[82755] = new paymentOption(82755,'Limited Edition Signed Print 55x39 (cm) - UK & Europe Delivery','320.00');
paymentOptions[82756] = new paymentOption(82756,'Limited Edition Signed Print 55x39 (cm) - Worldwide Delivery ','335.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[22583] = new paymentGroup(22583,'35mm','73128,73129,73130,73131');
	paymentGroups[25637] = new paymentGroup(25637,'4x3','82610,82754,82755,82756');
	paymentGroups[22586] = new paymentGroup(22586,'5x4','73133,73134,73135,73136');
	paymentGroups[22582] = new paymentGroup(22582,'Square','73124,73125,73126,73127');
	paymentGroups[22587] = new paymentGroup(22587,'Tryptich','73137,73138,73139,73140');
	/***************************************************************************
* 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;
}


