/* 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[82148] = new paymentOption(82148,'5x7&quot; print','10.00');
paymentOptions[66531] = new paymentOption(66531,'5&quot; x 7&quot; PRINT','10.00');
paymentOptions[60902] = new paymentOption(60902,'5 x 7 print','5.75');
paymentOptions[81359] = new paymentOption(81359,'SFC 5x7','6.75');
paymentOptions[81360] = new paymentOption(81360,'SFC 10x8&quot;','9.75');
paymentOptions[60903] = new paymentOption(60903,'A4 or 10x8 print','12.25');
paymentOptions[66532] = new paymentOption(66532,'10&quot;x8&quot; Print','25.00');
paymentOptions[82862] = new paymentOption(82862,'10x8 Desk Framed Print','38.00');
paymentOptions[82149] = new paymentOption(82149,'10x8&quot; print','25.00');
paymentOptions[60904] = new paymentOption(60904,'First Class Postage per order','3.50');
paymentOptions[55978] = new paymentOption(55978,'Special Delivery Postage','7.25');
paymentOptions[81361] = new paymentOption(81361,'SFC High Res by  Email','15.75');
paymentOptions[81362] = new paymentOption(81362,'SFC 1st Class Postage','3.50');
paymentOptions[53128] = new paymentOption(53128,'Email image with licence to print','25.00');
paymentOptions[82150] = new paymentOption(82150,'DVD slideshow','75.00');
paymentOptions[70137] = new paymentOption(70137,'CD with 20 high resolution images','198.00');
paymentOptions[82151] = new paymentOption(82151,'CD of 20 high res printable images','198.00');
paymentOptions[54706] = new paymentOption(54706,'Photoshoot Deposit','45.00');
paymentOptions[82152] = new paymentOption(82152,'Wedding Photography Deposit','300.00');
paymentOptions[76145] = new paymentOption(76145,'FINE ART WRAP CANVAS FINISH 10x8','69.00');
paymentOptions[76146] = new paymentOption(76146,'OAK BOX FRAMED PRINT 16&quot;x12&quot;','112.75');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[25173] = new paymentGroup(25173,'CHARITY PRICES','81359,81360,81361,81362');
			paymentGroups[20419] = new paymentGroup(20419,'PORTRAITS','66531,66532,60904,55978,54706,76145,76146');
			paymentGroups[24676] = new paymentGroup(24676,'Pre Wedding Shoot','60902,60903,60904,55978,76145');
			paymentGroups[20570] = new paymentGroup(20570,'SPECIAL PORTRAIT PRICES','60902,60903,82862,60904,55978,53128,70137,54706,76145,76146');
			paymentGroups[25515] = new paymentGroup(25515,'WEDDING','82148,82149,60904,55978,82150,82151,82152');
	/***************************************************************************
* 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;
}


