$(document).ready(function() {

        //$(document).pngFix();
	 
		if (info==true) {
	
	$('a.zoom').fancybox({
		'overlayOpacity':0.7,'overlayColor':'#000',
		'zoomSpeedIn':500,'zoomSpeedOut':500,
		'titlePosition':	'over',
		onStart: function(){$('object,iframe').css('visibility','hidden');},
		onClosed: function(){$('object,iframe').css('visibility','visible');}
	});
	$('a.brozura').fancybox({
		'overlayOpacity':0.7,'overlayColor':'#000',
		'width'		: '95%',
		'height'	: '70%',
		'autoScale'     : false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		'type'		: 'iframe',
		onStart: function(){$('object,iframe').css('visibility','hidden');},
		onClosed: function(){$('object,iframe').css('visibility','visible');}
	});
	$('a.flash').fancybox({
		'overlayOpacity':0.7,'overlayColor':'#000',
		'width'		: 972,
		'height'	: 375,
		'padding'	: 0,
		'autoScale'     : false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none',
		onStart: function(){$('object,iframe').css('visibility','hidden');},
		onClosed: function(){$('object,iframe').css('visibility','visible');}
	});
	$('a.fotovideo').click(function(){
		window.open(this.href, '_blank', 'width=980,height=800,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=no');
		return false;
	});

	/*$('#image_rotate').innerfade({
		speed: 'slow',
		timeout: 4000,
		type: 'sequence',
		containerheight: '220px'
	});*/

        if(ROTUJ == true)
        {
            window.setInterval("rotate()",15000);
        }
  }

});

function rotate()
{
  $("#hlavicka").fadeOut(function() {
      switch($(this).attr("class"))
      {
          case "hlavicka_defender":
              $(this).attr("class","hlavicka_freelander2").fadeIn();
          break;
          case "hlavicka_freelander2":
              $(this).attr("class","hlavicka_discovery4").fadeIn();
          break;
          case "hlavicka_discovery4":
              $(this).attr("class","hlavicka_evoque").fadeIn();
          break;
          case "hlavicka_evoque":
              $(this).attr("class","hlavicka_sport").fadeIn();
          break;
          case "hlavicka_sport":
              $(this).attr("class","hlavicka_rangerover").fadeIn();
          break;
          default:
              $(this).attr("class","hlavicka_defender").fadeIn();
          break;
      }
    
  });

}
