/* 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[43576] = new paymentOption(43576,'Tuition - Private 1:1','25.00');
paymentOptions[50159] = new paymentOption(50159,'Tuition - Private 1:2','30.00');
paymentOptions[61932] = new paymentOption(61932,'Photography (PRIVATE)','25.00');
paymentOptions[40727] = new paymentOption(40727,'A5 Lustre Print only (no mount)','10.00');
paymentOptions[61937] = new paymentOption(61937,'Image 1','40.00');
paymentOptions[61938] = new paymentOption(61938,'Images 2 - 4','15.00');
paymentOptions[40816] = new paymentOption(40816,'A5 Matte Print only (no mount)','10.00');
paymentOptions[61934] = new paymentOption(61934,'Photography (COMMERCIAL)','65.00');
paymentOptions[40326] = new paymentOption(40326,'A4 Lustre Print (no mount)','30.00');
paymentOptions[61941] = new paymentOption(61941,'Image 5 - 25','10.00');
paymentOptions[61942] = new paymentOption(61942,'Image 26 - 50','7.00');
paymentOptions[40329] = new paymentOption(40329,'A4 Matte Print (no mount)','30.00');
paymentOptions[61949] = new paymentOption(61949,'Daily Rate (PRIVATE)','150.00');
paymentOptions[40237] = new paymentOption(40237,'A4 Lustre Print with off white mount','45.00');
paymentOptions[40319] = new paymentOption(40319,'A4 Matte Print with off-white mount','45.00');
paymentOptions[61950] = new paymentOption(61950,'DAILY RATE (Commercial)','390.00');
paymentOptions[61951] = new paymentOption(61951,'WEEKLY RATE (Private) (4 days)','560.00');
paymentOptions[40332] = new paymentOption(40332,'A3 Lustre Print (no mount)','35.00');
paymentOptions[40334] = new paymentOption(40334,'A3 Matte Print (no mount)','35.00');
paymentOptions[61952] = new paymentOption(61952,'WEEKLY RATE (Commercial)(4days)','1430.00');
paymentOptions[61955] = new paymentOption(61955,'WEEKLY RATE (Private)(5days)','700.00');
paymentOptions[40236] = new paymentOption(40236,'A3 Lustre Print with off-white mount ','55.00');
paymentOptions[40323] = new paymentOption(40323,'A3 Matte Print with off-white mount','55.00');
paymentOptions[61956] = new paymentOption(61956,'WEEKLY RATE (Commercial)(5days)','1780.00');
paymentOptions[41015] = new paymentOption(41015,'1 Yr Copyright Purchase for card production only.','200.00');
paymentOptions[41014] = new paymentOption(41014,'3 Yr Copyright Purchase for card production only.','300.00');
paymentOptions[43569] = new paymentOption(43569,'Copyright purchase cards only','500.00');
paymentOptions[41013] = new paymentOption(41013,'Complete Copyright purchase','1000.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[12602] = new paymentGroup(12602,'Group 1 All Photos','40727,40816,40326,40329,40237,40319,40332,40334,40236,40323,41013');
			paymentGroups[12841] = new paymentGroup(12841,'Group 2 All Artwork','40326,40329,40237,40319,40332,40334,40236,40323,41013');
			paymentGroups[12603] = new paymentGroup(12603,'Group 3 Greeting Card designs only','40727,40816,41015,41014,43569,41013');
			paymentGroups[18959] = new paymentGroup(18959,'Photographic Costs','61932,61934,61949,61950,61951,61952,61955,61956');
			paymentGroups[13272] = new paymentGroup(13272,'Photoshop / Photography Training','43576,50159');
			paymentGroups[18960] = new paymentGroup(18960,'POST-PROCESSING COSTS','61937,61938,61941,61942,61949,61950,61951,61952,61955,61956');
	/***************************************************************************
* 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;
}


