
var pages = [{"title":"Default","type":"default","details":"{\"type\":\"\\\/\"}","_o_a_s_page":"elcomercio.com\/","_o_a_s_positions":"Top,Top1,Top2,x01,x02,x03,x11,x 26,Middle2,Middle3,Bottom","locked":true},{"title":"Home","type":"home","details":"{\"type\":\"\\\/\"}","_o_a_s_page":"elcomercio.com\/portada","_o_a_s_positions":"Top,Top1,Middle2,x01,x02,Top2,Middle,Middle1,x04,x11,x03,Bottom,x13,x09,Middle3,Right2,x26,x101,x102","locked":true},{"title":"Actualidad","type":"section","details":"{\"type\":\"actualidad\"}","_o_a_s_page":"elcomercio.com\/actualidad_EC","_o_a_s_positions":"Top,Top1,x01,Middle,Middle1,Middle2,Middle3,x11,Top2,x13,Bottom,Bottom1,Bottom2,Right2,Right1","locked":false},{"title":"Turismo","type":"section","details":"{\"type\":\"tendencias\/turismo\"}","_o_a_s_page":"elcomercio.com\/turismo_EC","_o_a_s_positions":"Top,Top1,Middle2,x11,Bottom1,Bottom2","locked":false},{"title":"Opini\u00f3n","type":"section","details":"{\"type\":\"opinion\"}","_o_a_s_page":"elcomercio.com\/opinion_EC","_o_a_s_positions":"Top,Top1,Middle2,x01,x02,Top2,Middle,Middle1,x11,x03,x13,Bottom1,Bottom2","locked":false},{"title":"Multimedia","type":"section","details":"{\"type\":\"multimedia\"}","_o_a_s_page":"elcomercio.com\/multimedia_EC","_o_a_s_positions":"Top,Top1,x04,Middle,Middle1,Middle2,Middle3,x01,x02,x11,Bottom1,Bottom2,Right2","locked":false},{"title":"Tendencias","type":"section","details":"{\"type\":\"galerias\/tendencias\"}","_o_a_s_page":"elcomercio.com\/tendencias_EC","_o_a_s_positions":"Top,Top1,x01,Middle,Middle1,Middle2,x11,Top2,x13,Middle3,Bottom,Bottom1,Bottom2,Right2,Right1,x101,x102","locked":false},{"title":"Mundial Brasil 2014","type":"section","details":"{\"type\":\"deportes\/mundial-brasil-2014\"}","_o_a_s_page":"elcomercio.com\/mundial_EC","_o_a_s_positions":"Middle2,x01,x02,Bottom1,Bottom2,x09,Top,Top1","locked":false},{"title":"Deportes","type":"section","details":"{\"type\":\"deportes\"}","_o_a_s_page":"elcomercio.com\/deportes_EC","_o_a_s_positions":"Top,Top1,x01,x02,x03,x04,x09,Middle,Middle1,Middle2,x11,Top2,x13,Bottom1,Bottom2,x101,x102","locked":false}],
    currentUri = document.location.pathname;

OAS_sitepage = '';
OAS_listpos = '';
OAS_importance = -1;

// importance order
var importance = ['default', 'home', 'section', 'article', 'url'];

for (var i in pages) {
    var page = pages[i];
    page.details = JSON.parse(page.details);

    var urlMatch = page.details.type;

    // treat home separately
    if (page.type == 'home' && currentUri.match("^" + urlMatch+ "$")) {
        OAS_listpos = page._o_a_s_positions;
        OAS_sitepage = page._o_a_s_page.replace(/^\//, '');
        OAS_importance = importance.indexOf(page.type);

        break;
    };

    if ( (page.type == "default") ||
        (page.type == 'url' && currentUri.match("^" + urlMatch + "$")) ||
        (page.type == 'section' && currentUri.match(urlMatch)) ||
        (page.type == 'article' && currentUri.match(urlMatch) && currentUri.match('.html$'))
    ) {
        //decide to keep most important
        if (importance.indexOf(page.type) > OAS_importance) {
            OAS_listpos = page._o_a_s_positions;
            OAS_sitepage = page._o_a_s_page.replace(/^\//, '');
            OAS_importance = importance.indexOf(page.type);
        };
    };
};

    OAS_version = 10;
    OAS_rn = '001234567890';
    OAS_rns = '1234567890';
    OAS_rn = new String (Math.random());
    OAS_rns = OAS_rn.substring (2, 11);
    function OAS_NORMAL(pos) {
        document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" TARGET=' + OAS_target + '>');
        document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + '?' + OAS_query + '" BORDER=0></A>');
    }

            OAS_version = 11;
        if ((navigator.userAgent.indexOf('Mozilla/3') != -1) || (navigator.userAgent.indexOf('Mozilla/4.0 WebTV') != -1))
            OAS_version = 10;
        if (OAS_version >= 11)
            document.write('<SCR' + 'IPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '?' + OAS_query + '"><\/SCRIPT>');//-->
    
    function OAS_AD(pos) {
        if (OAS_version >= 11)
            OAS_RICH(pos);
        else
            OAS_NORMAL(pos);
    }
