var CarTypeSlider = new Class({    position: 0,    initialize: function(offset) {        this.carBoxes = $$('#ofctscroller div.offeredcartype a');    this.scroller = $('ofctscroller');    this.arrowRight = $('ofctright');    this.arrowLeft = $('ofctleft');        this.scroller.setStyle('width', (this.carBoxes.length * 270).toString() + 'px');        $('offeredcartypes').addClass('visible');        this.arrowRight.setProperty('href','javascript:void(0);');    this.arrowLeft.setProperty('href','javascript:void(0);');        if (this.position == 0) {      this.arrowLeft.setStyle('visibility','hidden');    }        $A(this.carBoxes).each(function(e) {      e.onclick = function() {                var id = e.id.toString().split('_')[1];                var st = 0;        if ($('new').checked == true) st = 1;        if ($('used').checked == true) st = 2;                var href = e.getProperty('href');        href = href.substr(0,href.length - 1) + '?selected_type=' + st + '&type=' + id;                e.setProperty('href', href);                return true;      }.bind(this);          }.bind(this));        this.scrollerEffect = this.scroller.effect('margin-left',{duration: 500, transition: Fx.Transitions.sineInOut});        this.arrowLeft.onclick = function() {        if (-this.position >= (this.carBoxes.length - 3)) {          this.arrowRight.setStyle('visibility','visible');        }                this.scrollerEffect.clearTimer();        var ml = this.scroller.getStyle('margin-left');        var curMarginLeft = ml == undefined ? 0 : parseInt(ml.substr(0,ml.length-2));        this.position += 1;        if(window.ActiveXObject && !window.XMLHttpRequest){          var to = this.position * 255;        } else {          var to = this.position * 259;        }                this.scrollerEffect.custom(curMarginLeft,to);                if (this.position == 0) {          this.arrowLeft.setStyle('visibility','hidden');        }    }.bind(this);        this.arrowRight.onclick = function() {        if (this.position >= 0) {          this.arrowLeft.setStyle('visibility','visible');        }                this.scrollerEffect.clearTimer();        var ml = this.scroller.getStyle('margin-left');        var curMarginLeft = ml == undefined ? 0 : parseInt(ml.substr(0,ml.length-2));        this.position -= 1;        if(window.ActiveXObject && !window.XMLHttpRequest){          var to = this.position * 255;        } else {          var to = this.position * 259;        }                this.scrollerEffect.custom(curMarginLeft,to);                if (-this.position >= (this.carBoxes.length - 3)) {          this.arrowRight.setStyle('visibility','hidden');        }    }.bind(this);      }  });var CarSlider = new Class({    position: 0,    initialize: function(offset) {        this.carBoxes = $$('#ofcscroller div.offeredcar');    this.scroller = $('ofcscroller');    this.arrowRight = $('ofcright');    this.arrowLeft = $('ofcleft');        if (this.carBoxes.length == 0) return;        this.scroller.setStyle('width', (this.carBoxes.length * 270).toString() + 'px');        $('offeredcars').addClass('visible');        this.arrowRight.setProperty('href','javascript:void(0);');    this.arrowLeft.setProperty('href','javascript:void(0);');        if (this.position == 0) {      this.arrowLeft.setStyle('visibility','hidden');    }    /*    if (-this.position >= (this.carBoxes.length - 3)) {      this.arrowRight.setStyle('visibility','hidden');    }    */    this.scrollerEffect = this.scroller.effect('margin-left',{duration: 500, transition: Fx.Transitions.sineInOut});        this.arrowLeft.onclick = function() {        if (-this.position >= (this.carBoxes.length - 3)) {          this.arrowRight.setStyle('visibility','visible');        }                this.scrollerEffect.clearTimer();        var ml = this.scroller.getStyle('margin-left');        var curMarginLeft = ml == undefined ? 0 : parseInt(ml.substr(0,ml.length-2));        this.position += 1;        if(window.ActiveXObject && !window.XMLHttpRequest){          var to = this.position * 260;        } else {          var to = this.position * 264;        }                this.scrollerEffect.custom(curMarginLeft,to);                if (this.position == 0) {          this.arrowLeft.setStyle('visibility','hidden');        }    }.bind(this);        this.arrowRight.onclick = function() {        if (this.position >= 0) {          this.arrowLeft.setStyle('visibility','visible');        }                this.scrollerEffect.clearTimer();        var ml = this.scroller.getStyle('margin-left');        var curMarginLeft = ml == undefined ? 0 : parseInt(ml.substr(0,ml.length-2));        this.position -= 1;        if(window.ActiveXObject && !window.XMLHttpRequest){          var to = this.position * 260;        } else {          var to = this.position * 264;        }                this.scrollerEffect.custom(curMarginLeft,to);                if (-this.position >= (this.carBoxes.length - 3)) {          this.arrowRight.setStyle('visibility','hidden');        }    }.bind(this);      }  });