/* 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[34845] = new paymentOption(34845,'SALE PRICE + delivery (within UK)','58.00');
paymentOptions[35902] = new paymentOption(35902,'SALE PRICE + delivery (IRELAND)','65.00');
paymentOptions[35903] = new paymentOption(35903,'SALE PRICE + delivery (USA)','75.00');
paymentOptions[35904] = new paymentOption(35904,'SALE PRICE + delivery (WORLDWIDE)','85.00');
paymentOptions[37571] = new paymentOption(37571,'A4 Print Only','30.00');
paymentOptions[37572] = new paymentOption(37572,'A4 Print plus signed mount','37.00');
paymentOptions[37573] = new paymentOption(37573,'A3 Print only','40.00');
paymentOptions[37574] = new paymentOption(37574,'A3 Print plus signed mount','49.00');
paymentOptions[37575] = new paymentOption(37575,'A4 Print + signed + framed - Wenge','78.00');
paymentOptions[37580] = new paymentOption(37580,'A4 Print signed+framed  Mahogany','78.00');
paymentOptions[37576] = new paymentOption(37576,'A3 Print + signed + framed - Wenge','108.00');
paymentOptions[37581] = new paymentOption(37581,'A3 Print  signed+framed Mahogany','108.00');
paymentOptions[63970] = new paymentOption(63970,'First Class Delivery (Within the UK)','2.35');
paymentOptions[63971] = new paymentOption(63971,'Second Class Mail (Within the UK)','2.25');
paymentOptions[63972] = new paymentOption(63972,'First Class Delivery (Europe Only)','2.85');
paymentOptions[63973] = new paymentOption(63973,'First Class Delivery (Worldwide - Outside Europe)','3.50');
paymentOptions[63974] = new paymentOption(63974,'First Class Delivery (Within the UK)','8.35');
paymentOptions[63975] = new paymentOption(63975,'Second Class Mail (Within the UK)','8.20');
paymentOptions[63976] = new paymentOption(63976,'First Class Delivery (Europe Only)','9.35');
paymentOptions[63977] = new paymentOption(63977,'First Class Delivery (Worldwide - Outside Europe)','10.70');
paymentOptions[63978] = new paymentOption(63978,'First Class Delivery (Within the UK)','16.20');
paymentOptions[63979] = new paymentOption(63979,'Second Class Mail (Within the UK)','16.10');
paymentOptions[63980] = new paymentOption(63980,'First Class Delivery (Europe Only)','17.75');
paymentOptions[63981] = new paymentOption(63981,'First Class Delivery (Worldwide - Outside Europe)','19.90');
paymentOptions[63982] = new paymentOption(63982,'First Class Delivery (Within the UK)','32.40');
paymentOptions[63983] = new paymentOption(63983,'Second Class Mail (Within the UK)','32.20');
paymentOptions[63984] = new paymentOption(63984,'First Class Delivery (Europe Only)','35.30');
paymentOptions[63985] = new paymentOption(63985,'First Class Delivery (Worldwide - Outside Europe)','39.80');
/***************************************************************************
* Create the array of payment groups. If site does notuse groups create    *
* just one with an ID of 0                                                 *
***************************************************************************/
var paymentGroups = new Object();
			paymentGroups[11594] = new paymentGroup(11594,'Gallery Images','37571,37572,37573,37574,37575,37580,37576,37581');
			paymentGroups[19570] = new paymentGroup(19570,'GREETINGS CARDS (16 PACK)','63982,63983,63984,63985');
			paymentGroups[19568] = new paymentGroup(19568,'Greetings Cards (4 pack)','63974,63975,63976,63977');
			paymentGroups[19569] = new paymentGroup(19569,'Greetings Cards (8 pack)','63978,63979,63980,63981');
			paymentGroups[19567] = new paymentGroup(19567,'Greetings Cards (Single)','63970,63971,63972,63973');
			paymentGroups[10755] = new paymentGroup(10755,'SALE SALE SALE','34845,35902,35903,35904');
	/***************************************************************************
* 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;
}


