ns_pixelUrlNpo = "http://nl.sitestat.com/klo/omroep-nl/s?omroep-nl.home&amp;category=omroep-nl-portal&amp;ns_channel=media&amp;ns_webdir=omroep-nl-portal";

function ns_onclick(k, r, q, l, a) {
    var o = "";
    if (typeof ns_pixelUrlNpo == "string") {
        o = ns_pixelUrlNpo.substring(0, ns_pixelUrlNpo.indexOf("?") + 1)
    }
    o += q;
    o += "&ns_type=" + l + "&n s_action=view";
    o += "&ns__t=" + (new Date()).getTime();
    if (!r) {
        r = k.href
    }
    var p = document.referrer;
    if (p.lastIndexOf("/") == p.length - 1) {
        p = p.substring(p.lastIndexOf("/"), 0)
    }
    if (p.length > 0) {
        o += "&amp;ns_referrer=" + escape(p)
    }
    a = a || "";
    var n = (k && k.target && k.target != "") ? (k.target.substring(0, 1) == "_") ? k.target.substring(1) : k.target : "self";
    var m = new Image();
    if (n && r) {
        if (window[n]) {
            window.ns_softclick_timer = function (c, b) {
                return function () {
                    if (window.ns_softclick_timeout) {
                        window.clearTimeout(window.ns_softclick_timeout)
                    }
                    m.onload = m.onerror = function () {
                        return
                    };
                    window[((window[c]) ? c : "self")].location.href = b
                }
            }(n, r);
            ns_softclick_timeout = window.setTimeout("ns_softclick_timer()", 5000);
            m.onload = m.onerror = window.ns_softclick_timer
        } else {
            window.open(r, n, a)
        }
    }
    m.src = o;
    return false
}
if (typeof(window.npo_hide_objects) == "undefined") {
    npo_hide_objects = true
}
if (typeof(window.npo_debug) == "undefined") {
    npo_debug = false
}
function npo_include(c) {
    var a = document.getElementsByTagName("head").item(0);
    var b = document.createElement("script");
    b.setAttribute("language", "javascript");
    b.setAttribute("type", "text/javascript");
    b.setAttribute("src", c);
    a.appendChild(b);
    return false
}
function npo_include_css(b) {
    var a = document.getElementsByTagName("head").item(0);
    var c = document.createElement("link");
    c.setAttribute("rel", "stylesheet");
    c.setAttribute("href", b);
    c.setAttribute("type", "text/css");
    c.setAttribute("media", "screen");
    c.setAttribute("charset", "utf-8");
    a.appendChild(c);
    return false
}
var npo = {
    cn_state: "closed",
    search_placeholder: "Zoek op Omroep.nl",
    search_old_value: "",
    omroep_data: "",
    has_never_been_opened: true,
    networks_are_shown: false,
    overlay: "",
    navigation: "",
    timer: "",
    host_name: "cn.omroep.nl",
    root: "",
    assets_root: "",
    sitestat: new Array(),
    klo: new Array(),
    television: {
        name: "Televisie",
        counter: "softclicks.televisie.televisie",
        follow_up: {
            name: "meer TV",
            url: "http://www.omroep.nl/tv/",
            counter: "softclicks.televisie.meer_tv"
        },
        items: {
            nederland_1: {
                name: "Nederland 1",
                url: "http://www.nederland1.nl/",
                counter: "softclicks.televisie.nederland1"
            },
            nederland_2: {
                name: "Nederland 2",
                url: "http://www.nederland2.nl/",
                counter: "softclicks.televisie.nederland2"
            },
            nederland_3: {
                name: "Nederland 3",
                url: "http://www.nederland3.nl/",
                counter: "softclicks.televisie.nederland3"
            },
            nederland_24: {
                name: "Nederland 24",
                url: "http://www.nederland24.nl/",
                counter: "softclicks.televisie.nederland24"
            },
            zapp: {
                name: "Z@PP",
                url: "http://www.zapp.nl/",
                counter: "softclicks.televisie.zapp"
            },
            zappelin: {
                name: "Z@ppelin",
                url: "http://www.zappelin.nl/",
                counter: "softclicks.televisie.zappelin"
            },
            uitzending_gemist: {
                name: "Uitzending Gemist",
                url: "http://www.uitzendinggemist.nl/",
                counter: "softclicks.televisie.uitzending_gemist"
            }
        }
    },
    radio: {
        name: "Radio",
        counter: "softclicks.radio.radio",
        follow_up: {
            name: "meer radio",
            url: "http://www.omroep.nl/radio/",
            counter: "softclicks.televisie.meer_radio"
        },
        items: {
            radio_1: {
                name: "Radio 1",
                url: "http://www.radio1.nl/",
                counter: "softclicks.radio.radio1"
            },
            radio_2: {
                name: "Radio 2",
                url: "http://www.radio2.nl/",
                counter: "softclicks.radio.radio2"
            },
            radio_3: {
                name: "3FM",
                url: "http://www.3fm.nl/",
                counter: "softclicks.radio.3fm"
            },
            radio_4: {
                name: "Radio 4",
                url: "http://www.radio4.nl/",
                counter: "softclicks.radio.radio4"
            },
            radio_5: {
                name: "Radio 5",
                url: "http://www.radio5.nl/",
                counter: "softclicks.radio.radio5"
            },
            radio_6: {
                name: "Radio 6",
                url: "http://www.radio6.nl/",
                counter: "softclicks.radio.radio6"
            },
            funx: {
                name: "FunX",
                url: "http://www.funx.nl/",
                counter: "softclicks.radio.funx"
            },
            radiocast: {
                name: "Radiocast",
                url: "http://www.radiocast.nl/",
                counter: "softclicks.radio.radiocast"
            }
        }
    },
    network: {
        items: {
            avro: {
                name: "AVRO",
                url: "http://www.avro.nl/",
                counter: "softclicks.radio.avro"
            },
            bnn: {
                name: "BNN",
                url: "http://www.bnn.nl/",
                counter: "softclicks.radio.bnn"
            },
            bos: {
                name: "BOS",
                url: "http://www.buddhistmedia.com/",
                counter: "softclicks.radio.bos"
            },
            eo: {
                name: "EO",
                url: "http://www.eo.nl/",
                counter: "softclicks.radio.eo"
            },
            human: {
                name: "HUMAN",
                url: "http://www.human.nl/",
                counter: "softclicks.radio.human"
            },
            ikon: {
                name: "IKON",
                url: "http://www.ikonrtv.nl/",
                counter: "softclicks.radio.ikon"
            },
            joodse_omroep: {
                name: "Joodse Omroep",
                url: "http://www.joodseomroep.nl/",
                counter: "softclicks.radio.joodse_omroep"
            },
            kro: {
                name: "KRO",
                url: "http://www.kro.nl/",
                counter: "softclicks.radio.kro"
            },
            llink: {
                name: "LLiNK",
                url: "http://www.llink.nl/",
                counter: "softclicks.radio.llink"
            },
            max: {
                name: "MAX",
                url: "http://www.omroepmax.nl/",
                counter: "softclicks.radio.max"
            },
            ncrv: {
                name: "NCRV",
                url: "http://www.ncrv.nl/",
                counter: "softclicks.radio.ncrv"
            },
            nio: {
                name: "NIO",
                url: "http://www.nioweb.nl/",
                counter: "softclicks.radio.nio"
            },
            nmo: {
                name: "NMO",
                url: "http://www.nmo.nl/",
                counter: "softclicks.radio.nmo"
            },
            nos: {
                name: "NOS",
                url: "http://www.nos.nl/",
                counter: "softclicks.radio.nos"
            },
            nps: {
                name: "NPS",
                url: "http://www.omroep.nl/nps/",
                counter: "softclicks.radio.nps"
            },
            ohm: {
                name: "OHM",
                url: "http://www.ohmnet.nl/",
                counter: "softclicks.radio.ohm"
            },
            rkk: {
                name: "RKK",
                url: "http://www.katholieknederland.nl/",
                counter: "softclicks.radio.rkk"
            },
            rvu: {
                name: "RVU",
                url: "http://www.rvu.nl/",
                counter: "softclicks.radio.rvu"
            },
            teleac: {
                name: "Teleac",
                url: "http://www.teleac.nl/",
                counter: "softclicks.radio.teleac"
            },
            tros: {
                name: "TROS",
                url: "http://www.tros.nl/",
                counter: "softclicks.radio.tros"
            },
            vara: {
                name: "VARA",
                url: "http://www.vara.nl/",
                counter: "softclicks.radio.vara"
            },
            vpro: {
                name: "VPRO",
                url: "http://www.vpro.nl/",
                counter: "softclicks.radio.vpro"
            },
            zvk: {
                name: "ZvK",
                url: "http://www.zvk.nl/",
                counter: "softclicks.radio.zvk"
            }
        }
    },
    fixImageForIE: function (a) {
        if (npo.isIE6()) {
            var b = a.src;
            var c = document.createElement("div");
            c.id = a.id;
            c.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + b + "', sizing='scale')";
            c.style.width = a.width + "px";
            c.style.height = a.height + "px";
            a.replaceNode(c)
        }
    },
    isIE6: function () {
        return (jQuery.browser.msie && Number(jQuery.browser.version) >= 6 && Number(jQuery.browser.version) < 7)
    },
    includeIE6CSS: function () {
        if (npo.isIE6()) {
            npo_include_css(npo.assets_root + "/stylesheets/ie6.css")
        }
    },
    initComponents: function () {
        this.overlay.css("opacity", "0");
        this.navigation.css("display", "none");
        jQuery("body").prepend(this.overlay);
        jQuery("body").prepend(this.navigation);
        jQuery("#npo_overlay").click(function () {
            npo.toggleNavigation(this)
        });
        jQuery.ajaxSetup({
            timeout: 15000
        });
        this.writeHeader();
        this.writeContentFrame();
        this.writeTelevisionAndRadioInformation();
        this.writeUgColumn();
        this.writeGidsColumn();
        this.writeOmroepColumn();
        setTimeout("npo.fixImageForIE(document.getElementById('npo_navigation_background'));", 1);
        this.loadRss()
    },
    writeHeader: function () {
        jQuery("div#npo_navigation").prepend(jQuery('<div id="npo_navigation_header"/>').append(jQuery('<div id="npo_navigation_header_sluit_link"/>').append(jQuery('<a href="#"/>').append("Sluit").append(jQuery('<img src="' + npo.assets_root + '/images/sluit.png" alt="Sluit navigatie"/>')))).append(jQuery('<div id="npo_navigation_header_omroepen_link"/>').append(jQuery('<a href="#"/>').append("Toon overzicht omroepen"))));
        jQuery("div#npo_navigation").prepend(jQuery('<img src="' + npo.assets_root + '/images/uitklap.png" alt="Navigatie" id="npo_navigation_background"/>'));
        jQuery("div#npo_navigation_header_omroepen_link a").click(function () {
            npo.toggleNetworks(this);
            return false
        });
        jQuery("div#npo_navigation_header_sluit_link a").click(function () {
            npo.toggleNavigation(this);
            return false
        })
    },
    writeContentFrame: function () {
        jQuery("div#npo_navigation").append(jQuery('<div id="npo_navigation_content"/>'))
    },
    writeTelevisionAndRadioInformation: function () {
        var a = jQuery('<div id="npo_column_televisie" class="npo_column"/>');
        var b = jQuery('<div id="npo_column_radio" class="npo_column"/>');
        npo.prepareColumn(a, this.television);
        npo.prepareColumn(b, this.radio);
        jQuery("div#npo_column_televisie > ul > li:last-child").addClass("npo_column_last_item");
        jQuery("div#npo_column_radio > ul > li:last-child").addClass("npo_column_last_item");
        npo.softclicks()
    },
    writeUgColumn: function () {
        jQuery("div#npo_navigation_content").append(jQuery('<div id="npo_column_ug" class="npo_column"/>').append(jQuery('<a href="http://www.uitzendinggemist.nl/" class="softclicks.uitzendinggemist.uitzendinggemist"/>').append(jQuery("<h1/>").append("Uitzending Gemist"))).append(jQuery('<div class="npo_loader"/>').append(jQuery('<img src="' + this.assets_root + '/images/loading.gif" alt="Data wordt ingeladen"/>'))).append(jQuery('<ul class="npo_want_to_know_more"/>').append(jQuery("<li/>").append(jQuery('<a href="http://www.uitzendinggemist.nl/" class="npo_with_left_arrow softclicks.uitzendinggemist.naar_uitzendinggemist"/>').append("naar Uitzending Gemist")))));
        npo.softclicks()
    },
    writeGidsColumn: function () {
        jQuery("div#npo_navigation_content").append(jQuery('<div id="npo_column_gids" class="npo_column"/>').append(jQuery('<a href="http://gids.omroep.nl/" class="softclicks.gids.gids"/>').append(jQuery("<h1/>").append("Gids"))).append(jQuery('<div class="npo_loader"/>').append(jQuery('<img src="' + this.assets_root + '/images/loading.gif" alt="Data wordt ingeladen"/>'))).append(jQuery('<ul class="npo_want_to_know_more"/>').append(jQuery("<li/>").append(jQuery('<a href="http://gids.omroep.nl/" class="npo_with_left_arrow softclicks.gids.naar_tv-gids"/>').append("naar tv-gids"))).append(jQuery('<li class="npo_with_dotted_top"/>').append(jQuery('<a href="http://gids.omroep.nl/?medium=Radio" class="npo_with_left_arrow softclicks.gids.naar_radiogids"/>').append("naar radio gids")))));
        npo.softclicks()
    },
    writeOmroepColumn: function () {
        jQuery("div#npo_navigation_content").append(jQuery('<div id="npo_column_omroep" class="npo_column"/>').append(jQuery('<a href="http://www.omroep.nl/" class="softclicks.omroepnl.omroepnl"/>').append(jQuery("<h1/>").append("Omroep"))).append(jQuery('<div id="npo_search"/>').append(jQuery('<form method="POST" action="' + this.root + '/searches/"/>').append(jQuery('<input type="text" id="npo_search_field" name="query" value="' + this.search_placeholder + '"/>')).append(jQuery('<input type="submit" id="npo_search_submit" class="softclicks.zoek" value=""/>')))).append(jQuery('<div class="npo_loader"/>').append(jQuery('<img src="' + this.assets_root + '/images/loading.gif" alt="Data wordt ingeladen"/>'))).append(jQuery('<ul class="npo_want_to_know_more"/>').append(jQuery("<li/>").append(jQuery('<a href="http://www.omroep.nl/" class="npo_with_left_arrow softclicks.omroepnl.naar_omroepnl"/>').append("naar Omroep.nl")))));
        var a = jQuery("#npo_search_field");
        a.blur(function () {
            npo.searchFieldBlurred()
        });
        a.keyup(function (b) {
            npo.searchFieldKeyUp(b)
        });
        a.focus(function () {
            npo.searchFieldGotFocus()
        });
        npo.softclicks()
    },
    searchFieldBlurred: function () {
        var a = jQuery("#npo_search_field");
        if (a.val() == "") {
            a.val(this.search_placeholder);
            jQuery("#npo_omroep_data").html(this.omroep_data)
        }
    },
    searchFieldKeyUp: function (b) {
        clearTimeout(this.timer);
        var a = jQuery("#npo_search_field");
        if (a.val().length > 0 && a.val() != this.search_placeholder) {
            this.timer = setTimeout("npo.triggerSearch();", 350)
        } else {
            jQuery("#npo_omroep_data").html(this.omroep_data)
        }
    },
    searchFieldGotFocus: function () {
        var a = jQuery("#npo_search_field");
        if (a.val() == this.search_placeholder) {
            a.val("")
        }
    },
    triggerSearch: function () {
        var a = jQuery("#npo_search_field");
        if (a.val() != this.search_old_value && npo.trim(a.val()).length > 1) {
            this.search_old_value = a.val();
            var b = npo.normalizeQuery(a.val());
            jQuery.ajax({
                type: "GET",
                cache: true,
                dataType: "jsonp",
                error: npo.failedSearch,
                success: npo.showSearchSuggestions,
                url: npo.root + "/searches/" + b
            })
        }
    },
    showSearchSuggestions: function (g, e) {
        var f = jQuery("#npo_omroep_data");
        f.html("");
        f.append("<h2>Zoeksuggesties</h2>");
        if (g.length == 0) {
            f.append("<i>Geen suggesties gevonden.</i>")
        } else {
            for (var k = 0; k < g.length; k++) {
                var j = npo.normalizeQuery(g[k].search.query);
                var c = g[k].search.query;
                var b = jQuery("#npo_search_field").val();
                var d = c.toLowerCase().indexOf(b.toLowerCase());
                if (d > -1) {
                    var i = c.substr(0, d);
                    var h = c.substr(d, b.length);
                    var a = c.substr(d + b.length);
                    c = i + "<b>" + h + "</b>" + a
                }
                f.append('<a href="' + npo.root + "/searches/" + j + '" class="npo_with_left_arrow" onclick="npo.customSubmit(this); return false;">' + c + "</a>")
            }
        }
    },
    customSubmit: function (b) {
        var c = document.createElement("form");
        c.style.display = "none";
        b.parentNode.appendChild(c);
        c.method = "POST";
        c.action = b.href;
        var a = document.createElement("input");
        a.setAttribute("type", "hidden");
        a.setAttribute("name", "_method");
        a.setAttribute("value", "put");
        c.appendChild(a);
        c.submit()
    },
    normalizeQuery: function (a) {
        return encodeURIComponent(npo.trim(a))
    },
    prepareColumn: function (b, d) {
        b.append('<a href="' + d.follow_up.url + '" class="' + d.counter + '"><h1>' + d.name + "</h1></a>");
        var a = jQuery("<ul/>");
        for (var c in d.items) {
            a.append(jQuery("<li/>").append(jQuery("<span/>").append(jQuery('<img src="' + this.assets_root + "/images/logo/" + c + '.png" alt="' + d.items[c].name + '"/>')).append(jQuery('<a class="black ' + d.items[c].counter + '" href="' + d.items[c].url + '"/>').append(d.items[c].name))))
        }
        b.append(a);
        b.append(jQuery('<ul class="npo_want_to_know_more"/>').append(jQuery("<li/>").append(jQuery('<a href="' + d.follow_up.url + '" class="npo_with_left_arrow ' + d.follow_up.counter + '"/>').append(d.follow_up.name))));
        jQuery("div#npo_navigation_content").append(b)
    },
    toggleNetworks: function (a) {
        if (this.networks_are_shown) {
            npo.registerSoftclick(a, "verberg_overzicht_omroepen");
            jQuery("div#npo_navigation_header_omroepen_link a").text("Toon overzicht omroepen");
            jQuery("#npo_column_televisie").fadeIn("normal");
            jQuery("#npo_column_radio").fadeIn("normal");
            jQuery("#npo_column_ug").fadeIn("normal");
            jQuery("#npo_column_gids").fadeIn("normal");
            jQuery("#npo_omroep_column").fadeOut("normal");
            this.networks_are_shown = false
        } else {
            npo.registerSoftclick(a, "toon_overzicht_omroepen");
            if (jQuery("#npo_omroep_column").length == 0) {
                jQuery("#npo_navigation_content").append(jQuery("<div id='npo_omroep_column'/>").css("display", "none"));
                npo.writeNetworks()
            }
            jQuery("div#npo_navigation_header_omroepen_link a").text("Verberg overzicht omroepen");
            jQuery("#npo_column_televisie").fadeOut("normal");
            jQuery("#npo_column_radio").fadeOut("normal");
            jQuery("#npo_column_ug").fadeOut("normal");
            jQuery("#npo_column_gids").fadeOut("normal");
            jQuery("#npo_omroep_column").fadeIn("normal");
            this.networks_are_shown = true
        }
    },
    writeNetworks: function () {
        jQuery("#npo_omroep_column").append(jQuery("<h1/>").append("Omroepen"));
        var a = jQuery("<ul/>");
        var b = 1;
        var c = 0;
        for (var d in this.network.items) {
            a.append(jQuery("<li/>").append(jQuery('<img src="' + this.assets_root + "/images/logo/" + d + '.png" alt="' + this.network.items[d].name + '"/>')).append(jQuery('<a class="black ' + this.network.items[d].counter + '" href="' + this.network.items[d].url + '"/>').append(this.network.items[d].name)));
            if ((b % 7) == 0) {
                jQuery("#npo_omroep_column").append(a);
                c++;
                a = jQuery("<ul/>");
                a.css("left", c * 151 + "px")
            }
            b++
        }
        if (a.length > 0) {
            jQuery("#npo_omroep_column").append(a)
        }
        npo.softclicks()
    },
    updateNavigationLocationAndSize: function () {
        jQuery("div#npo_navigation").css("top", jQuery("div#npo_button_container").offset().top + jQuery("div#npo_button_container").height() + 10 + "px");
        jQuery("div#npo_navigation").css("left", jQuery("div#npo_button_container").offset().left + jQuery("div#npo_button_container").width() - 772 + "px");
        var c = jQuery("html").get(0).clientHeight;
        var d = jQuery("html").get(0).scrollHeight;
        var b = jQuery("body").get(0).scrollHeight;
        var e = jQuery("html").get(0).clientWidth;
        var a = jQuery("html").get(0).scrollWidth;
        $newHeight = Math.max(c, Math.max(d, b));
        jQuery("div#npo_overlay").css("height", $newHeight + "px");
        a > e ? jQuery("div#npo_overlay").css("width", a + "px") : jQuery("div#npo_overlay").css("width", e + "px");
        jQuery("div#npo_overlay").css("top", "0px")
    },
    toggleNavigation: function (a) {
        if (this.cn_state == "closed") {
            npo.registerSoftclick(a, "open");
            if (this.has_never_been_opened) {
                npo.initComponents();
                this.has_never_been_opened = false
            }
            npo.updateNavigationLocationAndSize();
            jQuery("div#npo_overlay").show();
            jQuery("div#npo_overlay").fadeTo("normal", 0.65);
            jQuery(window).bind("resize.npo", function () {
                npo.updateNavigationLocationAndSize()
            });
            npo.toggleProblemObjectsVisibility(false);
            jQuery("div#npo_navigation").fadeIn("normal");
            this.cn_state = "open"
        } else {
            npo.registerSoftclick(a, "sluit");
            jQuery("div#npo_overlay").fadeTo("normal", 0, function () {
                jQuery(window).unbind("resize.npo");
                jQuery("div#npo_overlay").hide()
            });
            jQuery("div#npo_navigation").fadeOut("normal", function () {
                npo.toggleProblemObjectsVisibility(true)
            });
            this.cn_state = "closed"
        }
    },
    toggleProblemObjectsVisibility: function (b) {
        var a = (b === false && npo_hide_objects) ? "hidden" : "visible";
        jQuery("select,object,embed").css("visibility", a);
        jQuery("iframe").css("visibility", a)
    },
    replaceWith: function (c, b, a) {
        jQuery(c).replaceWith(jQuery(b).append(a))
    },
    loadRss: function () {
        jQuery.ajax({
            type: "GET",
            cache: true,
            dataType: "jsonp",
            error: npo.failedUgData,
            success: npo.importUgData,
            url: this.root + "/feeds/uitzending-gemist-tips"
        });
        jQuery.ajax({
            type: "GET",
            cache: true,
            dataType: "jsonp",
            error: npo.failedTipsData,
            success: npo.importTipsData,
            url: this.root + "/feeds/omroepnl-etalage"
        });
        jQuery.ajax({
            type: "GET",
            cache: true,
            dataType: "jsonp",
            error: npo.failedGidsData,
            success: npo.importGidsData,
            url: this.root + "/feeds/tv-tips"
        })
    },
    failedUgData: function (a, c, b) {
        npo.failAjax("ug")
    },
    failedTipsData: function (a, c, b) {
        npo.failAjax("tips")
    },
    failedGidsData: function (a, c, b) {
        npo.failAjax("gids")
    },
    failedSearch: function (a, c, b) {
        npo.failAjax("search")
    },
    failedSurvey: function (a, c, b) {
        npo.failAjax("survey")
    },
    failAjax: function (a) {
        switch (a) {
        case "ug":
            npo.replaceWith("div#npo_column_ug > div.npo_loader", "<div id='npo_ug_data' class='npo_column_data'/>", "<i>Geen tips van Uitzending Gemist beschikbaar.</i>");
            break;
        case "tips":
            npo.replaceWith("div#npo_column_omroep > div.npo_loader", "<div id='npo_omroep_data' class='npo_column_data'/>", "<i>Geen webtips van Omroep.nl beschikbaar.</i>");
            npo.omroep_data = jQuery("#npo_omroep_data").html();
            break;
        case "gids":
            npo.replaceWith("div#npo_column_gids > div.npo_loader", "<div id='npo_gids_data' class='npo_column_data'/>", "<i>Geen gidstips beschikbaar.</i>");
            break;
        case "search":
            npo.showSearchSuggestions("", "");
            break
        }
    },
    importUgData: function (e, g) {
        if (e != "") {
            var f = e[0].feed_item.title;
            var d = e[0].feed_item.description;
            var c = e[0].feed_item.link;
            var a = e[0].feed_item.enclosure_location;
            var b = "";
            if (a != "") {
                b = "<img src='" + a + "' alt='' class='npo_tip'/>"
            } else {
                b = ""
            }
            npo.replaceWith("div#npo_column_ug > div.npo_loader", "<div id='npo_ug_data' class='npo_column_data'/>", "<strong>TIP</strong><h2><a class='black softclicks.uitzendinggemist.tip." + f.replace(/[^\w]/g, "") + "' href='" + c + "'>" + f + "</a></h2>" + b + npo.truncate(d, 165))
        } else {
            npo.failAjax("ug")
        }
        npo.softclicks()
    },
    importGidsData: function (c, e) {
        if (c != "") {
            var d = c[0].feed_item.title;
            var b = c[0].feed_item.description;
            var a = c[0].feed_item.link;
            npo.replaceWith("div#npo_column_gids > div.npo_loader", "<div id='npo_gids_data' class='npo_column_data'/>", "<strong>TIP</strong><h2><a class='black softclicks.gids.tip." + d.replace(/[^\w]/g, "") + "' href='" + a + "'>" + d + "</a></h2>" + npo.truncate(b, 165))
        } else {
            npo.failAjax("gids")
        }
        npo.softclicks()
    },
    importTipsData: function (b, c) {
        if (b != "") {
            var a = b[0];
            newHTML = "<h2><a class='npo_with_left_arrow black softclicks.omroepnl.tip." + a.feed_item.title.replace(/[^\w]/g, "") + "' href='" + a.feed_item.link + "'>" + a.feed_item.title + "</a></h2>";
            newHTML += a.feed_item.description;
            npo.replaceWith("div#npo_column_omroep > div.npo_loader", "<div id='npo_omroep_data' class='npo_column_data'/>", newHTML);
            npo.omroep_data = jQuery("#npo_omroep_data").html()
        } else {
            npo.failAjax("tips")
        }
        npo.softclicks()
    },
    getSitestat: function () {
        if (typeof(window.ns_1) !== "undefined") {
            var b = /nl\.sitestat\.com\/klo\/.*/.exec(ns_1.src).toString().replace(/&amp;/g, "&");
            var d = b.split("&");
            npo.sitestat.omroep = /nl\.sitestat\.com\/klo\/([\w\.\-]+)/.exec(d[0])[1];
            npo.sitestat.categorie = "";
            npo.sitestat.thema = "";
            for (var c = 1; c < d.length; c++) {
                var a = d[c].split("=");
                switch (a[0]) {
                case "category":
                    npo.sitestat.categorie = a[1];
                    break;
                case "thema":
                    npo.sitestat.thema = a[1];
                    break
                }
            }
            jQuery.ajax({
                type: "GET",
                cache: true,
                dataType: "jsonp",
                error: npo.failedSurvey,
                success: npo.triggerSurvey,
                url: this.root + "/surveys/" + encodeURIComponent(npo.sitestat.omroep) + "?category=" + encodeURIComponent(npo.sitestat.categorie)
            })
        }
    },
    softclicks: function () {
        jQuery("#npo_button_container a")[0].removeAttribute("href");
        jQuery("a, input").unbind("click", npo.softclicksHandler);
        jQuery("a, input").bind("click", npo.softclicksHandler)
    },
    softclicksHandler: function (a) {
        var b = /softclicks\.(.*)$/;
        if (this.className.match(b)) {
            npo.registerSoftclick(this, RegExp.$1)
        }
    },
    registerSoftclick: function (b, a) {
        a = "centraalnav.ontdeknl." + a;
        ns_onclick(b, "", a, "clickout")
    },
    stripClickHandler: function () {
        jQuery("div#npo_button_container a").get(0).onclick = "";
        setTimeout("npo.stripClickHandler();", 250)
    },
    triggerSurvey: function (a, b) {
        if (a != "") {
            npo.klo.is_polite = a.survey.is_polite;
            npo.klo.appearance = a.survey.appearance;
            npo.klo.quadrant = a.survey.quadrant;
            npo.klo.chance = a.survey.chance;
            npo.klo.name = a.survey.name;
            npo.klo.identifier = a.survey.identifier;
            npo_include(npo.assets_root + "/javascripts/legacy-klo.js")
        }
    },
    trim: function (a) {
        return a.replace(/^\s+|\s+$/g, "")
    },
    truncate: function (a, b) {
        if (a.length > b) {
            for (var c = b - 1; a.charAt(c) != " "; c--) {
                b--
            }
            return a.substr(0, b) + "[&hellip;]"
        } else {
            return a
        }
    }
};
npo.root = "http://" + npo.host_name;
npo.assets_root = "http://assets." + npo.host_name;
var jQueryWasPresent = true;
if (typeof(jQuery) != "function") {
    npo_include("http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js");
    jQueryWasPresent = false
}
npo_include_css(npo.assets_root + "/stylesheets/default.css");
npo_init();

function npo_init() {
    if (typeof(jQuery) == "undefined") {
        setTimeout("npo_init();", 100);
        return
    }
    if (!jQueryWasPresent) {
        jQuery.noConflict()
    }
    npo.overlay = jQuery("<div id='npo_overlay'/>");
    npo.navigation = jQuery("<div id='npo_navigation'/>");
    npo_init_button()
}
function npo_init_button() {
    if (jQuery("#npo_button_container").length == 0) {
        setTimeout("npo_init_button();", 50);
        return
    }
    var a = jQuery("div#npo_button_container a");
    jQuery("div#npo_button_container a").bind("click.npo", function () {
        npo.toggleNavigation(this);
        return false
    });
    npo.includeIE6CSS();
    npo.stripClickHandler();
    npo.getSitestat();
    npo.softclicks()
};