/* 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[81770] = new paymentOption(81770,'bellbirds','71.20');
paymentOptions[75829] = new paymentOption(75829,'pawfect coat XS or S','25.00');
paymentOptions[75830] = new paymentOption(75830,'pawfect coat m','30.00');
paymentOptions[75831] = new paymentOption(75831,'pawfect coat L','35.00');
paymentOptions[75832] = new paymentOption(75832,'pawfect coat XL','45.00');
paymentOptions[75833] = new paymentOption(75833,'pawfect coat prepaid regular parcel','11.20');
paymentOptions[63470] = new paymentOption(63470,'Christmas Special Package 2010','160.00');
paymentOptions[63468] = new paymentOption(63468,'pawfection photography package ','250.00');
paymentOptions[43940] = new paymentOption(43940,'RSPCA Cat Legacy Calendar','22.00');
paymentOptions[80777] = new paymentOption(80777,'calendar postage','6.60');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[20809] = new paymentGroup(20809,'christmas special package','63470');
			paymentGroups[23410] = new paymentGroup(23410,'pawfect coat','75829,75830,75831,75832,75833');
			paymentGroups[20810] = new paymentGroup(20810,'pawfection photography package','63468');
			paymentGroups[20811] = new paymentGroup(20811,'RSPCA Cat Legacy Calendar','43940,80777');
			paymentGroups[25340] = new paymentGroup(25340,'sally egan','81770');
	/***************************************************************************
* 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 + ' - AU$' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


