sfHover = function () {
    var sfEls = document.getElementById("nav").getElementsByTagName("li");
    for (var i = 0; i < sfEls.length; i++) {
        sfEls[i].onmouseover = function () {
            this.className += " hover";
        }
        sfEls[i].onmouseout = function () {
            this.className = this.className.replace(new RegExp(" hover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
var bannerDeck = {
    autoRotate: 1,
    deck: '',
    navCount: 0,
    nextSlide: 0,
    bannerAnimate: function (myLI) {
        var liwidth = $(myLI).width() + 32 + 'px';
        var lileft = parseInt($(myLI).position().left + 10) + 'px';
        $('#banner-nav .highlight_container').animate({
            left: lileft,
            width: liwidth
        }, 350, function () {
            bannerDeck.autoRotate = 1;
        });
    },
    init: function () {
        if ($('#banner-nav li').length) {
            $('#banner-nav li').click(function () {
                bannerDeck.autoRotate = 0;
                var navIndex = $('#banner-nav li').index($(this)) + 1;
                bannerDeck.deck.goTo(navIndex);
                bannerDeck.bannerAnimate(this);
            });
        }
    }
}
var bookScroller = {
    deck: '',
    init: function () {
        if ($('#scrollerPrev').length) {
            $('#scrollerPrev').click(function () {
                bookScroller.deck.prev();
            });
        }
        if ($('#scrollerNext').length) {
            $('#scrollerNext').click(function () {
                bookScroller.deck.next();
            });
        }
    }
}
