1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
(function () {
    var careersLink = "http://careers.stackoverflow.com/Ad/js",
        isGoLarge = location.search == "?golarge",
        hasNinjas = location.hash.indexOf("#ninjas") > -1,
        style = "Pretty";
    (function () {
        var hireMeCSS = "min-height:248px;margin:15px 0",
            hireMeDiv = $("<div>").addClass("hireme").attr("style", hireMeCSS),
            hireMeDivDiv = $("<div>").html(hireMeDiv);
        document.write(hireMeDivDiv.html())
    })();
    $(function () {
        alert(hasNinjas);		// <--- alert(false);
        hasNinjas && $("#adzerk1").html("").append($("<div>").attr("id", "herebeninjas")).attr("id", "stop-adzerk");
        setTimeout(removeHireMeSpaces, 1200);
        setTimeout(getCareersAd, 300)
    });
    var getCareersAd = function () {
        isGoLarge = isGoLarge || hasCareersAdsDoubleHigh();
        hasNinjas = hasNinjas || hasHereBeNinjas();
        style = isGoLarge ? "Large" : style;
        createScriptElem()
    },
        removeHireMeSpaces = function () {
            var hireMeDiv = $("div.hireme");
            hireMeDiv.each(function () {
                $(this).html().replace(" ", "").length == 0 && $(this).remove()
            })
        },
        hasCareersAdsDoubleHigh = function () {
            return $("#careersadsdoublehigh").length > 0
        },
        hasHereBeNinjas = function () {
            return $("#herebeninjas").length > 0
        },
        createScriptElem = function () {
            var scriptElem = $("<script>").attr("src", fullCareersLink()).attr("type", "text/javascript");
            $("body").append(scriptElem)
        },
        fullCareersLink = function () {
            return careersLink + "?style=" + style + "&gobanner=" + hasNinjas.toString()
        }
})();