/* 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[81497] = new paymentOption(81497,'Olympian poster order 2  12x 18','12.00');
paymentOptions[81498] = new paymentOption(81498,'Olympian Poster order 3  12 x 18','17.00');
paymentOptions[81495] = new paymentOption(81495,'Olympian Poster 4 Poster p&p Free','20.00');
paymentOptions[81496] = new paymentOption(81496,'Olympian Poster 1 12x18 ','7.00');
paymentOptions[67239] = new paymentOption(67239,'one fight ','15.00');
paymentOptions[28246] = new paymentOption(28246,'8 x 10','15.00');
paymentOptions[67238] = new paymentOption(67238,'two fights ','20.00');
paymentOptions[28249] = new paymentOption(28249,'10 x 12 (a4 Size) ','20.00');
paymentOptions[67237] = new paymentOption(67237,'three fights or four','25.00');
paymentOptions[28248] = new paymentOption(28248,'7 x 5','8.00');
paymentOptions[62859] = new paymentOption(62859,'20 x 30 inches','50.00');
paymentOptions[62860] = new paymentOption(62860,'post cards ','15.00');
paymentOptions[28247] = new paymentOption(28247,'6 x 4 ','6.00');
paymentOptions[60691] = new paymentOption(60691,'DVD','15.00');
paymentOptions[62029] = new paymentOption(62029,'13 x 15 ','25.00');
paymentOptions[62030] = new paymentOption(62030,'20 x 30 Special edition framed Collage ','150.00');
paymentOptions[62031] = new paymentOption(62031,'13 x 15 framed ','45.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[16195] = new paymentGroup(16195,'all','28246,28248,62029,62030,62031');
			paymentGroups[18637] = new paymentGroup(18637,'DVD','67239,67238,67237,60691');
			paymentGroups[19225] = new paymentGroup(19225,'mh collection ','62859,62860,62029,62031');
			paymentGroups[18981] = new paymentGroup(18981,'Specials ','81497,81498,81495,81496,28248,62859,62029,62030,62031');
	/***************************************************************************
* 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 + ' - &euro;' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


