// DATE TIME PICKER //
$(document).ready(function()
    {
      $('input.datetimepicker').datepicker(
      {
        duration: '',
        changeMonth: true,
        changeYear: true,
        yearRange: '2011:2050',
        showTime: true,
        time24h: true,
        currentText: 'Dnes',
        closeText: 'OK'
      });
    });
 
 // GOOGLE ANALYTICS //
 
     var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-10126610-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  
  
  // SLIDER //
  
    $(document).ready(function(){   
                e2 = document.getElementById('text_2');
                img2 = document.getElementById('img_2'); 
                e3 = document.getElementById('text_3');
                img3 = document.getElementById('img_3');   
                $(e2).hide();
                $(img2).hide();
                $(e3).hide();
                $(img3).hide();  
        });               
       
        var maxnumber = 3;        
        function ukaz(id_ukaz) {
        var e;
        for(i=1; i <= maxnumber; i++) {
                e = document.getElementById('text_'+i);
                img = document.getElementById('img_'+i);
                if(e) {
                        $(e).hide();
                        $(img).fadeOut('slow');
                }
        }
        
        f=id_ukaz.charAt(7);        
        e = document.getElementById('text_'+f);   
        img = document.getElementById('img_'+f);
          $(e).show();
          $(img).fadeIn('slow');
}   

var moveTimer;
var id;
id=2;
$().ready(function() {

  moveTimer = setInterval(function() {
    if(id==4){
    id=1;
    }  
    ukaz('slider_'+id);
    id=id+1;
    
  }, 5 * 1000);


  $('#slider_list a').mouseenter(function() {
    clearInterval(moveTimer);  
   });
  $('#slider_list a').mouseout(function() { 
   id=1;   
   moveTimer = setInterval(function() {
    if(id==4){
        id=1;
    }    
     ukaz('slider_'+id);
     id=id+1;
    }, 5 * 1000);
   });
   
     });  


