$(document).ready(function() {
    $(".HELP-banner").each(function(idx) {
        var banner = $(this);
        var total = banner.find("div").size();
        var cur = 0;
        var i = setInterval(function() {
            if (cur >= total) cur = 0;
            banner.find("div").filter(":eq("+cur+")").fadeIn("slow").end().not(":eq("+cur+")").fadeOut("slow");
            cur++;
        }, 5000);
    });

    if ($.browser.msie && ($.browser.version.slice(0, 1) <= 8)) {
        $(".book-fp-entry img").each(function(idx) {
            var elm = $(this);
            var pos = elm.position();
            var shadow = $('<div class="ie-shadow"></div>');
            elm.after(shadow);
            shadow.width(elm.width())
                  .height(elm.height())
                  .css("left", (pos.left+4)+"px")
                  .css("top", (pos.top+4)+"px");
        });
    }

    var content = $("#content-frame");
    var bar = $("#bar-right");
    if (content && bar) {
        var content_height = content.outerHeight(true);
        var bar_height = bar.outerHeight(true);

        if (bar_height < content_height) {
            bar.css("height", (bar.height()+(content_height-bar_height))+"px");
        }
    }
});

