﻿// Logo Scroll
var objScroll = {
    scroll: function (p_scroll) {
        if (p_scroll == 0) {
            this.scroller.scrollLeft(0);
        }
        var width = (objScroll.scroller.find('nobr').width()  ),
			speed = (width - this.scroller.scrollLeft()) * 50;

        this.scroller.animate(
			{ scrollLeft: width }, {
			    duration: speed,
			    easing: 'linear',
			    queue: false,
			    complete: function () {
			       objScroll.scroll(0)
			    }
			}
		);
    },
    activate: function () {
        if (this.scroller.length) {
            this.scroller.bind('mouseenter', function () {
                objScroll.scroller.stop();
            }).bind('mouseleave', function () {
                objScroll.scroll();
            });
            this.scroll(0);
        }
    }
};

var objScroll2 = {
    scroll: function (p_scroll) {
        if (p_scroll == 0) {
            this.scroller.scrollLeft(0);
        }
        var width = (objScroll2.scroller.find('nobr').width() / 2),
			speed = (width - this.scroller.scrollLeft()) * 50;

        this.scroller.animate(
			{ scrollLeft: width }, {
			    duration: speed,
			    easing: 'linear',
			    queue: false,
			    complete: function () {
			        objScroll2.scroll(0)
			    }
			}
		);
    },
    activate: function () {
        if (this.scroller.length) {
            this.scroller.bind('mouseenter', function () {
                objScroll2.scroller.stop();
            }).bind('mouseleave', function () {
                objScroll2.scroll();
            });
            this.scroll(0);
        }
    }
};

