/* 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[11018] = new paymentOption(11018,'5x7','12.00');
paymentOptions[11019] = new paymentOption(11019,'5x7 FRAMED','30.00');
paymentOptions[11037] = new paymentOption(11037,'5x14 Unframed','20.00');
paymentOptions[11038] = new paymentOption(11038,'10x20 Unframed','40.00');
paymentOptions[11016] = new paymentOption(11016,'8x10','25.00');
paymentOptions[12886] = new paymentOption(12886,'8x10 FRAMED','60.00');
paymentOptions[11017] = new paymentOption(11017,'11x14','35.00');
paymentOptions[11039] = new paymentOption(11039,'12x36Unframed','80.00');
paymentOptions[12885] = new paymentOption(12885,'11x14 FRAMED','125.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[3260] = new paymentGroup(3260,'Panaroma','11037,11038,11039');
			paymentGroups[3259] = new paymentGroup(3259,'Unframed','11018,11019,11016,12886,11017,12885');
	/***************************************************************************
* 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 + ' - $' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


