/* 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[21153] = new paymentOption(21153,'Wedding Books I','75.00');
paymentOptions[83914] = new paymentOption(83914,'Portrait Package - First Child','25.00');
paymentOptions[83915] = new paymentOption(83915,'Portrait Package - Second or Subsequent Child','15.00');
paymentOptions[21156] = new paymentOption(21156,'Wedding Book II','175.00');
paymentOptions[21277] = new paymentOption(21277,'Additional Pages I','9.00');
paymentOptions[21278] = new paymentOption(21278,'Additional Pages II','12.00');
paymentOptions[21150] = new paymentOption(21150,'Prints I - 12 x 18 cm','1.50');
paymentOptions[21154] = new paymentOption(21154,'Prints III - 20 x 30 cm','5.00');
paymentOptions[83916] = new paymentOption(83916,'Prints II - 18 x 24 cm','3.00');
paymentOptions[21155] = new paymentOption(21155,'Prints IV - 30 x 45 cm','12.00');
paymentOptions[47264] = new paymentOption(47264,'Prints V - 12 x 18 cm - Min 20 prints','1.00');
paymentOptions[47265] = new paymentOption(47265,'Prints VI - 20 x 30cm - Min 20 prints','5.00');
paymentOptions[47266] = new paymentOption(47266,'Prints VII - 30 x 45 cm - Min 20 prints','8.00');
paymentOptions[48455] = new paymentOption(48455,'Prints on Canvas I 20 x30 cm ','50.00');
paymentOptions[48456] = new paymentOption(48456,'Prints on Canvas II 30 x 45 cm ','75.00');
paymentOptions[48457] = new paymentOption(48457,'Prints on Canvas III 50 x 70 cm ','90.00');
paymentOptions[48462] = new paymentOption(48462,'Photo Books','200.00');
paymentOptions[60716] = new paymentOption(60716,'Portrait Session - Up to 3 Hours','250.00');
paymentOptions[60717] = new paymentOption(60717,'Travel/Additional Costs','20.00');
paymentOptions[60718] = new paymentOption(60718,'Portrait Session - Additional Hours','45.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[14745] = new paymentGroup(14745,'Photo Books - Portraits','48462');
			paymentGroups[18646] = new paymentGroup(18646,'Portrait Sessions','60716,60717,60718');
			paymentGroups[14746] = new paymentGroup(14746,'Prints','21150,21154,21155');
			paymentGroups[6309] = new paymentGroup(6309,'Prints & Prints on Canvas','21150,21154,21155,48455,48456,48457');
			paymentGroups[14744] = new paymentGroup(14744,'Prints on Canvas','48455,48456,48457');
			paymentGroups[26036] = new paymentGroup(26036,'School Photo Packages','83914,83915');
			paymentGroups[26037] = new paymentGroup(26037,'School Prints','21150,21154,83916');
			paymentGroups[6311] = new paymentGroup(6311,'Wedding Books','21153,21156,21277,21278');
	/***************************************************************************
* 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 + ' - &euro;' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


