$(document).ready(function() {
			/*
			*   Examples - images
			*/

			$("a#notitle").fancybox({
				'titleShow'		: false
			});

			$("a#elastic").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
			});

			$("a#clear").fancybox({
				'titleShow'		: false,
				'transitionIn'	: 'none',
				'transitionOut'	: 'none'
			});

			$("a#classic").fancybox();

			$("a#inside").fancybox({
				'titlePosition'	: 'inside'
			});

			$("a#over").fancybox({
				'titlePosition'	: 'over'
			});

			$("a[rel=gallery]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});

			/*
			*   Examples - various
			*/

			$("#inlinecontent").fancybox({
				'titlePosition'		: 'inside',
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});

			$("#ajaxcontent").fancybox();

			$("#iframecontent").fancybox({
				'width'				: '75%',
				'height'			: '75%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});

			$("#swfcontent").fancybox({
				'padding'			: 0,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none'
			});
		});

jQuery(function(){
  // group gallery items
  jQuery('div.gallery a').each(function(){
    jQuery(this).attr('rel', jQuery(this).parent().attr('id'));
  });

  // Add Fancy Classes to single items:
  jQuery('a').each(function(){
    // filter items
    if ( this.href.toLowerCase().substr(-4).indexOf('.jpg') < 0 &&
         this.href.toLowerCase().substr(-5).indexOf('.jpeg') < 0 &&
         this.href.toLowerCase().substr(-4).indexOf('.png') < 0 &&
         this.href.toLowerCase().substr(-4).indexOf('.swf') < 0 &&
         this.href.toLowerCase().substr(-4).indexOf('.mov') < 0 &&
         this.href.toLowerCase().substr(-4).indexOf('.gif') < 0 )
    return;

    // shorter access path
    var $lnk = jQuery(this);

    // Add the fancybox class
    $lnk.addClass('fancybox');

    // Copy the title tag from link to img
    var $img = $lnk.find('img');
    if ( $img.attr('title') == '' ) $img.attr('title', $img.attr('alt'));
    if ( $lnk.attr('title') == '' ) $lnk.attr('title', $img.attr('title'));
  });

  jQuery('a.fancybox')
  .unbind('click')
  .fancybox({ 'zoomSpeedIn':  800,
              'zoomSpeedOut': 800,
              'easingIn':     'easeOutBack',
              'easingOut':    'easeInBack',
              'titlePosition' 	: 'over',
              'zoomOpacity':  true });
});
