<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var currency = "";
var price = 0;
var newPrice = 0;
var key = 0;
var tour_id = 0;
var dataPrice = 0;

$(document).ready(function ()
{
	$('.paymentCurrency').click(function(e)
	{
		e.preventDefault();

		$('.dropdown-menu li').removeClass('active');
		$(this).parent().addClass('active');
		currency = $(this).text();
		price = $(this).data('price');
		$('.total_currentPrice').css({'margin-left': '2px', 'margin-right': '2px' });
		newPrice = fx(price).from(default_currency).to(currency);

		if (currency != default_currency)
		{
			newPrice = numeral(newPrice).format('0,0');
		}
		else
		{
			newPrice = numeral(price).format('0,0');
		}
		$('.total_currentPrice').text(newPrice);

		$('.currentCurrency').text(currency);

		$('.currentPrice').each(function() {
			price = $(this).data('price');
			newPrice = fx(price).from(default_currency).to(currency);
			newPrice = numeral(newPrice).format('0,0');
			$(this).html(newPrice);
		});

		$.post('/currency/save_session', {currency:currency}, function(){})

	});

	$('.tourCurrency').on('click', function(e)
	{
		e.preventDefault();

		var total_price = 0;

		$('.dropdown-menu li').removeClass('active');
		currency = $(this).text();

		$(".currentPrice").each(function()
		{
			tour_id = $(this).attr('data-tour-id');

			$('.'+currency+''+tour_id).addClass('active');
			$('.currentCurrency'+tour_id).text(currency);

			price = $(this).data('price');
			/*console.log(price,"+");*/

			if (currency != default_currency)
			{
				newPrice = fx(price).from(default_currency).to(currency);
				dataPrice = newPrice;

				newPrice = numeral(newPrice).format('0,0');
			}
			else
			{
				dataPrice = price;
				newPrice = numeral(price).format('0,0');
			}

			if (typeof $(this).data('prefix') !== 'undefined' &amp;&amp; $(this).data('prefix')) {
				$(this).text($(this).data('prefix') + ' ' + newPrice);
			} else {
				$(this).text(newPrice);
			}

			$(this).closest(".book-box-row").find('.extra'+tour_id).attr('data-extra-price', Math.round(dataPrice));
			$(this).closest(".book-box-row").find('.traveler'+tour_id).attr('data-traveler-price', Math.round(dataPrice));
			$selected = $(this).closest(".book-box-row").find('.traveler'+tour_id);
			for($i = 2; $i &lt;= 5; $i++){
				if($selected.attr("data-traveler-isk-price-"+$i))
				{
					$amount = $selected.data("traveler-isk-price-"+$i);
					if (currency != default_currency){
						dataPrice = fx($amount).from(default_currency).to(currency);
					}
					else{
						dataPrice = $amount;
					}

					$selected.attr("data-traveler-price-"+$i, dataPrice);
				}
			}
			total_price = total_price + price;

		});
		$('#cart-total .currentPrice').text = Math.round(total_price);
		$.post('/currency/save_session', {currency:currency}, function(){})
	});

	/*$('.show_room_form').on('click', '.room_pricing .roomCurrency', function(e)
	{
		e.preventDefault();

		$('.dropdown-menu li').removeClass('active');
		currency = $(this).text();

		$(".currentPrice").each(function()
		{
			tour_id = $(this).attr('data-tour-id');

			$('.'+currency+''+tour_id).addClass('active');
			$('.currentCurrency'+tour_id).text(currency);

			price = $(this).data('price');

			if (currency != 'ISK')
			{
				newPrice = fx(price).from("ISK").to(currency);
				dataPrice = newPrice;

				newPrice = numeral(newPrice).format('0,0');
			}
			else
			{
				dataPrice = price;
				newPrice = numeral(price).format('0,0');
			}

			$(this).text(newPrice);

			$('.extra'+tour_id).attr('data-extra-price', Math.round(dataPrice));
			$('.traveler'+tour_id).attr('data-traveler-price', Math.round(dataPrice));

		});
		$.post('/currency/save_session', {currency:currency}, function(){})
	});*/
});</pre></body></html>