// JavaScript Document

$(document).ready(function () {
	/*
	//Links naar column detailpage
								   $("a.LinkList").click(function(event) {
															  $('#Left').hide(); 
															  event.preventDefault();					  
                               var to_get = $(this).attr('href');
var parts = to_get.split('?');
$.get(parts[0],parts[1],function(data){
//   $('#Left').html(data);
   $('#Left').html( $(data).filter('#Item').html() );

   
   $('#Left').animate({ 
      height: 'show'
    }, 'Slow');   
	
	$('a.LinkList').live('click', function(e) {
                var url = $(this).attr('href');
                url = url.replace(/^.*#/, '');
                $.history.load(url);
                return false;
            });
   
							   });
});
*/
									/*
Smooth scroll declaration
--------------------------------*/
	$('a').smoothScroll();
		/*
Body fade in and out function
--------------------------------*/
    $("body").css("display", "none");
    $("body").fadeIn(2000);
	$(".nav_button a, .navbuttonaside a").click(function(event){
		event.preventDefault();
		linkLocation = this.href;
		$("body").fadeOut(1000, redirectPage);
	});
	/*
Redirect na fade out 
-------------------------------------------*/	
	function redirectPage() {
		window.location = linkLocation;
	}
	


	// Hiding the scrollbars (so they are visible if JS is disabled
	$('.page').css({'overflow': 'hidden'});
		//Restore contentWrapper met navigatieknoppen
	$('.nav_button').click(function () {
		// The content hides or show
		$('#contentWrapper').css({'display': 'block'});
		// The toggle buttons class is updated
		$('.toggle_button').removeClass("active");
		// Slidelist en prevslide en nextslide verbergen
		$('#prevslide, #nextslide, #slide-list').addClass("slidecontrolshidden");
		});
	//Calling Functions
	toggleContent();
 //History functie
 function load(num) {
            $('.rightcolumn').load(num +".php");
        }

        $.history.init(function(url) {
                load(url == "" ? "rightcolumn" : url);
            });

        $('.nav_button_nofade a, .navaside a').live('click', function(e) {
                var url = $(this).attr('href');
                url = url.replace(/^.*#/, '');
                $.history.load(url);
                return false;
            });
    })
	

$(function()
			{
				$('.scroll-pane').jScrollPane(
				{showArrows: true,
				autoReinitialise: true}
				
				);
			});
 function toggleContent() {
	// When we click on a toggle button (the '+' and '-')
	$('.toggle_button').click(function () {
		// The content hides or show
		$('#contentWrapper').toggle(3);
		// The buttons class is updated
		$('.toggle_button').toggleClass("active");
		$('#prevslide, #nextslide, #slide-list').toggleClass("slidecontrolshidden"); 
		return false;
	})
} 
