/* 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[39715] = new paymentOption(39715,'Boxed Framed Print','175.00');
paymentOptions[39716] = new paymentOption(39716,'Greeting Card','7.00');
paymentOptions[57750] = new paymentOption(57750,'Pack Of Ten Greeting Cards','45.00');
paymentOptions[57752] = new paymentOption(57752,'Poster Print','40.00');
paymentOptions[39720] = new paymentOption(39720,'8 x 10 Inch Print Only','26.50');
paymentOptions[39721] = new paymentOption(39721,'5 x 7  Inch Print Only','12.50');
paymentOptions[75694] = new paymentOption(75694,'6 x 4 inch print','5.50');
paymentOptions[75695] = new paymentOption(75695,'5x5','10.50');
paymentOptions[75696] = new paymentOption(75696,'8x8 Inch Print','15.50');
paymentOptions[75697] = new paymentOption(75697,'8x12 Inch Print','27.50');
paymentOptions[75698] = new paymentOption(75698,'12x12','37.50');
paymentOptions[75699] = new paymentOption(75699,'14 x 11 Inch Print','47.50');
paymentOptions[57879] = new paymentOption(57879,'Post Cards','2.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[17699] = new paymentGroup(17699,'Kitty L\'Wrens Photographic Art','39715,39716,57750,57752,39720,39721,75694,75695,75696,75697,75698,75699,57879');
	/***************************************************************************
* 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;
}


