jQuery(document).ready(function($){
  //calling superfish plugin
  $('.main-menu').superfish({
    speed: 'fast',
    autoArrows: true,
    animation: {opacity:'show',height:'show'}
  });

  //calling autofill plugin
  $('#search-input').autofill({
    value: "Search...",
    defaultTextColor:"#999999"
  });

  $('#coin-slider').coinslider({
    width: 940,
    height: 300,
    spw: c.coin.spw, // squares per width
    sph: c.coin.sph, // squares per height
    delay: c.coin.delay, // delay between images in ms
    sDelay: c.coin.sDelay, // delay beetwen squares in ms
    opacity: c.coin.opacity, // opacity of title and navigation
    titleSpeed: c.coin.titleSpeed, // speed of title appereance in ms
    effect: c.coin.effect, // random, swirl, rain, straig  ht
    navigation: c.coin.navigation, // prev next and buttons
    links : c.coin.links, // show images as links
    hoverPause: c.coin.hoverPause // pause on hover
  });  
  
  // calculate and set absolute left position for slider buttons to make it horizontally centered
  var navWidth = $(".cs-buttons").width();
  var galWidth = $("#container").width();
  $(".cs-buttons").css({'left' : ((galWidth - navWidth) / 2) + "px", 'position': 'absolute', 'margin': 0});
  $("#coin-slider").css({'overflow': 'visible'});
  
  $("a[rel^='prettyPhoto']")
    .prettyPhoto({
     theme: c.pp.theme 
  });
  $(".gallery-container .item a img").hover(function () {
    $(this).stop().animate({
      opacity:0.5
    }, "slow");
  },
  function () {
    $(this).stop().animate({
      opacity: 1
    }, "slow");
  });
});

