/* 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[44681] = new paymentOption(44681,'6&quot;x4&quot; Photo - Unmounted','10.00');
paymentOptions[44682] = new paymentOption(44682,'6&quot;x4&quot; Photo - Mounted','12.00');
paymentOptions[44692] = new paymentOption(44692,'7&quot;x5&quot; Photo - Unmounted','13.00');
paymentOptions[44693] = new paymentOption(44693,'7&quot;x5&quot; Photo - Mounted','15.00');
paymentOptions[44694] = new paymentOption(44694,'10&quot;x8&quot; Photo - Unmounted','17.50');
paymentOptions[44695] = new paymentOption(44695,'10&quot;x8&quot; Photo - Mounted','22.00');
paymentOptions[44696] = new paymentOption(44696,'12&quot;x8&quot; Photo - Unmounted','20.00');
paymentOptions[44697] = new paymentOption(44697,'12&quot;x8&quot; Photo - Mounted','25.00');
paymentOptions[44698] = new paymentOption(44698,'18&quot;x12&quot; Photo - Unmounted','40.00');
paymentOptions[44699] = new paymentOption(44699,'18&quot;x12&quot; Photo - Mounted','45.00');
paymentOptions[44700] = new paymentOption(44700,'30&quot;x20&quot; Photo - Unmounted','50.00');
paymentOptions[44701] = new paymentOption(44701,'30&quot;x20&quot; Photo - Unmounted','55.00');
paymentOptions[44703] = new paymentOption(44703,'A3 Canvas','87.40');
paymentOptions[44702] = new paymentOption(44702,'A2 Canvas','119.60');
paymentOptions[44704] = new paymentOption(44704,'A1 Canvas','161.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[13604] = new paymentGroup(13604,'Commercial Photography','');
			paymentGroups[13602] = new paymentGroup(13602,'Social Photography','44681,44682,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44703,44702,44704');
			paymentGroups[13603] = new paymentGroup(13603,'Stock Images','44681,44682,44692,44693,44694,44695,44696,44697,44698,44699,44700,44701,44703,44702,44704');
	/***************************************************************************
* 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;
}


