jQuery().ready(function(){

$(function() {
	$('div#winnaar').hide();
		$('a.winnaar').click(function(){
			$("div#winnaar").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	
	
	$('div#bodyboost').hide();
		$('a.bodyboost').click(function(){
			$('span.klik').hide();
			$("div#bodyboost").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	

		
	$('div#zwangerfit').hide();
		$('a.zwangerfit').click(function(){
			$('span.klik').hide();
			$("div#zwangerfit").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	
	
	$('div#bodyattack').hide();
		$('a.bodyattack').click(function(){
			$('span.klik').hide();
			$("div#bodyattack").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	
		
	$('div#jeugdfitness').hide();
		$('a.jeugdfitness').click(function(){
			$("div#jeugdfitness").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	
	
	$('div#pilates').hide();
		$('a.pilates').click(function(){
			$("div#pilates").animate({"height": "toggle"}, { duration: 1000 });
			return false;
		});	
	
	
	$('a.bewegen').remote('#bewegen', function() {
		$('a.bewegen').hide();
		if (window.console && window.console.info) {
			console.info('bewegen loaded');
		}
	});
	
	$.ajaxHistory.initialize();
});

	$('#loadlink').click(function(){
	
		$(this).text('loading...');
		$('#content')
			.append('<div id="content_load"></div>')
			.children('#content_load')
			.hide()
			.load('http://www.palestrawellnesscentre.nl/chapter.php?page=route',
			function() { 
				// This is the callback function
				$('#loadlink').hide();
				$('#content_load').slideDown();
			});
			
		return false;
		
	});
});

$(document).ready(function() {
						   
	var hash = window.location.hash.substr(1);
	var href = $('.loadlink_2').each(function(){
		var href = $(this).attr('href');
		if(hash==href.substr(0,href.length-5)){
			var toLoad = hash+'.html #content';
			$('#content').load(toLoad)
		}											
	});

	$('.loadlink_2').click(function(){
								  
		var toLoad = $(this).attr('href')+' #content_load';
		$('#content_load').hide('fast',loadContent);
		$('#load').remove();
		$('#wrapper').append('<span id="load">LOADING...</span>');
		window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
		function loadContent() {
			$('#').load(toLoad,'',showNewContent())
		}
		function showNewContent() {
			$('#content_load').show('normal',hideLoader());
		}
		function hideLoader() {
			$('#load').fadeOut('normal');
		}
		return false;
		
	});

});
