/* 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[70616] = new paymentOption(70616,'instructions only','12.50');
paymentOptions[70617] = new paymentOption(70617,'full kit','17.50');
paymentOptions[70618] = new paymentOption(70618,'full kit','21.00');
paymentOptions[70619] = new paymentOption(70619,'full kit','30.00');
paymentOptions[70620] = new paymentOption(70620,'hands-free sit-on frame with 8&quot; hoop included','18.50');
paymentOptions[70621] = new paymentOption(70621,'6&quot; hoop for use with sit-on frame (sold separately)','6.00');
paymentOptions[70622] = new paymentOption(70622,'8&quot; hoop for use with sit-on frame (sold separately)','7.00');
paymentOptions[70623] = new paymentOption(70623,'10&quot; hoop for use with sit-on frame (sold separately)','7.50');
paymentOptions[70624] = new paymentOption(70624,'18&quot; wide slate frame','68.50');
paymentOptions[70625] = new paymentOption(70625,'24&quot; wide slate frame','75.00');
paymentOptions[70670] = new paymentOption(70670,'1-day Taster Class with Kit','55.00');
paymentOptions[70671] = new paymentOption(70671,'2-day Taster Class with Kit','90.00');
paymentOptions[70673] = new paymentOption(70673,'1-day Taster Class, Own Materials','45.00');
paymentOptions[70672] = new paymentOption(70672,'2-day Taster Class, Own Materials','80.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[21815] = new paymentGroup(21815,'Beginner Canvaswork Kit','70616,70617');
			paymentGroups[21813] = new paymentGroup(21813,'Beginner Goldwork Kit','70616,70618');
			paymentGroups[21812] = new paymentGroup(21812,'Beginner Stumpwork Kit','70616,70618');
			paymentGroups[21814] = new paymentGroup(21814,'Beginner Whitework Kit','70616,70617');
			paymentGroups[21811] = new paymentGroup(21811,'Embroidery Hoop','70620,70621,70622,70623');
			paymentGroups[21810] = new paymentGroup(21810,'Slate Frame','70624,70625');
	/***************************************************************************
* 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;
}


