/* 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[70341] = new paymentOption(70341,'6&quot;x4&quot; Print with Mount','5.00');
paymentOptions[70342] = new paymentOption(70342,'7&quot;x5&quot; Print with Mount','8.00');
paymentOptions[70343] = new paymentOption(70343,'8&quot;x6&quot; Print with Mount','10.00');
paymentOptions[70344] = new paymentOption(70344,'10&quot;x8&quot; Print with Mount','12.00');
paymentOptions[70345] = new paymentOption(70345,'12&quot;x10&quot; Print with Mount','14.00');
paymentOptions[70346] = new paymentOption(70346,'Mousemat','10.00');
paymentOptions[70347] = new paymentOption(70347,'Small Calendar with 8&quot;x6&quot; Print','5.00');
paymentOptions[70348] = new paymentOption(70348,'Large Calendar with 10&quot;x8&quot; Print','7.00');
paymentOptions[70349] = new paymentOption(70349,'Photo Mug','10.00');
paymentOptions[70350] = new paymentOption(70350,'96-Piece Jigsaw Puzzle','15.00');
paymentOptions[70351] = new paymentOption(70351,'2 Keyrings','7.00');
paymentOptions[70352] = new paymentOption(70352,'3 Keyrings','9.00');
paymentOptions[70353] = new paymentOption(70353,'2 Fridge Magnets','6.00');
paymentOptions[70354] = new paymentOption(70354,'4 Wallet photos (2.5&quot;x2&quot;)','4.00');
paymentOptions[70355] = new paymentOption(70355,'Pair Bookmarks','4.00');
paymentOptions[70356] = new paymentOption(70356,'4 Place Mats','20.00');
paymentOptions[70357] = new paymentOption(70357,'4 Coasters','14.00');
paymentOptions[70358] = new paymentOption(70358,'Teddy Bear','15.00');
paymentOptions[70359] = new paymentOption(70359,'Canvas Print 12&quot;x10&quot;','42.00');
paymentOptions[70360] = new paymentOption(70360,'Canvas Print 16&quot;x12&quot;','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[0] = new paymentGroup(0,'Default group','70341,70342,70343,70344,70345,70346,70347,70348,70349,70350,70351,70352,70353,70354,70355,70356,70357,70358,70359,70360');
/***************************************************************************
* 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;
}


