ACC SHELL

Path : /srv/www/vhosts/sc-brno/sefar/script/
File Upload :
Current File : /srv/www/vhosts/sc-brno/sefar/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.cover = "bannerCover";
  this.normalniBanner = "topBanner";
  this.rozdil;
 
  this.banner = $$("#"+this.normalniBanner);
  this.obal = $$("#"+this.cover);
  
  this.constructor = function(){
      var tthis = this;
      this.rozdil = this.banner.getWidth() - this.obal.getWidth();
      this.moveLeft(0,70);
 }
 
 this.moveLeft = function(posun,speed){
     var tthis = this;
     if(this.rozdil >= posun){
        this.banner.setStyle('margin-left','-'+posun+'px');
        setTimeout(function(){tthis.moveLeft(posun+1,speed)},speed);
     }
     else{
        setTimeout(function(){tthis.moveRight(posun,speed)},2000);
     }
 }
 
 this.moveRight = function(posun,speed){
     var tthis = this;
     if(posun >= 0){
        this.banner.setStyle('margin-left','-'+posun+'px');
        setTimeout(function(){tthis.moveRight(posun-1,speed)},speed);
     }
     else{
        setTimeout(function(){tthis.moveLeft(posun,speed)},2000);
     }
 }
 
  
    
  
  this.constructor();
}


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

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

ACC SHELL 2018