$(document).ready(function()
{
	// Init
	prepLeesMeerLinks();
	fancyBoxThumbs();
	
	$('#btn_toon_camping').fancybox();
});


// Functions
function prepLeesMeerLinks()
{
	var linksArr = $("a.toggleLink");
	
 	if (linksArr.length == 0) return false;
 	
 	
 	linksArr.each(
 		function()
 		{
 			$(this).click(
 				function()
 				{
 					var divElm = $($(this).attr("href"))
 					if ($(this).text() == "Lees meer")
 					{
 						divElm.show("slow");
 						$(this).text("Schuif in").addClass("hide")
 					}
 					else
 					{
 						divElm.hide("slow");
 						$(this).text("Lees meer").removeClass("hide")
 					}
 					
 					return false;
 				}
 			)
 		}
 	)
}

function fancyBoxThumbs() {
	$('ul.thumbs a').each(function() {
        $(this)
            .css({
                "-webkit-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg)',
                "-moz-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg)'
            })
            .hover(function() {
                $(this).css({
                    "-webkit-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg) scale(1.05)',
                    "-moz-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg) scale(1.05)'
                })
            }, function() {
                $(this).css({
                    "-webkit-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg) scale(1)',
                    "-moz-transform": 'rotate(' + (Math.floor(Math.random()*10)-5) + 'deg) scale(1)'
                })
            })
	});
	
	$('a.group').fancybox({
		'hideOnContentClick': false
	})
}
