/* 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[33785] = new paymentOption(33785,'6 x 4','10.00');
paymentOptions[33800] = new paymentOption(33800,'CD-ROM','50.00');
paymentOptions[33782] = new paymentOption(33782,'8 x 6','15.00');
paymentOptions[33789] = new paymentOption(33789,'Day Rate','200.00');
paymentOptions[33790] = new paymentOption(33790,'1 - 5 Images','16.00');
paymentOptions[33783] = new paymentOption(33783,'Enchanted Bespoke Portraiture','45.00');
paymentOptions[33791] = new paymentOption(33791,'6 - 20 Images','14.00');
paymentOptions[33792] = new paymentOption(33792,'21 - 50 Images','12.00');
paymentOptions[33784] = new paymentOption(33784,'Family, Children & Baby Portraiture','25.00');
paymentOptions[33786] = new paymentOption(33786,'Creative Portraiture','45.00');
paymentOptions[33787] = new paymentOption(33787,'Band Promo Photoshoot','100.00');
paymentOptions[33796] = new paymentOption(33796,'10 x 12','25.00');
paymentOptions[34091] = new paymentOption(34091,'On Location & Lifestyle','45.00');
paymentOptions[33798] = new paymentOption(33798,'12 x 16','40.00');
paymentOptions[33788] = new paymentOption(33788,'Attic Studio Makeover Package','200.00');
paymentOptions[33799] = new paymentOption(33799,'Montage','60.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[10456] = new paymentGroup(10456,'Image CD-ROM','33800');
			paymentGroups[10452] = new paymentGroup(10452,'Photoshoot Options','33783,33784,33786,33787,34091,33788');
			paymentGroups[10453] = new paymentGroup(10453,'Prints','33785,33782,33796,33798,33799');
			paymentGroups[10454] = new paymentGroup(10454,'Product/Food Photography','33789,33790,33791,33792');
	/***************************************************************************
* 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;
}


