jQuery(function($) {

	function resizeImprovementsMap() {
		$('#pano-canvas').height(Math.round($('#pano-canvas').width() * 1.34) + 'px');
		$('.featherlight-inner').height(Math.round($(window).height() - (10 / 100 * $(window).height())) + 'px').width(Math.round($(window).width() - (10 / 100 * $(window).width())) + 'px');
	}

	resizeImprovementsMap();

	$(window).on('resize', function() {
		resizeImprovementsMap();
    });

});

function openUrl(posterUrlPath) {
	jQuery(function($) {
		$.featherlight({iframe: '/improvements-map-assets/posters/' + posterUrlPath + '.html', iframeMaxWidth: '100%', iframeWidth: 800,
	    iframeHeight: 600,
			afterOpen: function(event) {
	    		$('.featherlight-inner').height(Math.round($(window).height() - (10 / 100 * $(window).height())) + 'px').width(Math.round($(window).width() - (10 / 100 * $(window).width())) + 'px');
			}
		});
	});
}