$(function()
{
  var api = $("div.overlay").overlay(
  {
    oneInstance: true,
    expose:
    {
      color: '#000000',
      opacity: 0.7
    },
    api: true,
    close: '.close'
  });
  
  $("#slideshow").cycle('fade');
  /*
  $("#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;
  };
  */
  
  $("a.openOverlay").click(function()
  {
    $.get($(this).attr('href'), function(data)
    {
      $("#overlay_content").html(data);
      api.load();
    });

    return false;
  });

  $('a.openPopup').click(function()
  {
    window.open($(this).attr('href'), 'popup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=545,left=355,top=134');

    return false;
  });
  
  // minibox
  
  $('.openMinibox').click(function()
  {
    $(this).parent().find('.minibox').slideToggle('fast');
  });
});
