/*
 * JS pro webovou cast
 *
 *
 */
 
$(document).ready(function () {
 	$('#soucet').parent().parent().hide();
    $('#soucet').val('5');
    
    $("a.external").click(function(){
		window.open($(this).attr('href'));
		return false;
	});
	
    
});

function theRotator() {
    //Set the opacity of all images to 0
    $('div#header .header-main').css({opacity: 0.0});
    //Get the first image and display it (gets set to full opacity)
    $('div#header .header-main.show').css({opacity: 1.0});
    //Call the rotator function to run the slideshow, 6000 = change to next image after 6 seconds
    setInterval('rotate()',6000);
}
function rotate() {
    var prvni = $('div#header .header-main.obr1');
    var druhy = $('div#header .header-main.obr2');
    var treti = $('div#header .header-main.obr3');
    
    if( prvni.hasClass('show')){
      prvni.animate({opacity: 0.0}, 1000)
      .addClass('hide')
      .removeClass('show');
      druhy.css({opacity: 0.0})
      .removeClass('hide')
      .addClass('show')
      .animate({opacity: 1.0}, 1000);
    }else 
    if( druhy.hasClass('show')){
      druhy.animate({opacity: 0.0}, 1000)
      .addClass('hide')
      .removeClass('show');      
      treti.css({opacity: 0.0})
      .removeClass('hide')
      .addClass('show')
      .animate({opacity: 1.0}, 1000);
    }else 
    if( treti.hasClass('show')){
      treti.animate({opacity: 0.0}, 1000)
      .addClass('hide')
      .removeClass('show');      
      prvni.css({opacity: 0.0})
      .removeClass('hide')
      .addClass('show')
      .animate({opacity: 1.0}, 1000);
    }
};      
               
$(document).ready(function() {
    $('a.lightbox').lightBox();
    //Load the slideshow
    theRotator();
}); 



$(function() {
	//$('a[@href^="/files"] img').parent().lightBox(); // Select all links in the page
	//$('a[href$="jpg"], a[href$="jpeg"], a[href$="gif"], a[href$="png"], a[href$="JPG"], a[href$="JPEG"], a[href$="GIF"], a[href$="PNG"]').lightBox(); // Select all links in the page
});

 
