$(document).ready(
	function()
	{
		makeKaartNL();
		makeCahier();
		bindButtons();
	}
);

function makeKaartNL()
{
	
	$("#kaartnl").html('');
	$("#kaartnl").flash(
		{
			swf: "/swf/Interactievekaart.swf",
			width: 600, 
			height: 400,
			wmode: "transparent",
			params:	{
				wmode:	"transparent"

			}
			
		}
	);

	$(".nllandkaart span").html('');
	$(".nllandkaart span").flash(
		{
			swf: "/swf/Interactievekaart-small.swf",
			width: 244, 
			height: 267,
			wmode: "transparent",
			params:	{
				wmode:	"transparent"

			}
			
		}
	);
}

function makeCahier()
{
	$("#cahierflip").html('');
	$("#cahierflip").flash(
		{
			swf: "/Cahier_pageFlip/book.swf",
			width: '100%', 
			height: '100%',
			id: 'book',
			hasVersion: '8',
			bgcolor: '#cccccc',
			params: {
				xmlFile: "/Cahier_pageFlip/data/pages.xml", 
				fullscreen: "true"
			}
		}
	);
}

function bindButtons()
{
	var iWidth = $(document).width();
	var iHeight = $(document).height();
	
	var iLeftModal;
	var iTopModal;
	
	iLeftModal = Math.round((iWidth / 2) - 310);
	iTopModal = 20;
	
	$(".viewernav a").click(
		function()
		{
			$("#modal-content img").attr("src", $(this).attr("href"));

			$("#modal-shadow").height(iHeight).width(iWidth).show();
			$("#modal").css("top", iTopModal).css("left", iLeftModal).show();
			return false;
		}
	);
	
	bindModal();
}

function bindModal()
{
	$("#modal .modal-close").click(
			function()
			{
					$("#modal").hide();
					$("#modal-shadow").hide();
			}
	);
}

