$(document).ready(function(){
			   
	 //vyprazdni hledane slovo
	 $('#searchword').live('click', function(){
	 	if($(this).val() == 'hledané slovo'){
	       $(this).val('');
	 	}
	 });
	
	//spousti slider homepage
	if($("#slider").lenght != 0){$("#slider").easySlider()};



	//prepinac rozcestniku
    $('#clickSpace a').live('mouseover', function(){
	  var box = '.'+$(this).attr('id');              
       $('.box').removeClass('boxTop');
       $(box).addClass('boxTop');     
	});

    $('#clickSpace a').live('click', function(){
	  var box = '.'+$(this).attr('id');              
       document.location.assign ( $(box).find ( "h2 a" ).attr ( "href" ) );
	});



	
	//hlavni menu (zmena pri hover)
	$('#menu a').hover(function(){
	      $(this).prev().addClass('mhover');
	      $(this).next().addClass('mhover');
	}, 
    function () {
          $(this).prev().removeClass('mhover');
	      $(this).next().removeClass('mhover');

      
	      
  });	
  
  
  $("h1, h2, .blog-date, .map h3, .lf-box h3").each ( function () {
  
	if ( $(this).find("span").length )
		return;

	$(this).wrapInner ('<span></span>').after('<br class="cleaner">');
  
  } );
  
  
  //assimilate empty images
  $( "img[src='']" ).css ( { border: 0 } );
  
  setTimeout ( function () { $('.flash').fadeOut ( "slow" ); }, 3000 );
  
  
  
  

	$("#horizontal-slider-inner, #vertical-slider-inner").each ( function () {
	
		$(this).find ( "a" ).wrap ( "<li></li>" );
		$(this).wrapInner ( "<ul></ul>" );
		
	} );


	$("#horizontal-slider-inner").each ( function () {
	
		$(this).easySlider ( { controlsFade: false } );
	
	} );

	$("#vertical-slider-inner").each ( function () {
	
		$(this).easySlider ( { controlsFade: false, vertical: true, swidth: 120 } );
		
		if ( $(".video").length )
			$(this).find ( "a" ).lightBox ( {
			
				imageLoading:			'/assets/layout/lightbox/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
				imageBtnPrev:			'/assets/layout/lightbox/images/lightbox-btn-prev.gif',			// (string) Path and the name of the prev button image
				imageBtnNext:			'/assets/layout/lightbox/images/lightbox-btn-next.gif',			// (string) Path and the name of the next button image
				imageBtnClose:			'/assets/layout/lightbox/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
				imageBlank:				'/assets/layout/lightbox/images/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
			
			
			});
	
	} );
		


	$(".icons").append ( "<br class='cleaner' />" );
	
	$( ".header-menu li a" ).addClass ( "ui-corner-all" ).wrapInner ( "<span class='ui-corner-all'></div>" );
  





	$(".tagcloud").each ( function () {
	
		var this_ref = this;
	
		var i = 0;

		var clones = new Array ();

		$(this).find("li").each (function(){
	
			if ( i > 20 )
				$(this).addClass ( "tag5" );
			else
				if ( i > 8 )
					$(this).addClass ( "tag4" );
				else
					if ( i > 4 )
						$(this).addClass ( "tag3" );
					else
						if ( i > 2 )
							$(this).addClass ( "tag2" );
						else
							$(this).addClass ( "tag1" );
		
		
			i++;
			
			
			clones.push ( $(this).clone ( true ) );
			$(this).remove ();
	
		} );
		
		
		clones.sort ( function () { return 0.55 - Math.random (); } );
		$.each(clones, function(){ $(this_ref).append($(this)); $(this_ref).append(" ") });
	
	});

  
});
