

// stylesheet switcher
      if($.cookie("css")) {
         $("link").attr("href",$.cookie("css"));
      }
   $(document).ready(function() { 
      $("#drawer li a").click(function() { 
         $("link").attr("href",$(this).attr('rel'));
         $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
         return false;
      });
   });

// panel for switcher
$(document).ready(function(){
	$(".trigger").click(function(){
		$(".panel").slideToggle("fast");
		$(this).toggleClass("active");
		return false;
	});
});



// smooth scroll
// anonymous function that is applied to all internal-links
var jump=function(e)
{
       //prevent the "normal" behaviour which would be a "hard" jump
       e.preventDefault();
       //Get the target
       var target = $(this).attr("href");
       //perform animated scrolling
       $('html,body').animate(
       {
               //get top-position of target-element and set it as scroll target
               scrollTop: $(target).offset().top
       //scrolldelay: 2 seconds
       },800,function()
       {
               //attach the hash (#jumptarget) to the pageurl
               location.hash = target;
       });

}

$(document).ready(function()
{
       $('a[href*=#]').bind("click", jump);
       return false;
});
