$(document).ready(function(){
						   
	$('#Slideshow').cycle({ 
    
	});
	
	$(window).resize(function() {
  		$('#SlideshowContainer, #Slideshow, .SlideshowItem, .SlideshowItem img').width('100%');
	});
	
	// fancybox //
	$(".pop").fancybox({
		prevEffect	: 'elastic',
		nextEffect	: 'elastic',
		helpers	: {
			title	: {
				type: 'outside'
			},
			overlay	: {
				opacity : 0.8,
				css : {
					'background-color' : '#000'
				}
			},
			thumbs	: {
				width	: 50,
				height	: 50
			}
		}
	});
	
	
	//change btn text //
	
	var prevContactBtn = $('.contact.btn').text();
	var prevGeneralBtn = $('.general.btn').text();
	var prevPrijzenBtn = $('.prijzen.btn').text();
	var prevVacaturesBtn = $('.vacatures.btn').text();
	
	$(".contact.btn").click(function(){
	    //$("#panel").slideToggle("slow");
	    var text = $(this).text() == prevContactBtn ? 'Sluit' : prevContactBtn;
	    $(this).text(text);
	});
	
	$(".general.btn").click(function(){
	    //$("#panel").slideToggle("slow");
	    var text = $(this).text() == prevGeneralBtn ? 'Sluit' : prevGeneralBtn;
	    $(this).text(text);
	});
	
	$(".prijzen.btn").click(function(){
	    //$("#panel").slideToggle("slow");
	    var text = $(this).text() == prevPrijzenBtn ? 'Sluit' : prevPrijzenBtn;
	    $(this).text(text);
	});
	
	$(".vacatures.btn").click(function(){
	    //$("#panel").slideToggle("slow");
	    var text = $(this).text() == prevVacaturesBtn ? 'Sluit' : prevVacaturesBtn;
	    $(this).text(text);
	});
	
	$(".btn").toggle(
  	function () {
    	$(this).parent().addClass("open sgParent");
  	},
  	function () {
    	$(this).parent().removeClass("open sgParent");
  	}
	);
 
	
	// Create the dropdown base
      $("<select />").appendTo("#nav");
      
      // Create default option "Go to..."
      $("<option />", {
         "selected": "selected",
         "value"   : "",
         "text"    : "Selecteer een pagina..."
      }).appendTo("#nav select");
      
      // Populate dropdown with menu items
      $("#nav a").each(function() {
       var el = $(this);
       $("<option />", {
           "value"   : el.attr("href"),
           "text"    : el.text()
       }).appendTo("#nav select");
      });
      
	   // To make dropdown actually work
	   // To make more unobtrusive: http://css-tricks.com/4064-unobtrusive-page-changer/
      $("#nav select").change(function() {
        window.location = $(this).find("option:selected").val();
      });

});
