function InitChooser(paramWidth) {
    $j(".chooser").show();
    $j(".chooser").addClass("dynamic");
    $j(".chooser ul li:last").addClass("last");

    var anchors = $j(".chooser > ul > li > a");

    anchors.mouseout(function() {
        if ($j(".no-selection-html").length > 0) {
            if ($j(this).hasClass("hover")) {
                StopHovering();
            }
            $j(".no-selection-html").show();
        }
    });

    anchors.mouseover(function() {
        var a = $j(this);
        var li = a.parent("li");

        $j(".no-selection-html").hide();

        if (!a.hasClass("hover")) {

            StopHovering();

            a.addClass("hover");
            a.parent().addClass("hover");


            var items = $j(".chooser ul li");
            var length = items.length;
            var idx = items.index(li) + 1;
            var info = a.next(".info");
            info.css('width', $j(".chooser ul").css("margin-left"));

            var info_height = info.height();
            var li_top = li.position().top;
            var li_height = li.height();
            var ul_top = $j(".chooser ul").position().top;
            var ul_height = $j(".chooser ul").height();

            var info_top = ul_top + ((ul_height - info_height) * (idx / length));


            // Is this the first or last element? If so, position it at top or bottom
            // Also.. make sure we stay within the bounds of the UL
            if ((a.parent().prevAll().length == 0) || (info_top < ul_top)) {
                info_top = a.parent().offset().top - $j(".chooser").offset().top;
            }
            else if ((a.parent().nextAll().length == 0) || (info_top + info_height > ul_top + ul_height)) {
                if ($j("body.ie6,body.ie7").length > 0) {
                    info_top = a.parent().offset().top - $j(".chooser").offset().top;
                    info_top += a[0].scrollHeight;
                    info_top -= info[0].clientHeight;
                }
                else {
                    info_top = a.parent().offset().top - $j(".chooser").offset().top;
                    info_top += a.parent().height()
                    info_top -= info.height();
                    var fluff = parseInt(info.css("padding-top"));
                    if (!isNaN(fluff)) info_top -= fluff;
                    fluff = parseInt(info.css("border-top"));
                    if (!isNaN(fluff)) info_top -= fluff;
                }
            }


            a.next(".info").css('top', info_top + 'px');

            if ($j(".chooser").hasClass("info-right")) {
                info.css('left', $j(".chooser ul").outerWidth() + 1);
            }

            info.remove().appendTo(".chooser").show();
        }
    });

    //Find the max info div height
    var _maxInfoHeight = 0;
    $j(".chooser .info").each(function(i) {
        if (_maxInfoHeight < $j(this).height())
            _maxInfoHeight = $j(this).height();
    });
    var headerHeight = $j(".chooser ul").offset().top - $j(".chooser").offset().top + parseInt($j(".chooser ul").css("padding-top")) + 10;
    var ul_height = $j(".chooser ul").height();
    $j(".chooser").height(headerHeight + Math.max(_maxInfoHeight, ul_height));

    // Figure out where to put the no-selection-html div
    var ul_left;
    var ul_top = $j(".chooser ul").position().top;
    var info_width = $j(".chooser").width() - $j(".chooser ul").outerWidth();
    if ($j(".chooser").hasClass("info-right")) {
        ul_left = $j(".chooser ul").width();
    }
    else if ($j(".chooser").hasClass("info-left")) {
        ul_left = $j(".chooser ul").position().left;
    }

    if ($j(".no-selection-html").length > 0) {
        $j(".no-selection-html").css("position", "absolute");
        $j(".no-selection-html").css("left", ul_left + "px");
        $j(".no-selection-html").css("top", ul_top + "px");
        $j(".no-selection-html").css("height", ul_height + "px");
        $j(".no-selection-html").css("width", info_width + "px");
    }

    $j(anchors.get(Math.floor(Math.random() * anchors.length))).mouseover();
}

function StopHovering() {
    $j(".chooser .info:visible").remove().insertAfter(".chooser > ul > li > a.hover").hide();
    $j(".chooser a.hover").removeClass("hover");
    $j(".chooser li.hover").removeClass("hover");
}