$(function(){
	$(".img4ltbx,.lt_test").lightBox({
	overlayBgColor: '#222',
	overlayOpacity: 0.8,
	imageLoading: baseUrl+'/public/images/lightbox-ico-loading.gif',
	imageBtnClose:baseUrl+'/public/images/lightbox-btn-close.gif',
	imageBtnPrev: baseUrl+'/public/images/lightbox-btn-prev.gif',
	imageBtnNext: baseUrl+'/public/images/lightbox-btn-next.gif',
	containerResizeSpeed: 400,
	txtImage: 'Image',
	txtOf: 'of'
   });
});

$(function(){
	$(".img-preview a").not('.itStoria,.enStoria').lightBox({
	overlayBgColor: '#222',
	overlayOpacity: 0.8,
	imageLoading: baseUrl+'/public/images/lightbox-ico-loading.gif',
	imageBtnClose:baseUrl+'/public/images/lightbox-btn-close.gif',
	imageBtnPrev: baseUrl+'/public/images/lightbox-btn-prev.gif',
	imageBtnNext: baseUrl+'/public/images/lightbox-btn-next.gif',
	containerResizeSpeed: 400,
	txtImage: 'Image',
	txtOf: 'of'
   });
});

$(document).ready(

	function(){
		
		$(".trigger-fancy").fancybox({
            'transitionIn'	:	'elastic',
            'transitionOut'	:	'elastic',
            'speedIn'		:	600,
            'speedOut'		:	200,
            'width'             : 600,
            'height'             : 300,
          
            
            'autoDimensions': false,
            'cyclic'        : true,
            'scrolling'        : 'no',
            'overlayShow'	:	true,
            'overlayColor'  : 	'#999',
            'overlayOpacity':	'0.6'
        });
		$(".trigger-fancy-video").fancybox({
            'transitionIn'	:	'elastic',
            'transitionOut'	:	'elastic',
            'speedIn'		:	600,
            'speedOut'		:	200,
            'width'             : 600,
            'height'             : 300,
          
            
            'autoDimensions': true,
            'cyclic'        : true,
            'scrolling'        : 'no',
            'overlayShow'	:	true,
            'overlayColor'  : 	'#999',
            'overlayOpacity':	'0.6'
        });
		
		//if($('ul#ticker01').length){
		//	$('ul#ticker01').liScroll();
		//}
		
		$('#marquee-info').css('display','none');
		if($('.bt-work-with-us-wrapper').length){
			$('#overlayer').ready(
				function(){
					
					
					$('#overlayer').addClass('alphalayer');
					
					if($('#overlayer').css('display')=='block')
						$(".flash_baner").css('display','none');
					$("#incident-div").css('display','block');
				}
			)
			
			$('.btClose').click(function(){
				
				$("#incident-div").fadeOut(1100);
				$('#overlayer').fadeOut(1100);
				$('.flash_baner').show();
			});
			
			var top = $('.bt-work-with-us-wrapper').offset().top - $('#content').offset().top - $('#hidden-buttons-wrapper').height();
			top = top - parseInt($('#hidden-buttons-wrapper').css('padding-top'))+30;
			
			$('#hidden-buttons-wrapper').css('top', top);
			
			var allow=true;
			$('.bt-work-with-us-wrapper').click(
				function(){
					$('#hidden-buttons-wrapper').show();
					allow=false;
				}
			);
			
			
			$('body').click(
				function(){
					
					if($('#hidden-buttons-wrapper').css('display') =='block' && allow)
						$('#hidden-buttons-wrapper').hide();
					allow = true;
				}
			)
		}
		
		if($('#pano').length) { initialize(); }
		
		if($('div.img-preview a').length && !mode)
		{
		
			$('div.img-preview a').imgPreview({
			    containerID: 'imgPreviewWithStyles',
			    imgCSS: {
			        // Limit preview size:
			       height:250,
			    },
			    // When container is shown:
			    onShow: function(link){
			        // Animate link:
			        $(link).stop().animate({opacity:0.4});
			        // Reset image:
			        $('img', this).stop().css({opacity:0});
			    },
			    // When image has loaded:
			    onLoad: function(){
			        // Animate image
			        $(this).animate({opacity:1}, 300);
			    },
			    // When container hides: 
			    onHide: function(link){
			        // Animate link:
			        $(link).stop().animate({opacity:1});
			    }
			});	
		}
	}
);

