/* 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[79418] = new paymentOption(79418,'Block 28&quot;x11&quot;','60.00');
paymentOptions[79423] = new paymentOption(79423,'Canvas 28&quot;x11&quot;','75.00');
paymentOptions[25475] = new paymentOption(25475,'5x7   Print','4.00');
paymentOptions[34758] = new paymentOption(34758,'6&quot;x8&quot; Print','6.00');
paymentOptions[34759] = new paymentOption(34759,'8&quot;x10&quot; Print','8.00');
paymentOptions[25465] = new paymentOption(25465,'12x16 print','15.00');
paymentOptions[15627] = new paymentOption(15627,'5x7  Print with cream card mount','6.00');
paymentOptions[34769] = new paymentOption(34769,'6&quot;x8&quot; Print with cream card mount','8.00');
paymentOptions[34768] = new paymentOption(34768,'8&quot;x10&quot; Print with cream card mount','12.00');
paymentOptions[25468] = new paymentOption(25468,'12&quot;x16&quot;  Print with cream card mount','20.00');
paymentOptions[34984] = new paymentOption(34984,'Ten Pounds','10.00');
paymentOptions[34985] = new paymentOption(34985,'Twenty Pounds','20.00');
paymentOptions[35009] = new paymentOption(35009,'Twenty Five Pounds','25.00');
paymentOptions[34986] = new paymentOption(34986,'Thirty Pounds','30.00');
paymentOptions[34987] = new paymentOption(34987,'Forty Pounds','40.00');
paymentOptions[34988] = new paymentOption(34988,'Fifty Pounds','50.00');
paymentOptions[34990] = new paymentOption(34990,'Seventy Five Pounds','75.00');
paymentOptions[34991] = new paymentOption(34991,'One Hundred Pounds','100.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[24621] = new paymentGroup(24621,'Block 28&quot;x11&quot;','79418,79423');
			paymentGroups[10775] = new paymentGroup(10775,'Gift Certificate','34984,34985,35009,34986,34987,34988,34990,34991');
			paymentGroups[24620] = new paymentGroup(24620,'sale','25475,34758,34759,25465');
			paymentGroups[7788] = new paymentGroup(7788,'sale 2','25475,34758,34759,25465,15627,34769,34768,25468');
	/***************************************************************************
* 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;
}


