$(function()
{
  $("#nav .link").mouseover(function()
  {
    $(this).addClass("link-hover");
  }).mouseout(function(){
    $(this).removeClass("link-hover");
  });

  $("#nav li").hover(function()
  {
    $('ul:first',this).css('display', 'block');
  }, function()
  {
    $('ul:first',this).css('display', 'none');
  });

  $("#slideshow").scrollable
  ({
    interval: 5000,
    loop: true,
    speed: 1000,
    size: 1,
    easing: 'custom'
  });

  $.easing.custom = function (x, t, b, c, d)
  {
    if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
  };

  $('.news .more a').click(function()
  {
    var news = $(this).parent().parent().parent();

    news.find('.text').slideToggle('fast');

    return false;
  });
  
  $("a.picture_zoom").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300, 'overlayShow': true });
  
});
