
hs.graphicsDir = "http://www.sadrokarton-design.cz/images/highslide/graphics/";
hs.outlineType = 'rounded-white';
hs.showCredits = false;

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17665538-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);
  })();

var lastSlideImage = 0;
function startSlideShow(id)
{
  var g = document.getElementById(id);
  var imgs = new Array();
  if(g != null) {
    imgs = g.getElementsByTagName('img');

    if(imgs.length > 1) {            

      if(lastSlideImage==imgs.length-1)
        newImage = 0;
      else
        newImage = lastSlideImage+1;

      $(imgs[lastSlideImage]).fadeOut(1500);
      $(imgs[newImage]).fadeIn(1500);

      lastSlideImage=newImage;
    }
    setTimeout("startSlideShow('"+id+"')",6000);
  }
  return true;
}

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};



$(document).ready(function($){
  setTimeout("startSlideShow('intro')",6000);
  
  if(document.getElementById('mycarousel')!=null) {
  
    jQuery('#mycarousel').jcarousel({
          //auto: 5,
          start: carousel_offset,
          wrap: 'both',
          scroll: 1,
          animation: 400,
          initCallback: mycarousel_initCallback
    });
  }
  

    
   /*jQuery('.jcarousel-container li a').click(function (){
     var href = $(this).attr('href');
     $('#photos').slideUp();
     $.ajax({
        type: "GET",
        url: 'http://www.sadrokarton-design.cz/ajax_galery.php',
        data: "url=" + href,
        success: function(images) {
          //window.location.href = href;
          //parent.location.hash = href;
          $('#photos').html(images);
          $('#photos').slideDown();
        }
     });
   });*/ 
})

 
