
  var aktfold=0;
  var slidespeed=15000;
  var timer=false;

  $(document).ready(function(){
      $('#menu>li').bind('mouseleave',function(){
        $(this).children('ul').hide();
      }).bind('mouseenter',function(){
        $(this).children('ul').show();
      });
	  $('.morecolors').bind('mouseenter',function(){$(this).closest('li').find('.morecolorsdiv').show();});
	  $('.morecolorsdiv').bind('mouseleave',function(){ $(this).hide()});
      $('#shoecolor a:first').attr('class','activecolor');
  	  $('#colorname').text($('#shoecolor a:first').attr('title'));
  	  $('#fullcolorname').text($('#shoecolor a:first').attr('title'));
      $('#shoecolor a').click(function(){
        $('#bigshoe').attr('src',$(this).attr('href'));
        $('#colorname').text($(this).attr('title'));
        $('#fullcolorname').text($(this).attr('title'));
        $('#shoecolor a').attr('class','inactivecolor');
        $(this).attr('class','activecolor');
        return false;
      });
      $('#hpcont>div').hide();
      initfolds();
      showfold(0);
      $("#footer ul").find("li:first").css("background-image","none").css("padding-left","0px");
      $("#techlist li:even").css("backgroundImage","url('images/techbg2.png')");
      $('.techcol:last,.loccol:last').css("background-image","none");
      $(".addresslink").attr("href","javascript:;").click(function(){
        if ($(this).closest('li').find('.address').is(":visible")){
          justhide=true;
        } else {
          justhide=false;
        }
        $('.address').slideUp('slow');
        if (!justhide){
          $(this).closest('li').find('.address').slideDown('slow');
        }
      });
  });
  
  function showtab(index){
    $('#tabears a').attr('class','inactivetab');
    $('#tabears a:eq('+index+')').attr('class','activetab');
    $('#tabs>div').hide();
    $('#tabs>div:eq('+index+')').show();
  }
  
  function initfolds(){
    finstr='';
    pocet=$('#hpcont>div').size();
    for (i=0;i<pocet;i++){
      finstr+="<li><a href=\"javascript:;\" onclick=\"showfold("+i+",true);\">"+(i+1)+"</a></li>";
    }
    $('#hpfolds').html(finstr);
  }
  
  function showfold(index,stopslide){
    if (timer){
      clearTimeout(timer);
    }
    pocet=$('#hpcont>div').size();
    $('#hpcont>div').fadeOut('slow');
    $('#hpcont>div:eq('+index+')').fadeIn('slow');
    $('#hpfolds a').attr('class','inactivefold');
    $('#hpfolds a:eq('+index+')').attr('class','activefold');
    aktfold=index;
	if (!stopslide){
    	timer=setTimeout('showfold('+((index+1)%pocet)+')',slidespeed);
	}
  }
  
  function listfold(dir){
    pocet=$('#hpcont>div').size();
    if (dir=='left'){
      newindex=(aktfold-1+pocet)%pocet;
    } else {
      newindex=(aktfold+1)%pocet;
    }
    showfold(newindex,true);
  }
