jQuery.ajaxSetup({
  'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/javascript")}
})

$(document).ready(function(){
  // Initialise Facebox Modal window:
  $('a[rel*=facebox]').facebox({
      loadingImage : '/images/facebox/loading.gif',
      closeImage   : '/images/facebox/closelabel.gif'
  });

  // Set background behind the Facebox to 40% opacity
  $.facebox.settings.opacity = 0.4;

  //Submit contact inquiries via ajax
  $("#contact_inquiry").submit(function() {
    $.post($(this).attr("action"), $(this).serialize(), null, "script");
    return false;
  });

  //Clear the sidebar search box when clicking inside
  searchDefault = $('#s').val();  
  $('#s').click(function() {
    if( this.value == searchDefault ) {
      $(this).val("");
    }
  });

  // Activate PrettyPhoto Lightbox handle
  $("a[rel^='prettyPhoto']").prettyPhoto({
    animationSpeed: 'normal', /* fast/slow/normal */
    padding: 40, /* padding for each side of the picture */
    opacity: 0.35, /* Value betwee 0 and 1 */
  });

  $("#slider").easySlider({
    auto: true,
    pause: 12000,
    continuous: true,
    numeric: true,
    speed: 1000
  });

  //$('#gallery').karmicFlow({ timer: 3500, duration: 1500 });

  // PNG Fix
  $(document).pngFix();

});
