jobportal = function () {
    return {
        initLogos: function (b, a, c) {
            //alert("INIT");
            this.sliderType = c;
            this.logoCount = b;
            this.logoContainer = a;
            this.currentIndex = 0;
            jobportal.loadLogos(function (d) {
                $(d).appendTo(a);
                window.setTimeout("jobportal.swapLogos();", 1E3)
            })
        },
        loadLogos: function (b) {
            //alert("LOAD");
            var a = $('<div class="logo-stack"></div>');
            $(a).load("/logos.html?&type=" + this.sliderType, function () {
                b(a)
            })
        },
        swapLogos: function () {
            //alert("SWAP");
            var b = $(this.logoContainer).find(".container:hidden:first");
            b.html("");
            var a = $(this.logoContainer).find(".logo-stack .logo").length,
                c = [],
                d = 0;
            for ($(this.logoContainer).find(".logo-stack .fix").each(function () {
                c[c.length] = $(this).attr("id");
                $(this).clone().appendTo(b)
            }); c.length < this.logoCount && d < 100; ) {
                d++;
                var e = Math.floor(Math.random() * a);
                e = $(this.logoContainer).find(".logo-stack .logo:eq(" + e + ")");
                if ($.inArray(e.attr("id"), c) == -1) c[c.length] = e.attr("id")
            }
            for (d in c) {
                e = $("#" + c[d]);
                if ($(e).find("img").length == 0) {
                    (new Image).src = $(e).find("span").text();
                    a = $("<img />").attr("src", $(e).find("span").text()).attr("alt", $(e).find("a").attr("title"));
                    $(e).find("span").replaceWith(a)
                }
                $(e).clone().appendTo(b)
            }
            $(b).fadeIn(function () {
                $(this).siblings(".container").hide().css("z-index", 20);
                $(this).css("z-index", 10);
                window.setTimeout("jobportal.swapLogos();", 4E3)
            })
        }
    }
} ();
