
            var Carousel = {
                elem: null,
                numSets: 0,
                currentPos: 0,
                animTime: .5,
                doAnimation: true,

                scrollLeft: function() {
                    this.scroll("left");
                },

                scrollRight: function() {
                    this.scroll("right");
                },

                scroll: function(dir) {

                    if(this.doAnimation){

                        this.doAnimation = false;

                        if(dir=="left"){
                            this.currentPos--;
                        } else {
                            this.currentPos++;
                        }

                        animTime = this.animTime;

                        if(this.currentPos >= this.sets.length){
                            this.currentPos = 0;
                            animTime = 1.5;
                        } else if(this.currentPos<0){
                            this.currentPos = this.sets.length - 1;
                            animTime = 1.5;
                        }

                        newLeft = this.sets[this.currentPos].offsetLeft * -1;

                        var attributes = {
                            left: { to: newLeft }
                        };

                        var anim = new YAHOO.util.Anim(this.el, attributes, animTime, YAHOO.util.Easing.easeOut);

                        anim.onComplete.subscribe(function() {
                            this.doAnimation = true;
                            this.el.parentNode.style.height = this.el.offsetHeight + "px";
                        }, this, true);

                        anim.animate();
                    }
                },

                init: function(element) {
                    this.el = Dom.get(element);
                    this.el.parentNode.style.height = this.el.offsetHeight + "px";
                    this.sets = Dom.getElementsByClassName('set', null, this.el);
                }
            }
            var Carousel2 = {
                elem: null,
                numSets: 0,
                currentPos: 0,
                animTime: .5,
                doAnimation: true,

                scrollLeft: function() {
                    this.scroll("left");
                },

                scrollRight: function() {
                    this.scroll("right");
                },

                scroll: function(dir) {

                    if(this.doAnimation){

                        this.doAnimation = false;

                        if(dir=="left"){
                            this.currentPos--;
                        } else {
                            this.currentPos++;
                        }

                        animTime = this.animTime;

                        if(this.currentPos >= this.sets.length){
                            this.currentPos = 0;
                            animTime = 1.5;
                        } else if(this.currentPos<0){
                            this.currentPos = this.sets.length - 1;
                            animTime = 1.5;
                        }

                        newLeft = this.sets[this.currentPos].offsetLeft * -1;

                        var attributes = {
                            left: { to: newLeft }
                        };

                        var anim = new YAHOO.util.Anim(this.el, attributes, animTime, YAHOO.util.Easing.easeOut);

                        anim.onComplete.subscribe(function() {
                            this.doAnimation = true;
                            this.el.parentNode.style.height = this.el.offsetHeight + "px";
                        }, this, true);

                        anim.animate();
                    }
                },

                init: function(element) {
                    this.el = Dom.get(element);
                    this.el.parentNode.style.height = this.el.offsetHeight + "px";
                    this.sets = Dom.getElementsByClassName('set', null, this.el);
                }
            }



