// fade-in nacitanej sekcie
function fade_in_section()
{  
  // vykoname az ked vsetky obrazky ktore sme mali nacitat su nacitane
  if ($('.remove_after_load').length == 0)
  {         
    $('#loader').css('display', 'none'); 
    $('#background').css('display', 'block').animate({opacity: 1.0}, 1000);
  }
}

// fade-out sekcie a load novej
function fade_out_section(id_section_new)
{
  $('#main_wrapper').css('background','none');
  $('#background').css('opacity','1.0').animate({'opacity':'0.0'}, 600, function() {
    
    // naloaduje dalsiu sekciu
    location.href = "?s="+id_section_new;
        
  });    
}

// fade-out sekcie a load noveho URL
function fade_out_url(url_new)
{
  $('#background').css('opacity','1.0').animate({'opacity':'0.0'}, 600, function() {

    location.href = url_new;
        
  });  
}

// animacia textu na baneroch
function banner_over(banner) 
{
  if ($(banner).find('.banner_header a').length > 0)
    $(banner).find('.banner_header a').stop().animate({'color':'rgb(255,120,0)'}, 400);  
  else 
    $(banner).find('.banner_header').stop().animate({'color':'rgb(255,120,0)'}, 400);    
}       
function banner_out(banner) 
{
  if ($(banner).find('.banner_header a').length > 0)
    $(banner).find('.banner_header a').stop().animate({'color':'rgb(255,255,255)'}, 400); 
  else 
    $(banner).find('.banner_header').stop().animate({'color':'rgb(255,255,255)'}, 400);   
}

// animacia textu na sekciach
function section_over(section) 
{   
  if (!$(section).hasClass('active'))
    $(section).stop().animate({'color':'rgb(255,120,0)'}, 400);
}       
function section_out(section) 
{   
  if (!$(section).hasClass('active'))
    $(section).stop().animate({'color':'rgb(255,255,255)'}, 400);
}

// zneviditelny content (clanok a banery)
function hide_content()
{
  $('#content_wrapper').css('display','none');    
}


// animuje text uzite si nasu virtualnu prehliadku
function enjoy_animate()
{
  $('#enjoy')
    .css({'opacity':'0.0', 'display':'inline'})
    .animate({'opacity':'1.0', 'right': '0px'}, 1000, function() {             

      $('a.hover_next').stop().css({'opacity':'0.0','display':'inline'}).animate({'opacity':'1.0'}, 400, function() {           
        $('a.hover_next').stop().animate({'opacity':'0.0'}, 400, function() {           
          $('a.hover_next').stop().css({'opacity':'0.0','display':'inline'}).animate({'opacity':'1.0'}, 400, function() {                
            $('a.hover_next').stop().animate({'opacity':'0.0'}, 400);                                 
          });            
        });        
      });  
      
    });
}

