$(document).ready(function() {	
 mosaicNav();
 
 $(".linkYouTube").click(function() {
	$.fancybox({
			'padding'		: 10,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			//'title'			: this.title,
			'width'			: 480,
			'height'		: 385,
			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
			'type'			: 'swf',
			'swf'			: {
			'wmode'			: 'transparent',
			'allowfullscreen'	: 'true'
			}
		});
	
		return false;
	});
	
	$("a[rel=gallery]").fancybox({
		'padding'		    : 0,
		'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>';
		}
	});	
	
	$("a.fb").fancybox({
		'titleShow'		: false
	});	
	
	$("#picsGallery li a").prepend("<span></span>");
	$("#picsGallery li span:hover").css("background-position", "left bottom");
	$("#picsGalleryEn li a").prepend("<span></span>");
	$("#picsGalleryEn li span:hover").css("background-position", "left bottom");	
	
	
		$(".popupIframe").fancybox({
		'width'				: 712,
		'height'			: 921,
        'autoScale'     	: false,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'		    : false
	});	

 
});

function mosaicNav(){$('#mosaic-nav li').removeClass('hover');
$('#mosaic-nav li a').css({opacity:0.0})
.mouseover(function(){$(this).stop().animate({opacity:1.0},900);})
.mouseout(function(){$(this).stop().animate({opacity:0.0},1000);})
;}
