/* 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[37599] = new paymentOption(37599,'Mounted 7&quot;x5&quot; Matt Photographic Print (Overall Mounted Size 10&quot;x8&quot;)','20.00');
paymentOptions[37601] = new paymentOption(37601,'1070x550mm Ltd Edition Print (posted rolled)','240.00');
paymentOptions[37598] = new paymentOption(37598,'Mounted 10&quot;x8&quot; Matt Photographic Print (Overall Mounted size 14&quot;x11&quot;)','35.00');
paymentOptions[37215] = new paymentOption(37215,'A3 Matt Finish Photograph (posted rolled)','30.00');
paymentOptions[38422] = new paymentOption(38422,'12&quot;x5&quot; Mounted Photographic Print (Overall Mounted size 19&quot;x9&quot;)','40.00');
paymentOptions[50176] = new paymentOption(50176,'540x540mm Ltd Edition Print (posted rolled)','160.00');
paymentOptions[57524] = new paymentOption(57524,'Mounted 5&quot;x5&quot; matt photo print (overall size 9&quot;x9&quot;)','20.00');
paymentOptions[69164] = new paymentOption(69164,'12&quot;x 12&quot; Matt Finish Photograph (posted rolled)','30.00');
paymentOptions[75124] = new paymentOption(75124,'Limited Edition 5&quot;x5&quot; print','25.00');
paymentOptions[80605] = new paymentOption(80605,'Mug','10.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[11596] = new paymentGroup(11596,'Large','37599,37215');
			paymentGroups[11510] = new paymentGroup(11510,'Limited Edition','37601');
			paymentGroups[15235] = new paymentGroup(15235,'Limited Edition Square','50176');
			paymentGroups[23204] = new paymentGroup(23204,'Ltd 5&quot;x5&quot; square print','69164,75124');
			paymentGroups[21315] = new paymentGroup(21315,'Medium Square Prints','69164');
			paymentGroups[24983] = new paymentGroup(24983,'Mugs','80605');
			paymentGroups[11509] = new paymentGroup(11509,'Prints','37599,37598,37215');
			paymentGroups[17632] = new paymentGroup(17632,'Square Prints','57524,69164');
			paymentGroups[11876] = new paymentGroup(11876,'Tall Prints','38422');
	/***************************************************************************
* 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;
}


