/* 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[76577] = new paymentOption(76577,'4 x low res electronic images for face book','9.00');
paymentOptions[76574] = new paymentOption(76574,'4 x 6 Print','5.00');
paymentOptions[76573] = new paymentOption(76573,'5 x 7 PRINT','8.50');
paymentOptions[28095] = new paymentOption(28095,' 10 x 8 PRINT','12.50');
paymentOptions[27688] = new paymentOption(27688,'A4 PRINT','15.00');
paymentOptions[22831] = new paymentOption(22831,'A3  PRINT','30.00');
paymentOptions[22970] = new paymentOption(22970,'CD','20.00');
paymentOptions[69787] = new paymentOption(69787,'face book electronic image','4.95');
paymentOptions[40766] = new paymentOption(40766,'key Ring','5.00');
paymentOptions[57858] = new paymentOption(57858,'Fridge Magnet 70mm X 45mm','5.00');
paymentOptions[76575] = new paymentOption(76575,'photo mug','9.50');
paymentOptions[76576] = new paymentOption(76576,'mouse mat','8.99');
paymentOptions[56460] = new paymentOption(56460,'Tryptic 3 images mounted','40.00');
paymentOptions[56457] = new paymentOption(56457,'A3 unmounted collage up to 6 images','36.00');
paymentOptions[56458] = new paymentOption(56458,'A3 collage mounted up to 6 images','45.00');
paymentOptions[31967] = new paymentOption(31967,'panorama 6 x 12 PRINT','25.00');
paymentOptions[67929] = new paymentOption(67929,'cd image set','50.00');
paymentOptions[56543] = new paymentOption(56543,'air a','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[17291] = new paymentGroup(17291,'air a','56543');
			paymentGroups[6939] = new paymentGroup(6939,'cd','22970');
			paymentGroups[21587] = new paymentGroup(21587,'cd image set','67929');
			paymentGroups[17921] = new paymentGroup(17921,'dogs','27688,40766,57858');
			paymentGroups[18063] = new paymentGroup(18063,'finchingfield','76574,76573,28095,27688,22831,69787,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[23613] = new paymentGroup(23613,'frc','76577,76574,76573,28095,27688,22831,22970,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[22658] = new paymentGroup(22658,'horseheath','40766,57858');
			paymentGroups[8964] = new paymentGroup(8964,'HRH','76574,76573,28095,27688,22831,40766,76576,56460,56457');
			paymentGroups[7839] = new paymentGroup(7839,'Hunting','76574,76573,28095,27688,22831,69787,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[14316] = new paymentGroup(14316,'johnnies','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[17922] = new paymentGroup(17922,'jump cross','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[20249] = new paymentGroup(20249,'lisa','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,67929');
			paymentGroups[13699] = new paymentGroup(13699,'lovely view','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[8303] = new paymentGroup(8303,'mdfc pan','76574,56460,56457');
			paymentGroups[22606] = new paymentGroup(22606,'music tour','76574,76573,28095,27688,22831,22970,40766,57858,76576,56460,56457,56458');
			paymentGroups[6938] = new paymentGroup(6938,'panorama','76576');
			paymentGroups[17923] = new paymentGroup(17923,'pet ','');
			paymentGroups[17589] = new paymentGroup(17589,'Photo jigsaw','');
			paymentGroups[18901] = new paymentGroup(18901,'phpc','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[9876] = new paymentGroup(9876,'polo 1','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[9877] = new paymentGroup(9877,'polo2','31967');
			paymentGroups[8528] = new paymentGroup(8528,'spc','76574,76573,28095,27688,22831,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[6937] = new paymentGroup(6937,'Standard','76574,76573,28095,27688,22831,69787,40766,57858,76575,76576,56460,56457,56458');
			paymentGroups[17252] = new paymentGroup(17252,'tryptic','56460');
			paymentGroups[24765] = new paymentGroup(24765,'wedding','76574,76573,28095,27688,22831,40766,57858,56460,56457,56458,67929');
	/***************************************************************************
* 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;
}


