// cases
$(document).ready(function() {
	// rollover effect
	$("ul#studienav li a").hover(
		function () {
			$(this).animate({"paddingLeft": "20px"}, "fast");
		}, 
		function () {
			if($(this).attr("class") != "in"){
				$(this).animate({"paddingLeft": "15px"}, "fast");
			}
		}
	)
	
	// swap
	$("ul#studienav li a").click(function(){
		showMe($(this).attr("href"));
		return false;
	});
	initShowMe();
	var randomnumber = Math.floor(Math.random()*3)
	showMe(randomnumber+1);
});

// show case
function showMe(dit){
	initShowMe();
	
	$("#foto_"+dit).fadeIn();
	$("#txt_"+dit).fadeIn();
	$("#tab-"+dit+" a").addClass("in");
	
	// alert(dit);
}

function initShowMe(){
	$("#foto_1").hide();
	$("#foto_2").hide();
	$("#foto_3").hide();
	
	$("#txt_1").hide();
	$("#txt_2").hide();
	$("#txt_3").hide();
	
	$("#studienav a").removeClass("in");
}



// .header
$(document).ready(function() {
	$(".header .cont").hide();
	// pijl
	/*
	$(".header>a").toggle(
	  function () {
		$(this).addClass("open");
		$(this).parent().addClass("slide");
		$(this).parent().find(".cont").slideDown();
		// $(this).parent().find(".cont").show();
	  },
	  function () {
		$(this).removeClass("open");
		$(this).parent().removeClass("slide");
		$(this).parent().find(".cont").slideUp();
		// $(this).parent().find(".cont").hide();
	  }
	);
	*/
	
	$(".header>a").click(function () {
		if($(this).parent().find(">a").attr("class") != "open"){
			$(this).addClass("open");
			$(this).parent().addClass("slide");
			$(this).parent().find(".cont").slideDown();
			// $(this).parent().find(".cont").show();
		}else if($(this).parent().find(">a").attr("class") == "open"){
			$(this).removeClass("open");
			$(this).parent().removeClass("slide");
			$(this).parent().find(".cont").slideUp();
			// $(this).parent().find(".cont").hide();
		}
	  }
	);
	
	$(".header>h1").click(function () {
		if($(this).parent().find(">a").attr("class") != "open"){
			$(this).parent().find(">a").addClass("open");
			$(this).parent().addClass("slide");
			$(this).parent().find(".cont").slideDown();
			// $(this).parent().find(".cont").show();
		}else if($(this).parent().find(">a").attr("class") == "open"){
			$(this).parent().find(">a").removeClass("open");
			$(this).parent().removeClass("slide");
			$(this).parent().find(".cont").slideUp();
			// $(this).parent().find(".cont").hide();
		}
	  }
	);
	

});

/* goSetHeight */
function goSetHeight(dit){	

	var maximaHeight = 0;
	
	$(dit).each(function(){
							   
		nuHeight = $(this).height();
		if(nuHeight > maximaHeight){
			
			maximaHeight = $(this).height();
		}
		
	});

	$(dit).each(function(){
		$(this).height(maximaHeight);
	});
	
};

// .klanten
$(document).ready(function() {
	$("ul.klanten li a").hover(
      function(){
		x = $(this).html();
		$(this).html("");
		regexp = "http://";
        $(this).append($("<span><strong>Bezoek</strong> "+ $(this).attr("href").replace(regexp,"") +"</span>"));
      }, 
      function(){
        $(this).find("span:last").remove();
		$(this).html(x);
      }
    );

});

// Team
$(document).ready(function() {
	$(".person .cont").hide();
	$(".person>h2").toggle(
	  function () {
		$(this).addClass("open");
		$(this).parent().addClass("slide");
		$(this).parent().find(".cont").slideDown();
	  },
	  function () {
		$(this).removeClass("open");
		$(this).parent().removeClass("slide");
		$(this).parent().find(".cont").slideUp();
	  }
	);

});