jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);  
};


jQuery(document).ready(function() {
    
    /* $('#tellfriend').hide();
    $('.deli, #tellfriend a.close').click(function() {
    	$("#tellfriend").fadeToggle('slow');
 	 });
*/
    
    if($('#frontCarousel li') && $('#frontCarousel li').length > 1) {
      jQuery('#frontCarousel').jcarousel({
          auto: 5,
          scroll: 1,
          wrap: 'circular',
          animation: 500
      });
    }

    if ($('.slideshow_iframe')) $('.slideshow_iframe').cycle({
      fx: 'fade',
      timeout:  5000
    });

    if ($('a.lightbox')) $('a.lightbox').fancybox();
    
    if ($('#mainCol a:has(img)')) {
      $('#mainCol a:has(img)').each(function() {
        this.rel = 'mainContentImg';
      });
      $('#mainCol a:has(img)').addClass('zoom');    
      $('#mainCol a:has(img)').fancybox();
    }

    // open all PDF in new window
    if ($("#mainCol a[href$=pdf]")) $("#mainCol a[href$=pdf]").each(function() {
      $(this).attr('target', '_blank');
    });
}); 

