$(document).ready(function()
{
  $(".iframe").livequery(function(){
        
        $(".iframe").fancybox({
                'titlePosition'		: 'outside',			
        		'width'				: 950,
        		'height'			: 500,
                'autoScale'     	: true,
                'transitionIn'		: 'slow',
        		'transitionOut'		: 'slow',
        		'type'				: 'iframe'
                });
  })

  $(".iframe_tour").fancybox({
        'titlePosition'		: 'outside',			
        'width'        	    : 620,
        'height'        	: 400,
        'autoScale'     	: true,
        'transitionIn'		: 'slow',
		'transitionOut'		: 'slow',
		'type'				: 'iframe'
        });

  $(".iframe_video").click(function() {
          $.fancybox({
            'padding' : 0,
            'autoScale' : false,
            'transitionIn' : 'none',
            'transitionOut' : 'none',
            'title' : this.title,
            'width' : 640,
            'height' : 385,
            'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
            'type' : 'swf',
            'swf' : {
            'wmode' : 'transparent',
            'allowfullscreen' : 'true'
            }
            });             
          return false;
          });

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

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

  $("a[rel=single]").fancybox({
    	'transitionIn'		: 'elastic',
    	'transitionOut'		: 'elastic',
	    'titleShow'         : false
  });

});

