(function(){var d=window;d.AgavaCBN=d.AgavaCBN||{};var i=document,k=function(){var a=!1;if("undefined"!=typeof localStorage){try{localStorage.setItem("cbn2testst","1")}catch(b){}(a=localStorage.getItem("cbn2testst"))&&localStorage.removeItem("cbn2testst")}return a}(),l=function(a){try{delete d[a]}catch(b){d[a]=void 0}},j=function(a){var b=d[a];return"undefined"!=typeof b?(l(a),b):!1},e=function(a){return j("agava_cbn_"+a)},f=function(a){return j("agava_ai_"+a)},g=function(a){return a.match(/^%.+%$/)?
!1:a},m=function(a){var b=i.createElement("script");b.src=a;b.type="text/javascript";i.getElementsByTagName("head")[0].appendChild(b);return b};"undefined"==typeof Array.prototype.indexOf&&(Array.prototype.indexOf=function(a){for(var b=0,c=this.length;b<c;b++)if(this[b]==a)return b;return-1});var n=function(a,b,c){var d=function(){a()?b(c):setTimeout(d,100)};return d},o=function(a,b){for(var c in b)a[c]=b[c];return a},c={nid:e("nid"),pid:e("pid"),adv_id:e("advid"),adv_width:e("width"),adv_height:e("height"),
cbn_tbn:d.agava_cbn_tbn,cbn_tbn_login:j(d.agava_cbn_tbn+"_login"),cbn_tbn_options:j(e("tbn")+"_options"),p_ids:"undefined"!=typeof d.agava_cbn_p_ids?d.agava_cbn_p_ids.replace(/\s/ig,"").split(","):!1,show_tz:1!=j("agava_noshow_tz")?1:!1,showarea:/opera m(ob|in)i/i.test(navigator.userAgent)?!1:"1",brand:e("brand"),sliding:e("sliding"),silence:e("silence"),cbn_type:k&&"2"==g("2")?2:1,sg:"e9b76d12ac4d63628e28f346afcf26c7,1361310880",AI:{PPAStatus:g("2"),ecidPPA:g("urn:ecid:stub:16:f6151722-7ade-11e2-a758-20cf305552b4"),ecidPartners:f("ecid"),ecidStorageKey:"agava_ai_ecid",
targets:{keys:["agava_ai_4156","agava_ai_1292","agava_ai_3254","agava_ai_8607","agava_ai_1978"],PPA:[g("%AI_GENDER%"),g("%AI_AGE%"),!1,!1,!1],partners:[f("4156"),f("1292"),f("3254"),f("8607"),f("1978")]}},version:"130211"};c.sliding&&(c.show_tz=c.showarea=!1);k=function(a,b){if(!b){b=parseInt(Math.random()*1E8+1);i.write("<span style='display: -moz-inline-stack; display: inline-block;' id="+b+"></span>")}if(d.AgavaCBN.init)d.AgavaCBN.init(a,b);else{!d.AgavaCBNLoadLoader&&m("http://cbn.tbn.ru/loader_cache_"+
c.version+".js");d.AgavaCBNLoadLoader=1;n(function(){return typeof d.AgavaCBN.init!="undefined"},function(){l("AgavaCBNLoadLoader");d.AgavaCBN.init(a,b)})()}};if(e=function(a,b){for(var c=b||function(b){return b.indexOf(a)==-1?false:b},d=i.getElementsByTagName("script"),e=0;e<d.length;e++){var f=c(d.item(e).getAttribute("src")||"");if(f!==false)return f}}(void 0,function(a){a=(a.match(/.*\.tbn.ru\/loader.js\?id=([^&]+)/)||[false,false])[1];return!a?false:a.replace(/\s/,"").split(",")})){f=function(a,
b){return a.getAttribute("agava_cbn_"+b)};for(g=0;g<e.length;g++){var h=i.getElementById(e[g]);h?(c.pid=f(h,"pid"),c.nid=f(h,"nid"),c.adv_id=f(h,"advid"),c.adv_width=f(h,"width"),c.adv_height=f(h,"height"),c.silence=f(h,"silence"),c.cbn_tbn=f(h,"tbn"),c.cbn_tbn_login=h.getAttribute(c.cbn_tbn+"_login"),c.cbn_tbn_options=h.getAttribute(c.cbn_tbn+"_options"),k(o({},c),e[g])):d.console&&console.log&&console.log("ERROR: DOM element with id - '"+e[g]+"' not found")}}else k(c)})();
