/* 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[46619] = new paymentOption(46619,'Click here to select sizes then add to cart','0.00');
paymentOptions[46061] = new paymentOption(46061,'33%off 7 x 5 Print in folder. UK delivery.','6.00');
paymentOptions[5821] = new paymentOption(5821,'7 x 5 (inches) Corrected print in folder. UK delivery.','9.00');
paymentOptions[46062] = new paymentOption(46062,'33% off 8 x 6 print in folder. UK delivery.','10.00');
paymentOptions[15722] = new paymentOption(15722,'Events 8 x 6 inc p&p','9.00');
paymentOptions[13564] = new paymentOption(13564,'8 x 6 Corrected cropped print in folder. UK delivery.','15.00');
paymentOptions[46063] = new paymentOption(46063,'33% off 9 x 6 print + folder. UK delivery.','10.00');
paymentOptions[13565] = new paymentOption(13565,'9 x 6 Corrected print in folder. UK delivery.','15.00');
paymentOptions[4599] = new paymentOption(4599,'10 x 8 Corrected cropped print in strut mount. UK delivery.','25.00');
paymentOptions[46064] = new paymentOption(46064,'33% off 12 x 8 print + folder. UK delivery.','20.00');
paymentOptions[4600] = new paymentOption(4600,'12 x 8 Corrected print in strut mount. UK delivery.','32.00');
paymentOptions[5825] = new paymentOption(5825,'Canvas Wrap 16 x 12&quot;','110.00');
paymentOptions[5829] = new paymentOption(5829,'Canvas Wrap 20 x 12&quot; ','135.00');
paymentOptions[5824] = new paymentOption(5824,'Canvas Wrap 35 x 24&quot;','255.00');
paymentOptions[5828] = new paymentOption(5828,'Canvas Wrap 30 x 20 with 2&quot; wrap','280.00');
paymentOptions[5873] = new paymentOption(5873,'High resolution Image file on cd','30.00');
paymentOptions[69572] = new paymentOption(69572,'High resolution Image file download','30.00');
paymentOptions[13567] = new paymentOption(13567,'Any size to order deliver worldwide - please use contact page','0.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[1164] = new paymentGroup(1164,'Print Prices','46619,5821,13564,13565,4599,4600,5825,5829,5824,5828,5873,69572,13567');
			paymentGroups[14038] = new paymentGroup(14038,'Wed 33% off','46619,46061,46062,46063,46064,13567');
			paymentGroups[5412] = new paymentGroup(5412,'Wedding prints','46619,5821,13564,13565,4599,4600,5873,69572,13567');
	/***************************************************************************
* 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;
}


