// JavaScript Document
//fade page in/out slowly
$(document).ready(function() {
	$(window).bind("unload", function() {
});

$("body").css("overflow", "hidden") //NB this can cause FF to not display vertical scrollbars when they are required
//fix this with html { overflow-y: scroll; } in CSS

$("body").hide();
 
    function displayPage() {
		$("body").fadeIn(400); //alter number to change speed of fade effect
	}
window.addEventListener("load", displayPage, false);
window.addEventListener("unload", displayPage, false);
 
    $("a.pagefade").click(function(event){
        event.preventDefault();
        linkLocation = this.href;
        $("body").fadeOut(400, redirectPage); //alter number to change speed of fade effect
    });
 
    function redirectPage() {
        window.location = linkLocation;
    }
});
