/* 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[39540] = new paymentOption(39540,'8x12 inch matte photographic print (approx A4)','40.00');
paymentOptions[73429] = new paymentOption(73429,'5x7.5 inch matte photographic print (approx 13x19cms)','20.00');
paymentOptions[73428] = new paymentOption(73428,'\t6x4 inch matte photographic print (approx 10x15cms)','15.00');
paymentOptions[39541] = new paymentOption(39541,'5x7 inch matte photographic print (approx 13x18cms)','25.00');
paymentOptions[60883] = new paymentOption(60883,'5x7 inch matte photographic print (approx 13x18 cms) normally $60.00','35.00');
paymentOptions[48953] = new paymentOption(48953,'8x10 inch matte collage photographic print ','50.00');
paymentOptions[60884] = new paymentOption(60884,'5x7 inch matte photographic reprint ie additional print','25.00');
paymentOptions[48497] = new paymentOption(48497,'5x7 inch matte photographic reprint ie additional print','10.00');
paymentOptions[48496] = new paymentOption(48496,'A2 Glossy Wall Poster (42x60 cms) - ideal for the bedroom wall','65.00');
paymentOptions[61419] = new paymentOption(61419,'8x10 inch matte photographic print (approx A4) normally $200.00','150.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[12234] = new paymentGroup(12234,'Dance ','39540,39541,48497,48496');
			paymentGroups[18678] = new paymentGroup(18678,'Fine Art Portraiture','60883,60884,61419');
			paymentGroups[22692] = new paymentGroup(22692,'NZTC','39540,73429,73428');
			paymentGroups[22909] = new paymentGroup(22909,'nztc smaller','73429,73428');
			paymentGroups[14887] = new paymentGroup(14887,'Twinkles Toes Collage','48953,48496');
	/***************************************************************************
* 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 + ' - NZ$' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


