/* 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[35670] = new paymentOption(35670,'9&quot; X 6&quot; Glossy','3.50');
paymentOptions[32532] = new paymentOption(32532,'9&quot; x 6&quot;','7.50');
paymentOptions[35671] = new paymentOption(35671,'A4 Glossy','7.50');
paymentOptions[32533] = new paymentOption(32533,'A4','15.00');
paymentOptions[38449] = new paymentOption(38449,'7&quot; x 5&quot; Glossy or Matt','3.00');
paymentOptions[38450] = new paymentOption(38450,'5&quot; x 5&quot; Glossy or Matt','3.00');
paymentOptions[38451] = new paymentOption(38451,'9&quot; x 6&quot; or 6&quot; x 9&quot; Glossy or Matt','3.50');
paymentOptions[38452] = new paymentOption(38452,'10&quot; x 8&quot;  Glossy','5.00');
paymentOptions[38453] = new paymentOption(38453,'12&quot; x 8&quot; Glossy ','5.00');
paymentOptions[45050] = new paymentOption(45050,'15&quot; x 10&quot; Glossy','10.00');
paymentOptions[62217] = new paymentOption(62217,'9&quot; x 6&quot; Glossy','5.00');
paymentOptions[69319] = new paymentOption(69319,'7&quot; x 5&quot; Glossy','4.50');
paymentOptions[69320] = new paymentOption(69320,'9&quot; x 6&quot; Glossy','5.50');
paymentOptions[69321] = new paymentOption(69321,'10&quot; x 8&quot; Glossy','6.50');
paymentOptions[65615] = new paymentOption(65615,'7&quot; x 5&quot; Glossy','3.50');
paymentOptions[65616] = new paymentOption(65616,'9&quot; x 6&quot; Glossy','5.00');
paymentOptions[65617] = new paymentOption(65617,'A4 Glossy ','7.00');
paymentOptions[65618] = new paymentOption(65618,'A3 ','10.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[10993] = new paymentGroup(10993,'BMW Trackday','35670,35671');
			paymentGroups[17618] = new paymentGroup(17618,'Glossy 10&quot; x 8&quot;','38452');
			paymentGroups[10992] = new paymentGroup(10992,'Glossy 9&quot; x 6&quot;','35670');
			paymentGroups[10103] = new paymentGroup(10103,'Glossy Print','35670,38452');
			paymentGroups[13717] = new paymentGroup(13717,'Model Yachts','35670,38452,38453,45050');
			paymentGroups[11882] = new paymentGroup(11882,'Rugby','38449,38450,38451,38452,38453');
			paymentGroups[21382] = new paymentGroup(21382,'Santa Dash ','69319,69320,69321');
			paymentGroups[19016] = new paymentGroup(19016,'Tour Series','62217');
			paymentGroups[20035] = new paymentGroup(20035,'Young Athletes Open 2011','65615,65616,65617,65618');
	/***************************************************************************
* 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;
}


