/* 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[73467] = new paymentOption(73467,'10.5 x 7 inch limited edition prints.','110.00');
paymentOptions[40743] = new paymentOption(40743,'14x11 mount. Fine art traditional','55.00');
paymentOptions[73119] = new paymentOption(73119,'18.5 x 12.33 inch limited edition print','185.00');
paymentOptions[26130] = new paymentOption(26130,'20x16 mount. Fine art matt','85.00');
paymentOptions[66211] = new paymentOption(66211,'20x16 mount. Fine art traditional','85.00');
paymentOptions[73120] = new paymentOption(73120,'24x16inch limited edition print','245.00');
paymentOptions[76474] = new paymentOption(76474,'30 x 20inch limited edition print','375.00');
paymentOptions[47929] = new paymentOption(47929,'24x18 mount. Fine art traditional','125.00');
paymentOptions[15295] = new paymentOption(15295,'24x18 mount. FineArt Matt','125.00');
paymentOptions[50534] = new paymentOption(50534,'30x18 mount. Fine art traditional','160.00');
paymentOptions[50533] = new paymentOption(50533,'30x18 inch mount.Cotton Rag.','160.00');
paymentOptions[20647] = new paymentOption(20647,'30x22&quot; mount. matt fine art','170.00');
paymentOptions[50535] = new paymentOption(50535,'30x22&quot; mount. Fine art traditional','170.00');
paymentOptions[21229] = new paymentOption(21229,'24x16 inch stretched canvas','165.00');
paymentOptions[17386] = new paymentOption(17386,'30x20 inch stretched canvas','245.00');
paymentOptions[25264] = new paymentOption(25264,'40x20 inch stretched canvas','280.00');
paymentOptions[25263] = new paymentOption(25263,'40x30 inch stretched canvas','345.00');
paymentOptions[47235] = new paymentOption(47235,'greetings card inc P&P','2.25');
paymentOptions[61382] = new paymentOption(61382,'letterbox cards inc P&P','1.95');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[4582] = new paymentGroup(4582,'12.5x8.5,  16x12,  9x6 inch sizes','40743,26130,66211');
			paymentGroups[18618] = new paymentGroup(18618,'Greetings cards','47235');
			paymentGroups[4583] = new paymentGroup(4583,'large 18x12 9x6 only','15295,17386');
			paymentGroups[14348] = new paymentGroup(14348,'large and 12.5x8.5 inch mixed','40743,26130,66211,47929,15295,20647,50535,21229,17386,25263');
			paymentGroups[4585] = new paymentGroup(4585,'large and 12.5x8.5 inch mixed inc GC','40743,26130,66211,47929,15295,20647,50535,21229,17386,25263,47235');
			paymentGroups[4584] = new paymentGroup(4584,'letterbox','50534,50533,25264');
			paymentGroups[18770] = new paymentGroup(18770,'letterbox cards','61382');
			paymentGroups[22578] = new paymentGroup(22578,'Limited Edition Prints','73467,73119,73120,76474');
			paymentGroups[4586] = new paymentGroup(4586,'small prints only','40743,26130,66211');
	/***************************************************************************
* 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;
}


