
  /**
   * Cufón
  */
    $(document).ready(function() {

      Cufon.replace('h2, .price span, h3, p', {fontFamily: 'Baskerville Bold'});
      Cufon.replace('h1, #nav a, #menu a, p, .price span span', {hover:true, fontFamily: 'Baskerville Regular'});
      Cufon.replace('em, .exhibits h3, .gallery .photo h2', {fontFamily: 'Baskerville Italic'});
      
      Cufon.replace('p strong', {fontFamily: 'Baskerville Bold'});
      
      
    });
    
    
    
    $(document).ready(function() {

        //$('img').fadeIn(1000); fix to element dat primo > onload="$(this).fadeIn();"
       
       
      $("#menu .subsub").hide();

        $('#menu .open-sub, #menu .subsub').hover(
            function()  {
              $('#menu .subsub').show();
            },
            function() {
              $('#menu .subsub').hide();
            }
         );
         


            /* $('#menu > ul > li > a:not(.open-sub)').hover(
            function()  {
              $('#menu .subsub').hide();
            }
          );*/
            







    });
    


 $(document).ready(function () {


      $('img').hide();

      /*$('img').load(function () {
          $(this).fadeIn(1000);
      },function(){
          $(this).fadeIn(1000);
      });*/

      $('img').fadeIn(1000);


    });  /**/






    
    $(document).ready(function(){
      
      $(".opener div").hide();


      $(".opener a").hover(function(e){
        $(this).parent().parent().find("div").show();
        //$(".mess").hide(); //schovat fotky ostatni
        
      }, function(){
          $(this).parent().parent().find("div").hide();
          //$(".mess").show();
     });


    });
    
    
    
    
    
  /**
   * Gallery - skryvani menu
  */
    $(document).ready(function(){

      if ($("body.gallery").length > 0) {

        $('#nav').hide();

        $('#header').hover(
            function()  {
                $("#nav").show();
            },
            function() {
              $("#nav").hide();
            }
         );

      }


    });
    
    

  /**
   * Kontakt fotky
  */
    $(document).ready(function(){

    /* prekryvani fotek
    
      $('.contact img').hover(
          function()  {
              $(this).css('z-index', 1000);
          },
          function() {
              var z = $(this).attr('alt');
              $(this).css('z-index', z);
          }
       );*/


      $('.contact img').hover(
          function()  {
              $('.contact img').css('visibility', 'hidden');
              $(this).css('visibility', 'visible');
          },
          function() {

            $('.contact img').css('visibility', 'visible');

          }
       );


    });
    

    
   

  /**
   * Ribbon - svatby
  */
  $(document).ready(function() {

      $("div#makeMeScrollable").smoothDivScroll({ });

      $('.scrollableArea').draggable({
            zIndex: 	1000,
            cursor: 'move',
            axis: "x",
            //scroll:false
            //containment: "body",
          }
        ); /**/


      $('.scrollableArea img').click(function(){
          //history.go(-1);
      });


     });



  /**
   * Vystavy - docasne reseni, udelat na pevne linky v php
  */
    $(document).ready(function() {

      // youtube
      $('.exhibits a.js').click(function(){

        var buffer = "";
        var href = $(this).attr('href');
        var type= $(this).attr('rel');

        if(type == 'yt'){
          buffer = '<iframe title="YouTube video player" width="800" height="531" src="'+href+'?hd=1" frameborder="0" allowfullscreen></iframe>';
        }
        else{
          buffer = "<img src='"+href+"' style='margin-bottom:1em;'>";
        }
        
        $('.exhibits-load').html(buffer+'<a title="Zavřít stránku" class="close" href="#"><span>Zavřít</span></a><br class="clear" />');
        $('.exhibits').hide();

        return false;

      });

      
      // zavirani
      $('html').click(function() {
      
        $('.exhibits-load').html("");
        $('.exhibits').show();
        
      });


    });
    

    
  /**
   * Promo - vystava na uvodni strance
  */
    $(document).ready(function() {

      $('#promo').hide();
      
      //$('#page').hide();
      // pokud je uvodni stranka, tak zapnout jeden plakat na celou plochu a ostatni zbelat

      });
      


  /**
   * Vystavy - sort
  */
     $(document).ready(function(){

        function manage(){

          var val = $("#action").val();
          
          if(val == '0'){
            $(".exhibits div").show(); // default
          }
          else{
            $(".exhibits ."+val).show();
            $("#action option[value='"+val+"']").attr('selected', 'selected');
            
            $(".exhibits div:not(."+val+")").hide();
          }

          //$("#action option[value='0']").attr('selected', 'selected'); //default nastavit vzdy

        }

        $("#action").change(manage);

    });
      

  /**
   * Cycle

  $(document).ready(function() {

      $('.cycle').cycle({
    		fx: "fade", //"none",
    		timeout: 10000,
    		next:   '.cycle',
    		timeout: 0,
    		random: 0

    	});

    });

   */


  /*
  $(document).ready(function() {

    /*$('#page .ribbon').draggable({
        zIndex: 	1000,
        cursor: 'move',
        axis: "x",
        //scroll:false
        //containment: "body",
      }
    );


   });*/


  /**
   * Ribbon+

   $(document).ready(function() {

    //var width = 230;
    var width = 40;
    var height = 10;

    // kumulovana delka obrazku
    $('.ribbon img').each(function(index) {
       width += $(this).width()+20; //20px margin of img
    });

    // velikost prvni obrazku, pro pozici titulku pod nim
    //height += $('.ribbon img:first').height()

    //$('.ribbon .text').css({'position' : 'absolute', 'top' : height+'px', 'left' : '0px'});
    $('.ribbon').css("width", width+"px");


    //$('.portraits div p').hide();

   });  */



