function doSomething(to) {
	saddr = document.getElementById('saddr').value;
		$.fancybox([
			{ 'href'    : 'http://maps.google.nl/?f=d&source=s_d&saddr=' + saddr + '&daddr=' + to }
		],{
			'width'             : '90%',
			'height'            : '90%',
			'transitionIn'      : 'none',
			'transitionOut'     : 'none',
			'type'              : 'iframe'
		});

		return false;
}

$(function(){
	//NAVIGATION DROPDOWN
	//$('#nav ul li').hover( function() {
	//	$(this).children('ul').stop(true, true).fadeIn(200);
	//}, function() {
	//	$(this).children('ul').stop(true, true).fadeOut(200);
	//});

	$('#logo').click(function(){
		window.location.href = 'index.php'
	});

	$.fn.fullBg = function(){
		var bgImg = $(this);

		function resizeImg() {
		var imgwidth = bgImg.width();
		var imgheight = bgImg.height();

		var winwidth = $(window).width();
		var winheight = $(window).height();

		var widthratio = winwidth / imgwidth;
		var heightratio = winheight / imgheight;

		var widthdiff = heightratio * imgwidth;
		var heightdiff = widthratio * imgheight;

		if(heightdiff>winheight) {
			bgImg.css({
				width: winwidth+'px',
				height: heightdiff+'px'
			});
		} else {
			bgImg.css({
				width: widthdiff+'px',
				height: winheight+'px'
			});
		}
	}

		$(window).load(function() {
			resizeImg();
		});

		$(window).resize(function() {
			resizeImg();
		});
	};

	$(".fullBg").fullBg();

	$('h1').after('<img src="img/slash2.png" class="floatLeft" height="30" style="margin: -4px 0 0 5px;" /><br clear="all" />');

	//SOCIAL MEDIA HOVER
	if (navigator.appName != "Microsoft Internet Explorer") {
		$('.socialIcon').fadeTo(0, 0.7);
		$('.socialIcon').hover( function() {
			$(this).stop(true, true).fadeTo(300, 1);
		}, function() {
			$(this).stop(true, true).fadeTo(300, 0.7);
		});
	}

	//CUFON
	Cufon.replace('h1')('h2');
	Cufon.replace('#nav a', { hover : true });

	//CYCLE ARTIKEL HOME
	$('#header_cycle').cycle({
		fx: 'fade',
		timeout: 4500
	});

	//CYCLE NEWS ARCHIVE
	$('#newsArchive').cycle({
		fx: "scrollVert",
		timeout: 0,
		startingSlide:   0,
		pager:  '.pager',
		pagerAnchorBuilder: function(idx, slide) {
			return '<a href="#"> &ordm; </a>';
		}
	}, 500);

	//CYCLE GALLERIES ARCHIVE
	$('#photogalleries').cycle({
		fx: "scrollVert",
		timeout: 0,
		startingSlide:   0,
		pager:  '.pager',
		pagerAnchorBuilder: function(idx, slide) {
			return '<a href="#"> &ordm; </a>';
		}
	}, 500);

	//CYCLE GALLERIES ARCHIVE
	$('#photogallery').cycle({
		fx: "scrollVert",
		timeout: 0,
		startingSlide:   0,
		pager:  '.pager',
		pagerAnchorBuilder: function(idx, slide) {
			return '<a href="#"> &ordm; </a>';
		}
	}, 500);

	//FANCYBOX
		$(".fancybox").fancybox();

	//FANCYBOX FLOORPLANNER
		$("a.fancyboxIframe").fancybox({
			'width'				: '85%',
			'height'			: '85%',
			'autoScale'     	: false,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'type'				: 'iframe'
		});

	//FANCYBOX PROJECTEN
	$("a.gallery").fancybox({
			titlePosition : 'inside',
			titleFormat   : function(title, currentArray, currentIndex, currentOpts) {
				return '<span id="fancybox-title-inside">' +  (currentIndex + 1) + ' / ' + currentArray.length + '</span>';
			}
	});

});



