/* 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[21754] = new paymentOption(21754,'10 x 8 Complete with 1&quot; Cream mount.','17.00');
paymentOptions[64841] = new paymentOption(64841,'5 x 7 Gloss Print includes Postage & Packing to the UK','4.99');
paymentOptions[64856] = new paymentOption(64856,'5 x 7 Lustre finish includes Postage & packing to the UK','4.99');
paymentOptions[64858] = new paymentOption(64858,'8 x 6 Gloss Print includes Postage & packing to the UK','9.99');
paymentOptions[64843] = new paymentOption(64843,'8 x 6 Lustre finish includes Postage & packing to the UK','9.99');
paymentOptions[21755] = new paymentOption(21755,'12 x 10 Complete with 2&quot; Cream mount. ','25.00');
paymentOptions[21756] = new paymentOption(21756,'16 x 12 Complete with 2&quot; Cream mount.','35.00');
paymentOptions[64845] = new paymentOption(64845,'10 x 8 Gloss Print includes Postage & packing to the UK','14.99');
paymentOptions[64861] = new paymentOption(64861,'10 x 8 Lustre finish includes Postage & packing to the UK','14.99');
paymentOptions[65883] = new paymentOption(65883,'10 x 12 Lustre finish includes Postage & packing to the UK','19.99');
paymentOptions[65884] = new paymentOption(65884,'10 x 12 Gloss finish includes Postage & packing to the UK','19.99');
paymentOptions[64863] = new paymentOption(64863,'16 x 12  Gloss Print includes Postage & packing to the UK','29.99');
paymentOptions[64846] = new paymentOption(64846,'16 x 12  Lustre finish includes Postage & packing to the UK','29.99');
paymentOptions[64847] = new paymentOption(64847,'20 x 16  Gloss Print includes Postage & packing to the UK','49.99');
paymentOptions[27532] = new paymentOption(27532,'100 Postcards','21.00');
paymentOptions[27538] = new paymentOption(27538,'12 x 16 Photograph 2&quot; Cream mount with a Ash frame.','80.00');
paymentOptions[64864] = new paymentOption(64864,'20 x 16 Lustre finish includes Postage & packing to the UK','49.99');
paymentOptions[64865] = new paymentOption(64865,'24 x 20 Gloss print includes Postage & packing to the UK','74.99');
paymentOptions[27539] = new paymentOption(27539,'16 x 23 Photograph 2&quot; Cream mount with a  Ash frame.','110.00');
paymentOptions[64848] = new paymentOption(64848,'24 x 20 Lustre finish includes Postage & packing to the UK','74.99');
paymentOptions[64849] = new paymentOption(64849,'10 x 12 Canvas print includes Postage & packing to the UK. Available in gloss, matte or satin finish. Please e-mail  me your required finish.','62.99');
paymentOptions[30705] = new paymentOption(30705,'16 x 12 Complete with 2&quot; Cream mount','45.00');
paymentOptions[32936] = new paymentOption(32936,'10 x 12 Complete with 2&quot; Cream mount.  ','25.00');
paymentOptions[64850] = new paymentOption(64850,'12 x 16 Canvas print includes Postage & packing to the UK. Available in gloss, matte or satin finish. Please e-mail me your required finish.','79.99');
paymentOptions[64851] = new paymentOption(64851,'16 x 20 Canvas print includes Postage & packing to the UK. Available in gloss, matte or satin finish. Please e-mail me your required finish.','119.99');
paymentOptions[64852] = new paymentOption(64852,'20 x 24 Canvas print includes Postage & packing to the UK. Available in gloss, matte or satin finish. Please e-mail me your required finish.','149.99');
paymentOptions[64853] = new paymentOption(64853,'20 x 30 Canvas print includes Postage & packing to the UK. Available in gloss, matte or satin finish. Please e-mail me your required finish.','199.99');
paymentOptions[34690] = new paymentOption(34690,'18 x 6 with a 3\'\' cream mount','45.00');
paymentOptions[36181] = new paymentOption(36181,'20in x 20in mounted with ash frame','99.00');
paymentOptions[36182] = new paymentOption(36182,'20in x 16in 2&quot; Cream mount with ash frame','99.00');
paymentOptions[35094] = new paymentOption(35094,'12 x 12 Complete with 3&quot; Cream mount.','45.00');
paymentOptions[53959] = new paymentOption(53959,'Blank Race Horse Greeting cards.','3.00');
paymentOptions[55215] = new paymentOption(55215,'48in x 16in with cream mount and ash frame','200.00');
paymentOptions[58045] = new paymentOption(58045,'Print 7 x 5 ','9.00');
paymentOptions[58046] = new paymentOption(58046,'Print 7 x 5 Complete with mount.','15.00');
paymentOptions[58047] = new paymentOption(58047,'Print 10 x 8','15.00');
paymentOptions[58048] = new paymentOption(58048,'Print 10 x 8 Complete with mount.','24.00');
paymentOptions[58049] = new paymentOption(58049,'Print 10 x 12','18.00');
paymentOptions[58050] = new paymentOption(58050,'Print 10 x 12 Complete with mount.','30.00');
paymentOptions[58051] = new paymentOption(58051,'Print 16 x 12','30.00');
paymentOptions[58052] = new paymentOption(58052,'Print 16 x 12 Complete with mount.','45.00');
paymentOptions[76962] = new paymentOption(76962,'Commercial-use license image e-mail for further detail\'s','35.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[10230] = new paymentGroup(10230,' Portraits','32936');
			paymentGroups[16354] = new paymentGroup(16354,'Blank Horse racing greeting cards..','53959');
			paymentGroups[9452] = new paymentGroup(9452,'Bridie Barnes..','30705');
			paymentGroups[11164] = new paymentGroup(11164,'Framed Photographs.','27538,27539,36181,36182');
			paymentGroups[20533] = new paymentGroup(20533,'Hoggin','64856,64843,64861,65883,64846');
			paymentGroups[17830] = new paymentGroup(17830,'Horse photographs prices','58045,58046,58047,58048,58049,58050,58051,58052');
			paymentGroups[11170] = new paymentGroup(11170,'Long Frame','55215');
			paymentGroups[10691] = new paymentGroup(10691,'Long Mount','34690');
			paymentGroups[11162] = new paymentGroup(11162,'Mount and Framed','36182');
			paymentGroups[8468] = new paymentGroup(8468,'Mounts','21754,21755,21756');
			paymentGroups[19795] = new paymentGroup(19795,'Portrait and Wedding Prints.','64858,64843,64845,64861,65883,65884,64863,64846,64847,64864,64865,64848,64849,64850,64851,64852,64853');
			paymentGroups[8467] = new paymentGroup(8467,'Postcards','27532');
			paymentGroups[10801] = new paymentGroup(10801,'Square','35094');
			paymentGroups[11166] = new paymentGroup(11166,'Square Frame 20x 20 with a Ash frame','36181');
			paymentGroups[23722] = new paymentGroup(23722,'wye valley','64843,64846,76962');
	/***************************************************************************
* 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;
}


