/* 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[20481] = new paymentOption(20481,'Size 1 Unframed: 30cm x 42cm','190.00');
paymentOptions[20487] = new paymentOption(20487,'Size 1 Unframed: 30cm x 42cm','220.00');
paymentOptions[24148] = new paymentOption(24148,'Size 1 Unframed: 30cm x 30cm ','110.00');
paymentOptions[49099] = new paymentOption(49099,'1 x Greeting card','2.00');
paymentOptions[56096] = new paymentOption(56096,'Renting art_4 months','120.00');
paymentOptions[57540] = new paymentOption(57540,'60cm x 40cm, unframed with 5cm white border surrounding image.','150.00');
paymentOptions[79327] = new paymentOption(79327,'10 Greetings cards, 1 design','17.00');
paymentOptions[20486] = new paymentOption(20486,'Size 1 Framed (size incl. mount & frame): 56cm x 68cm','340.00');
paymentOptions[56097] = new paymentOption(56097,'Renting art_8 months','220.00');
paymentOptions[20480] = new paymentOption(20480,'Size 1 Framed (size incl. mount & frame): 56cm x 68cm','320.00');
paymentOptions[24147] = new paymentOption(24147,'Size 1 Framed (incl. size of mount & frame): 42cm x 42cm','200.00');
paymentOptions[20485] = new paymentOption(20485,'Size 2 Unframed: 42cm x 59cm ','370.00');
paymentOptions[20479] = new paymentOption(20479,'Size 2: Unframed 42cm x 59cm ','290.00');
paymentOptions[56098] = new paymentOption(56098,'Renting art_12 months','330.00');
paymentOptions[20496] = new paymentOption(20496,'Size 2 Unframed: 50cm x 50cm  ','190.00');
paymentOptions[20478] = new paymentOption(20478,'Size 2 Framed (size incl. mount & frame): 72cm x 90cm','440.00');
paymentOptions[20484] = new paymentOption(20484,'Size 2 Framed (size incl. mount & frame): 72cm x 90cm','510.00');
paymentOptions[20494] = new paymentOption(20494,'Size 2 Framed (incl. size of mount & frame): 62cm x 62cm','300.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[2647] = new paymentGroup(2647,'35mm Prints','20481,20480,20479,20478');
			paymentGroups[14942] = new paymentGroup(14942,'Greetings cards','49099,79327');
			paymentGroups[25133] = new paymentGroup(25133,'Happy Christmas pack of 4 greeting cards','');
			paymentGroups[7264] = new paymentGroup(7264,'Imagery featured in Parallel Lines','');
			paymentGroups[6115] = new paymentGroup(6115,'Layered & Unveiled imagery','20487,20486,20485,20484');
			paymentGroups[17635] = new paymentGroup(17635,'Max Dawn Summer Exhibition 2010','57540');
			paymentGroups[6119] = new paymentGroup(6119,'Polaroid Imagery','24148,24147,20496,20494');
			paymentGroups[17124] = new paymentGroup(17124,'Renting art','56096,56097,56098');
	/***************************************************************************
* 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;
}


