/* 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[75236] = new paymentOption(75236,'Print i 20 x30','700.00');
paymentOptions[75237] = new paymentOption(75237,'Print i 30x40 cm','900.00');
paymentOptions[75238] = new paymentOption(75238,'Print i 40x50 cm','1400.00');
paymentOptions[75239] = new paymentOption(75239,'Print i 50x70 cm','2300.00');
paymentOptions[75240] = new paymentOption(75240,'Print i 70x100 cm','3500.00');
paymentOptions[83747] = new paymentOption(83747,'Print i 100x150 cm','5200.00');
paymentOptions[83748] = new paymentOption(83748,'Lerret i 20 x 30 cm','1200.00');
paymentOptions[83749] = new paymentOption(83749,'Lerret i 30 x 40 cm','1600.00');
paymentOptions[83750] = new paymentOption(83750,'Lerret i 40 x 50 cm','2300.00');
paymentOptions[83751] = new paymentOption(83751,'Lerret i 50 x 70 cm','3800.00');
paymentOptions[83752] = new paymentOption(83752,'Lerret i 70 x 100 cm','6000.00');
paymentOptions[83753] = new paymentOption(83753,'Akrylglass i 20 x 30 cm','1300.00');
paymentOptions[83755] = new paymentOption(83755,'Akrylglass i 30 x 40 cm','1700.00');
paymentOptions[83756] = new paymentOption(83756,'Akrylglass i 40 x 50 cm','2400.00');
paymentOptions[83757] = new paymentOption(83757,'Akrylglass i 50 x 70 cm','4000.00');
paymentOptions[83758] = new paymentOption(83758,'Akrylglass i 70 x 100 cm','7600.00');
paymentOptions[83754] = new paymentOption(83754,'Akrylglass i 100 x 150 cm','12000.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[23233] = new paymentGroup(23233,'Størrelser og priser','75236,75237,75238,75239,75240,83747,83748,83749,83750,83751,83752,83753,83755,83756,83757,83758,83754');
	/***************************************************************************
* 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 + ' - kr ' + paymentOption.price + '</option>';
		});
	}
		return temp;
}


