/* 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[81971] = new paymentOption(81971,'16&quot;x20&quot; Limited Edition Print','250.00');
paymentOptions[81970] = new paymentOption(81970,'24&quot;x30&quot; Limited Edition Print','400.00');
paymentOptions[29387] = new paymentOption(29387,'16&quot;x20&quot; Print','150.00');
paymentOptions[29492] = new paymentOption(29492,'Panoramic Print - 10&quot;x32&quot;','200.00');
paymentOptions[29392] = new paymentOption(29392,'9&quot;x20&quot; Panoramic Print','100.00');
paymentOptions[81972] = new paymentOption(81972,'32&quot;x40&quot; Limited Edition Print','600.00');
paymentOptions[29493] = new paymentOption(29493,'Panoramic Print - 16&quot;x50&quot;','350.00');
paymentOptions[29390] = new paymentOption(29390,'24&quot;x30&quot; Print','250.00');
paymentOptions[29393] = new paymentOption(29393,'15&quot;x32&quot; Panoramic Print','225.00');
paymentOptions[81973] = new paymentOption(81973,'40&quot;x50&quot; Limited Edition Print','750.00');
paymentOptions[29391] = new paymentOption(29391,'32&quot;x40&quot; Print','400.00');
paymentOptions[29394] = new paymentOption(29394,'18&quot;x40&quot; Panoramic Print','300.00');
paymentOptions[29395] = new paymentOption(29395,'24&quot;x50&quot; Panoramic Print','450.00');
paymentOptions[29396] = new paymentOption(29396,'40&quot;x50&quot; Print','500.00');
paymentOptions[29397] = new paymentOption(29397,'Postage & Handling within Australia','20.00');
paymentOptions[29398] = new paymentOption(29398,'New Zealand/Asia-Pacific add','15.00');
paymentOptions[29399] = new paymentOption(29399,'Rest of World add','30.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[9027] = new paymentGroup(9027,'Delivery Charges','');
			paymentGroups[25441] = new paymentGroup(25441,'Limited Edition Large Format Prints','81971,81970,81972,81973');
			paymentGroups[25439] = new paymentGroup(25439,'Limited Edition Panoramic Prints','');
			paymentGroups[25440] = new paymentGroup(25440,'Open Edition Large Format Prints','29387,29390,29391,29396');
			paymentGroups[9025] = new paymentGroup(9025,'Open Edition Panoramic Prints (6x12)','29392,29393,29394,29395,29398,29399');
			paymentGroups[9058] = new paymentGroup(9058,'Open Edition Panoramic Prints (6x17)','29492,29493,29398,29399');
	/***************************************************************************
* 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;
}


