var currentBio = "bio1";

function showAgenda(year,month){
	$('#agendadetail').fadeOut('fast', function(){
		$.ajax({
 			url: "http://www.matangi.nl/getagenda.php?year="+year+"&month="+month,
  			async: false,
  			dataType: 'text',
  			success: function(data) {
  				$('#agendadetail').html(data);
  				$('.scrollme').scrollbar();
  			}
 		}).responseText;
		$('#agendadetail').fadeIn();
 	});
}

function superToggle(id,nr){
	var i=0;
	$('.'+id).each(function(index) {
		if(i==nr){
			$(this).css("display","block");
		} else {
			$(this).css("display","none");
		}
		i++;
	});

}

function toggleDrop(id){
	if(	$('#'+id).css('display')=='none'  ){
		$('#'+id).slideDown();
	} else {
		$('#'+id).slideUp();
	}
}


function switchDiv(id,clss){
	$('.'+clss).each(function(index) {
		if( $(this).css('display')!='none'){
			$(this).fadeOut();
		}
	});
	$('#'+id).fadeIn();
}

function switchDiv2(id,clss){
	$('#'+clss).each(function(index) {
		if( $(this).css('display')!='none'){
			$(this).fadeOut();
		}
	});
	$('.'+id).fadeIn();
}

$(document).ready(function() {
		
	if( $(window).height() <600 ){
		$('#extrapad').css("height","50px");
	}
		
	$('.background').delay(200).fadeIn(2000);

	$('.background-home').fadeIn(1500);
	
	$('.home-logo img').delay(500).fadeIn(1000);

	$('.wrapper').fadeIn(700);
	
	/*
	$('.newsletter').click(function() {	
		$('.overlay').fadeIn(500);
	});
	
	$('.close').click(function() {
		$('.overlay').fadeOut(500);
	});
	*/
	
	
	$('#mat').click(function() {
	
		$("#"+currentBio).fadeOut(300,function() {
				$("#bio1").fadeIn(300);
				currentBio = "bio1";
			});
			
	});
	
	
	$('.about-pictures .lid').click(function() {
		
		var thisLid = $(this).attr('id');
		$('.about-pictures .selected').removeClass("selected");
		$("#"+thisLid).addClass("selected");
		
		if(thisLid == "lid1") {
		
			$("#"+currentBio).fadeOut(300,function() {
				$("#bio2").fadeIn(300);
				currentBio = "bio2";
			});

		}
		
		if(thisLid == "lid2") {
		
			$("#"+currentBio).fadeOut(300,function() {
				$("#bio3").fadeIn(300);
				currentBio = "bio3";
			});

		}
		
		if(thisLid == "lid3") {
		
			$("#"+currentBio).fadeOut(300,function() {
				$("#bio4").fadeIn(300);
				currentBio = "bio4";
			});

		}
		
		if(thisLid == "lid4") {
		
			$("#"+currentBio).fadeOut(300,function() {
				$("#bio5").fadeIn(300);
				currentBio = "bio5";
			});

		}
	
	})
	
	
	$('.nl').click(function() {
	
		$("#"+currentBio).fadeOut(300,function() {
				$("#bio6").fadeIn(300);
				currentBio = "bio6";
			});
			
	});
	
	$('.en').click(function() {
	
		$("#"+currentBio).fadeOut(300,function() {
				$("#bio1").fadeIn(300);
				currentBio = "bio1";
			});
			
	});
		
});

     	$(document).ready(function() {
        	$('.css-scrollbar').scrollbar();
        	$('.scrolldit').scrollbar();
        	
        	$('.arrowtje').live('click', function() {
	
				var url = "http://www.matangi.nl/img/doublearrow-down.png";
				$(this).attr('src',url);
				$(this).addClass('clicked');

			});
			
			$('.clicked').live('click', function() {
	
				var url2 = "http://www.matangi.nl/img/doublearrow.png";
				$(this).attr('src',url2);
				$(this).removeClass('clicked');

			});
			
      	});
	

