/* 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[50997] = new paymentOption(50997,'10 x 8&quot; prints','25.00');
paymentOptions[56199] = new paymentOption(56199,'Special offer package. ','325.00');
paymentOptions[50999] = new paymentOption(50999,'High Resolution Images on CD (per image).','35.00');
paymentOptions[56197] = new paymentOption(56197,'Framed 12 x 10&quot; print','105.00');
paymentOptions[50948] = new paymentOption(50948,'16 x 12&quot; High quality, ready to hang stretched canvas.','120.00');
paymentOptions[51416] = new paymentOption(51416,'Hard Back Coffee Table Style Book.  12 x 12&quot;, linen cover. ','150.00');
paymentOptions[50998] = new paymentOption(50998,'28 x 24&quot; High quality, ready to hang stretched canvas.','276.00');
paymentOptions[56198] = new paymentOption(56198,'30 x 30&quot; Stretched Canvas','340.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[0] = new paymentGroup(0,'Default group','50997,56199,50999,56197,50948,51416,50998,56198');
/***************************************************************************
* 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;
}


