/* 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[26641] = new paymentOption(26641,'12x5inch (30x12cm) matt','17.00');
paymentOptions[26730] = new paymentOption(26730,'12x5inch (30x12cm) gloss','17.00');
paymentOptions[26642] = new paymentOption(26642,'12x8inch (30x 20cm) matt','17.00');
paymentOptions[26731] = new paymentOption(26731,'12x8inch (30x20cm) gloss','17.00');
paymentOptions[26643] = new paymentOption(26643,'18x12inch (45x30cm) matt','30.00');
paymentOptions[26732] = new paymentOption(26732,'18x12inch (45x30cm) gloss','30.00');
paymentOptions[26644] = new paymentOption(26644,'20x8inch (50x20cm) matt','30.00');
paymentOptions[26733] = new paymentOption(26733,'20x8inch (50x20cm) gloss','30.00');
paymentOptions[26645] = new paymentOption(26645,'30x20inch (76x50cm) matt','55.00');
paymentOptions[26734] = new paymentOption(26734,'30x20inch (76x50cm) gloss','55.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[8209] = new paymentGroup(8209,'12&quot; x 5&quot;','26641');
			paymentGroups[8206] = new paymentGroup(8206,'12&quot; x 8&quot;','26642');
			paymentGroups[8211] = new paymentGroup(8211,'12&quot;x5&quot; / 20&quot;x8&quot;','26641,26730,26644,26733');
			paymentGroups[8212] = new paymentGroup(8212,'12&quot;x8&quot; / 18&quot;x12&quot;','26642,26731,26643,26732');
			paymentGroups[8205] = new paymentGroup(8205,'12&quot;x8&quot; / 18&quot;x12&quot; / 30&quot;x20&quot;','26642,26731,26643,26732,26645,26734');
			paymentGroups[8210] = new paymentGroup(8210,'18&quot;x12&quot;','26643,26732');
			paymentGroups[8208] = new paymentGroup(8208,'20&quot;x8&quot;','26644');
			paymentGroups[8207] = new paymentGroup(8207,'30&quot;x20&quot;','26645,26734');
			paymentGroups[21439] = new paymentGroup(21439,'prowlers','26643,26732,26645,26734');
	/***************************************************************************
* Get payment options field for given payment group                        *
***************************************************************************/
function getPaymentOptions(payment_groups_id) {
	var temp = '';
		
		
		if(paymentGroups[payment_groups_id].options[0] != ''){
		for (var i in paymentGroups[payment_groups_id].options) {
						
			paymentOption = paymentOptions[paymentGroups[payment_groups_id].options[i]];
			temp = temp + '<option  value="' + paymentOption.id + '">' + paymentOption.payment_option + ' - 				&euro;' + paymentOption.price + '</option>';
		}
	}
		return temp;
}


