ACC SHELL

Path : /srv/www/vhosts/sc-brno/marabu-barvy/script/
File Upload :
Current File : /srv/www/vhosts/sc-brno/marabu-barvy/script/main.js

window.addEvent('load', function() {
    if($(document).getScrollSize().y <= $(document).getSize().y) {
        moveFooter();
        var footInterval = moveFooter.periodical(200);
    }
});

function moveFooter() {
    if($('footer')) {
        var footer = $('footer');
        var footH = footer.getSize().y;
        var inAllH = $('page').getSize().y;
        
        if($(document).getSize().y > (footH + inAllH) ) {
            footer.setStyles({
                position: 'absolute',
                bottom: 0,
                width: '100%'
            });
        } else {
            footer.setStyles({
                position: 'relative',
                bottom: ''
            });
        }
    }
} 


var ChangeBanner = function(){
  this.aktivniBanner = "activeBanner";
  this.normalniBanner = "banner";
  this.time = 4000;
  this.banners = new Array();
  
  
  this.constructor = function(){
      var tthis = this;
      this.banners = ($$("."+this.normalniBanner));
      this.nastavPuvodniStavy();
      
      setTimeout(function(){tthis.vymen(0);}, this.time);
  }
  
  this.nastavPuvodniStavy = function(){
    var tthis = this;
    
    this.banners[0].fade(1);
    for(var i = 1; i < this.banners.length;i++){
      this.banners[i].setStyle('display',"none");
      this.banners[i].fade(0);
      setTimeout(function(){tthis.banners.setStyle('display',"block");}, this.time/2);
    }
    
  }
  
  this.vymen = function(who){
    var tthis = this;
 
    if(this.banners[who+1] != undefined){
      var next = who+1;
    }
    else{
      var next = 0;
    }
    
   
    this.banners[who].fade('out');
    this.banners[next].fade('in');
    setTimeout(function(){tthis.vymen(next);}, this.time);

  }


  this.constructor();
}


function startup(){
  var bannerChanger = new ChangeBanner();
}

$(window).addEvent('load',startup);

ACC SHELL 2018