if(typeof Begun!=="object"){
var Begun={};
}
if(typeof Begun.Error!=="object"){
Begun.Error={};
}
if(typeof Begun.loaderCallbacks==="undefined"){
Begun.loaderCallbacks=[];
}

Begun.DOM_TIMEOUT=1;
Begun.VERSION=10;

Begun.loaderCallbacks.push(begun_load_autocontext);

Begun.baseUrl='//autocontext.price.ru/';
function begun_load_autocontext(){
Begun.Scripts.importAllScripts({"acp/begun_utils.67da4d2e01.js":true});

if(typeof Begun.Error.send==='undefined'){
Begun.Error.send=function(errorMessage,errorUrl,errorLine,loggerAddress){
var be=Begun.Error;

if(
typeof be.sent[errorMessage]!=='undefined'||
be.excludedErrors[errorMessage]
){
return;
}

var protocol=Begun.Scripts.getConformProtocol(),
defaultErrorLogger='//autocontext.price.ru/log_errors?',
address=loggerAddress||window.begun_error_url||defaultErrorLogger,
padId=window.begun_auto_pad;

be.sent[errorMessage]=Begun.Utils.includeImage(
address+'e_msg='+encodeURIComponent(errorMessage)+'&e_url='+
encodeURI(errorUrl)+'&e_line='+errorLine+
'&pad_id='+padId+'&location='+encodeURI(document.URL)+
'&rev='+Begun.VERSION
);
};

Begun.Error.sent={};

Begun.Error.excludedErrors={
'Error loading script':true
};
}

(function(){
if(!Begun.Autocontext){
var errorHandler=window.onerror;
window.onerror=function regErrors(msg,url,line){
if(errorHandler&&errorHandler instanceof Function){
errorHandler();
}
if(typeof url==="string"&&url.search(/autocontext/i)!==-1||typeof msg==="string"&&msg.search(/Begun/i)!==-1){
Begun.Error.send(msg,url,line);
}
};
}
})();

Begun.Scripts.Callbacks['ac']=function(fileName){
if(!Begun.Autocontext&&Begun.Scripts.isLastRequired(fileName)){
Begun.Autocontext=new function(){
var _this=this;
this.dom_change=false;
this.multiple_feed=true;
this.options={
fake_block_offset:200,
fake_block_high_limit:251
};
this.fullScreenLoaded=false;
this.unhandledDebugs=[];
this.fullscreenResizeHandlerSet=false;
this.graphBannerDomains=[];
_this.Callbacks=new function(){
var ac=_this;
var _callbacks={};
var _extend=function(destination,source){
for(var property in source){
if(typeof source[property]=='object'){
var new_obj={};
for(var property2 in source[property]){
if(typeof source[property][property2]=='function'){
if((typeof destination[property]!=="undefined")&&(typeof destination[property][property2]=='function')){
new_obj[property2]=function(old_func,new_func,property2){
return function(){
old_func.apply(property2=='click'?this:ac,arguments);
new_func.apply(property2=='click'?this:ac,arguments);
};
}(destination[property][property2],source[property][property2],property2);
}else{
new_obj[property2]=function(func,property2){
return function(){
func.apply(property2=='click'?this:ac,arguments);
};
}(source[property][property2],property2);
}
}
}
destination[property]=new_obj;
}
}
return destination;
};
this.register=function(callbacks){
_extend(_callbacks,callbacks);
};
this.unregister=function(ns,handler){
if(ns in _callbacks){
if(handler){
delete _callbacks[ns][handler];
}else{
delete _callbacks[ns];
}
}
};
this.dispatch=function(obj,method,context_obj,args){
if(_callbacks[obj]&&typeof _callbacks[obj][method]=='function'){
args=args||[];
_callbacks[obj][method].apply(context_obj||this,args);
}else{
return null;
}
};
this.getCallbacks=function(){
return _callbacks;
};
};

var Module=(function(){
var ext={
"auto_hyper":"dc6a651f02",
"auto_photo":"3624d5bb42",
"toolbar":"afebe1de83",
"auto_mediatext":"9bdd75307c"
};



var loaded=[];
return{
updateAnticash:function(link){
var reModule=new RegExp("^"+_this.Strings.urls.base_scripts_url+"(\\w+)\.js$");
var parsed=reModule.exec(link);
if((parsed!==null)&&(parsed.length===2)&&
typeof ext[parsed[1]]!=="undefined"){
return ext[parsed[1]];
}else{
return false;
}
},
isLoaded:function(link){
return Begun.Utils.in_array(loaded,link);
},
load:function(link){
if(!this.isLoaded(link)){
var revNumber=this.updateAnticash(link),
included;

if(revNumber){
included=Begun.Utils.includeScript(
link.replace(
/(.+)\/([^\/]+)\.js$/,
"$1/acp/$2."+revNumber+".js"
)
);
}else{
included=Begun.Utils.includeScript(link);
}

if(included){
loaded.push(link);
}
}
},

baseLoad:function(path){
var base=_this.Strings.urls.base_scripts_url;
this.load(base+path);
},

baseLoadIf:function(flag,path){
if(flag){
this.baseLoad(path);
}
},

getNames:function(what){
switch(what){
case"loaded":
return loaded.toString();
case"all":
default:
var allModules='';
var comma='';
for(var aModule in ext){
if(ext.hasOwnProperty(aModule)){
allModules+=comma+aModule;
comma=',';
}
}
return allModules;
}
},

initInBlock:function(block,pad){
var initExtraModule=function(objName,func,object){
if(objName in Begun){
func(object);
}else{
setTimeout(function(){
initExtraModule(objName,func,object);
},Begun.DOM_TIMEOUT);
}
};

if(_this.isMediaText(block)){
initExtraModule('MediaText',_this.initMediaTextBlock,block);
}else if(_this.Blocks.checkType(block,'top')){
var collapsableBlock=Begun.Utils.getElementsByClassName(block.dom_obj,'div','begun_collapsable')[0],
height=collapsableBlock&&collapsableBlock.clientHeight,
body=document.getElementsByTagName('body')&&document.getElementsByTagName('body')[0];
if(height&&body){
body.style.paddingTop=height+'px';
}
}else if(_this.isRichMini(block)){
_this.initRichMiniSizes(block);
}
}
};
})();

this.replaceInvalidPicture=function(imgEl){
if(imgEl){
if((imgEl.width&&imgEl.width==1&&imgEl.height&&imgEl.height==1)||
(imgEl.naturalWidth&&imgEl.naturalWidth==1&&imgEl.naturalHeight&&imgEl.naturalHeight==1)){
imgEl.src=this.Strings.urls.price_fixture_logo_new_src;
}
}
};

this.warningModule={};

(function(warningModule){
var warningText={
"medicine":"&#1045;&#1089;&#1090;&#1100;&#32;&#1087;&#1088;&#1086;&#1090;&#1080;&#1074;&#1086;&shy;&#1087;&#1086;&#1082;&#1072;&#1079;&#1072;&#1085;&#1080;&#1103;&#46;&#32;&#1055;&#1086;&#1089;&#1086;&#1074;&#1077;&#1090;&#1091;&#1081;&#1090;&#1077;&#1089;&#1100;&#32;&#1089;&nbsp;&#1074;&#1088;&#1072;&#1095;&#1086;&#1084;&#46;",
"abortion":"&#1045;&#1089;&#1090;&#1100;&#32;&#1087;&#1088;&#1086;&#1090;&#1080;&#1074;&#1086;&shy;&#1087;&#1086;&#1082;&#1072;&#1079;&#1072;&#1085;&#1080;&#1103;&#46;&#32;&#1055;&#1086;&#1089;&#1086;&#1074;&#1077;&#1090;&#1091;&#1081;&#1090;&#1077;&#1089;&#1100;&#32;&#1089;&nbsp;&#1074;&#1088;&#1072;&#1095;&#1086;&#1084;&#46;"
};
warningModule.getText=function(type){
return warningText[type]||"";
};
warningModule.parseWarning=function(text){
text=text||'';
var warning=(text.toLowerCase&&text.toLowerCase())||'';
for(var key in warningText){
if(warning.indexOf(key)!=-1){
return{
type:key,
text:warningText[key]
};
}
}
return false;
};
}(this.warningModule));
this.tplLoaded=function(tpl){
this.tplLoaded.notFinished[tpl]=false;
if(this.fillBlocks.delayedCall&&!ExtBlockTypes.isLoading()){
this.fillBlocks();
this.fillBlocks.delayedCall=false;
}
};
this.tplLoaded.notFinished={};

var ExtBlockTypes=(function(){
var ext={
"begun_tpl_block_120x600":"3312786d58",
"begun_tpl_block_160x600":"be4291016d",
"begun_tpl_block_mediatext_160x600":"4cfd7aaf80",
"begun_tpl_block_mediatext_horizontal":"c9c9634a1b",
"begun_tpl_block_200x300":"bab30949b5",
"begun_tpl_block_price_200x300":"6123a3678a",
"begun_tpl_block_mediatext_200x300":"a4d26fbc01",
"begun_tpl_block_240x400":"fc06942a75",
"begun_tpl_block_price_240x400":"458b4126f4",
"begun_tpl_block_mediatext_240x400":"a31db0b793",
"begun_tpl_block_mediatext_price_240x400":"a7f674a401",
"begun_tpl_block_300x250":"e17f5813c3",
"begun_tpl_block_price_300x250":"df599e5b56",
"begun_tpl_block_320x50":"85e4b5d5c5",
"begun_tpl_block_mediatext_300x250":"379eb5e9ce",
"begun_tpl_block_mediatext_price_300x250":"1492f85fb6",
"begun_tpl_block_468x60":"2238ede18e",
"begun_tpl_block_price_468x60":"144ae81b35",
"begun_tpl_block_728x90":"7e64e80f68",
"begun_tpl_block_price_728x90":"323acdf829",
"begun_tpl_block_mediatext_728x90":"403f31e8d1",
"begun_tpl_block_mediatext_price_728x90":"7df5394815",
"begun_tpl_block_990x90":"656dc8074b",
"begun_tpl_block_mediatext_price_300x600":"2f32ce072b",
"begun_tpl_block_mediatext_price_horizontal":"b0efa9384e",
"begun_tpl_block_mediatext_price_large_horizontal":"75db089c67",
"begun_tpl_block_flat":"d17046e11e",
"begun_tpl_block_horizontal":"32adbc6664",
"begun_tpl_block_price_horizontal":"e6c6cefadc",
"begun_tpl_block_square":"9fab836839",
"begun_tpl_block_top":"3593b82db2",
"begun_tpl_block_vertical":"afe6401aa3",
"begun_tpl_block_price_vertical":"1c16297506",
"begun_tpl_block_price_search":"4d5ea970d7",
"begun_tpl_block_price_services_vertical":"e6415cd8e1",
"begun_tpl_block_price_grid":"0c18e37c6e",
"begun_tpl_block_mediatext_mobile":"0516d3ee8b",
"begun_tpl_block_eda":"8ba797fc68"
};

return{
isLoading:function(){
var isAny=false;
for(var status in _this.tplLoaded.notFinished){
if(_this.tplLoaded.notFinished.hasOwnProperty(status)){
if(_this.tplLoaded.notFinished[status]){
isAny=true;
break;
}
}
}
return isAny;
},
load:function(tplFileName){
if(typeof ext[tplFileName]==="undefined"){
return;
}
if(typeof _this.tplLoaded.notFinished[tplFileName]==="undefined"){
var included=Begun.Utils.includeScript(_this.Strings.urls.base_scripts_url+"acp/"+
tplFileName+"."+ext[tplFileName]+".js","write");

_this.tplLoaded.notFinished[tplFileName]=included;
}
},
loadAll:function(){
for(var tplFileName in ext){
if(ext.hasOwnProperty(tplFileName)){
this.load(tplFileName);
}
}
}
};
})();

var UA_DESKTOP=0,
UA_CLASSIC_MOBILE=1,
UA_RICH_MOBILE=2,
BLOCK_ID_TOP_MOBILE=2,
BLOCK_ID_FULLSCREEN=3;

this.getBlockIdTopMobile=function(){
return BLOCK_ID_TOP_MOBILE;
};

this.Strings={
urls:{
begun:'//biz.price.ru/welcome?utm_source=partner&utm_medium=logo&utm_campaign=goods_blocks',
price:'//biz.price.ru/welcome?utm_source=partner&utm_medium=logo&utm_campaign=goods_blocks',
autocontext:'//autocontext.price.ru/',
ac_filename:'autocontext2.js',
hostname:'autocontext.price.ru',
base_scripts_url:'//autocontext.price.ru/',
styles:'//autocontext.price.ru/css?',
daemon:'//autocontext.price.ru/context.jsp?wl=price&',
rtb_daemon:'//rtb.price.ru',
video:'//video.price.ru/vcp.swf',
thumbs:'//thumbs.price.ru/',
blank:'//autocontext.price.ru/img/blank.gif',
mediatext_price_background:'//autocontext.price.ru/img/background_',
log_banners_counter:'//autocontext.price.ru/blockcounter?log_visibility=1&',
begun_logo_src:'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAQCAYAAABKkhw/AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA8VJREFUeNrkl1loE1EUhs8k6R63ulSt4tKKVcGNuvvgQgU3FB8UEVEEURBBcUHxQX3wQSuoIGpdUKpYBHeoiLigolZapEpbqEUpxbZujVqjRGsS/9P+KTcxwmj6UOiBL5PcuTNz/3v+e+7ECgaD0pHCZVlWZxwTwEfQrtQnZohk5olYOrBAa/NYjPIxx/zP4QBHQR1Iam/Z8L0SaXwIwfFhzZqUpv+9pwp2aqb1/kBvnfyXvtovhX2jhV7rlpaERD7DinKvyLbkaFn7eAEfgSi9bcTPwJ+W1cH4yV7wCDwD+c3WobPAOnALlIM7YBPFa6SCXQC5kApwBazguQHgMlhqPDMbXAcz+HsKOAVegCfgABgU6vy9UsRzAzOUYk+kCvTj49svkTFdsyUjZXjzb1NwkDO+HnwC78BycBx0ATvAYdAN3ASdwH6wh/c4AXbyHvfAVHCGIjVjC8AoY0zpYA7oDzJBIVgFSsEXsAFcoltaRmejsqgoL0Q2IavxjkSZ12eRHBp9VdKTBsov43oXRWuMBC/5XYXlgCwwC9SDeSxs3cFdsBio4Rbydw7NN5aZWkbHSMSa8/PoBXM5qWtBHtvzOeHDQLGdrKrIFFeC5KTNllFdJsqE7jNlROfs5nPvf9S2CgwJtjiH1Ua7lxOh6+obbXub/TCP0hc0gMHsX0+xGjV0SqTTohZiHiuMthIKtlWFNbNul1tyR56T6b0WhJ0r8tyWKm+ZOK3oGTYjYBzjQCMoMM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c/vgeSYPl/f653/NquBtcGdeSM3UerV24NtTCYkRL29svnjiP71z998OffPxYmJh8ltSZrRz42dmS/sUCouQdOsLOyNIZ6Mvz729XavO38GYOsDFMJqXOvXmy4c4OVibnb3hVd299//+69fOuupyHOz/vr5InQj+/NwiKD/cIgKjbdvakiIIQW2kxgbSB3akiLg9g3r6t8/xEYGHLtyQvruokXHjz1U1bXEhbFog0r+A9C///hSAwgbcxMjEDy5rOXILa6JpD8uWObtozEsaYCI0UZPNqYlMSF91+78/rTFzZTU2Yl5V9HjxBIXZB4mLbriFByZcacVaA4+vnz77t3//ECqLYfv3871vYq+oa0rl4DDFg0RcAI7Dh52H7FfLgEIk1ee/gks7Prl7qciJxUpoGprbQcLxv7p18/Dz95NOPi6ctvXkly8x6LSmbETMovv32tPbpv14O7EC4wln//+wthuyuotFg7inJx48w4jz5/PPvy+ZPPnz7/+gm0UJaXz0hcUo6Xn0B+IwYABBgAPdNtoH+WAQ8AAAAASUVORK5CYII=',
price_fixture_logo_new_src:'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRF72Bdmc7LVaqn/dmN+Pv69JOR/Mpg+rw1NaSa1+rqNm54IEYfSGVQ/em9+Lu66PLyRYSS/vXqtNjY/N7ds5o+fn1apm9rdMC6mLvFeKazyuHhFjw9EmN5+rEVH5qP////M6+YBAAABsZJREFUeNrsndti4iAQhgMhxxqTYG2Uenj/t9xYteYA4RjALnOzN3Z3P2cG/hkYGl3/iEUBJIAEkAASQAJIAAkgASSABJAAEkACSAAJIAEkgASQABJAAsj/CdJWVZymWXZ+WJalaRxX7TuBtD3CL8DMsjSu3gAEVTGb4WVp3PoM0lbpWdgyY44xDSJD8WRpvQNphSKKEmOVVyBtela2LEa+gOhgmECJ/MC4ozgHaeOzEcsqtyBVdjZlaesOxERUDSx2BVKdDZuiUyKv3HG3yj6Iwew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J4bXAuZGlkOjZGNUQ4NDI0MDRCREU0MTE4RTIwRTVBOTg1MTAwMzYwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+5j8lqAAAAcJJREFUeNpi+P//PxMDOgAKMqIIAAQQitQZEA3S9BvEAQggmOhEbEqvALEzjA8QQAzodoE4KkBBFlw2TYAxWoFYGKYFBEQYGRnfAgXdAAIIJMsDxEuBWBeHmxkYkcx8AKRmATHIOB6oMIidj+y0Y0B8HoifATEnEBsDsT3QyqfIJqkBqWIgZoVbw8iYhO4FOSAWQOJrADFYA0AAgTgseAIa7FULIL7NgA8ATTgLxGzYTGKEKlgPpK7AAg4pEG1hJlgBcROaqUxAPAXZuxeBVBcQ6wOxERBLAnE2sk+eA3EUEOsguwXZhCpQfCPZcgYYYNNgkmzwxAThayPzYYJ6aA7UBrEBAowRyPAA0oFADFIgCsTqQKP/MpADgIb5gawG4lhS9SJ7lgUadWxAvAVJzS8g/gbE36E0DP8AYi4gXoTumiyoa4KwuJQZiNmBmAuI+YA4B4gXAjEnep4GmfoPiBMxnAwMJyD+CXWZODSxnwSKfWdBU/gFaPILINMZSF+CakAGv6E5BoZnI+dY5BKAH4ivYzGAAZqb5IGYGWhhNRD/xhVLYqD0API7DnlQyaKJtXiDKuCEBiwIr8Qib4YkHwoTBwB/RCxEuu6/JQAAAABJRU5ErkJggg==',
hyper_shadow_1:'//autocontext.price.ru/img/hyper-shadow-1.png',
hyper_shadow_2:'//autocontext.price.ru/img/hyper-shadow-2.png',
close_fullscreen:'//autocontext.price.ru/img/close_fullscreen.png',
mobile_icon:'//autocontext.price.ru/img/mobile_icon.png',
no_flash:'//autocontext.price.ru/noshow'
},
contacts:{
card:'&#1050;&#1086;&#1085;&#1090;&#1072;&#1082;&#1090;&#1099;'
},
css:{
prefix:'begun',
block_prefix:'begun_block_',
thumb:'begun_adv_thumb',
logo_color:'#000000',
fix_layout:'begun_fix_layout',
mobile_classic:'begun_mobile_classic',
mobile_rich:'begun_mobile_rich'
},
js:{
banner_onclick:'Begun.Autocontext.clickBanner(event, this)'
}
};

var isBFSApplicable=function(){
return _this.multiple_feed&&!window.begun_block_ids;
};

var addFakeBlocks=function(){
var feed=_this.getFeed();
if(feed.blocks){
var _block,
i=0;
while(_block=feed.blocks[i]){
if((_block)&&(_block.id==BLOCK_ID_TOP_MOBILE||_block.id==BLOCK_ID_FULLSCREEN)){
_this.Blocks.add(_block);
}
i++;
}
}
};

var LoadingStrategy=function(){};
LoadingStrategy.prototype={
loadBlock:function(block_id){},
parseFeed:function(){}
};


var DS=function(){};
DS.prototype=new LoadingStrategy();
DS.prototype.loadBlock=function(block_id){
this.block_id=block_id;
if(!_this.initFeedLoad()&&arguments.callee.run){
_this.loadFeedDone();
}
arguments.callee.run=true;
};
DS.prototype.parseFeed=function(){
_this.loadExtraResources();
var feed=_this.getFeed();
if(feed&&feed.blocks&&this.block_id){
addFakeBlocks();
var block=_this.Blocks.getBlockById(this.block_id,feed.blocks);
if(block){
_this.Blocks.push(block);
}
}
};


var FBS=function(){};
FBS.prototype=new LoadingStrategy();
FBS.prototype.parseFeed=function(){
var extendUndefinedFields=function(destination,source){
for(var property in source){
if(source.hasOwnProperty(property)){
if(typeof destination[property]==="undefined"){
destination[property]=source[property];
}else if(typeof destination[property]==="object"&&typeof source[property]==="object"){
destination[property]=extendUndefinedFields(destination[property],source[property]);
}
}
}
return destination;
};
_this.loadExtraResources();
var feed=_this.getFeed();
if(feed&&feed.blocks&&this.block_id){
var block=_this.Blocks.getBlockById(this.block_id,feed.blocks);
if(block){
extendUndefinedFields(block.options,window.begun_extra_block.options);
window.begun_extra_block.id=window.begun_block_id;
_this.Blocks.push(window.begun_extra_block);
}
addFakeBlocks();
}
};
FBS.prototype.loadBlock=function(block_id){
var feed=_this.getFeed();
if(feed&&feed.blocks){
_this.resetBannerIndex();
_this.feedLoad();
}
this.block_id=block_id;
};


var BFS=function(){};
BFS.prototype=new LoadingStrategy();
BFS.prototype.loadBlock=function(block_id){
this.block_id=block_id;
var feed=_this.getFeed();
if(feed&&feed.blocks){
_this.resetBannerIndex();
_this.feedLoad();
}
};
BFS.prototype.parseFeed=function(){
(new DS).parseFeed.apply(this);
};

this.getLoadingStrategy=function(){
if(window.begun_extra_block){
if(!arguments.callee.fbs){
arguments.callee.fbs=new FBS();
}
return arguments.callee.fbs;
}else if(isBFSApplicable()){
if(!arguments.callee.bfs){
arguments.callee.bfs=new BFS();
}
return arguments.callee.bfs;
}else{
if(!arguments.callee.ds){
arguments.callee.ds=new DS();
}
return arguments.callee.ds;
}
};
this.setOptions=function(options){
Begun.extend(_this.options,options||{});
};

this.requestParams={
"pad_id":'',
"block_id":'',
"n":'',
"lmt":Date.parse(document.lastModified)/1000,
"json":1,
"jscall":'loadFeedDone',
"condition_id":window.begun_condition_id||'',
"frm_level":'',
"frm_top":'',
"version":'',
"domain_filter":'',
"stopwords":window.stopwords||'',
"begun_self_keywords":window.begun_self_keywords||'',
"begun_self_categories":window.begun_self_categories||'',
"format_w":window.begun_format_w||'',
"format_h":window.begun_format_h||'',
"do_cpm":window.begun_cpm?1:0,
"ref":document.referrer,
"real_refer":document.URL,
"section":''
};

this.responseParams={};

this.Storage=new function(){
var values;
try{
if(!top.Begun){
top.Begun={};
}
values=top.Begun.storageValues=top.Begun.storageValues||{};
}catch(e){
try{
if(!parent.Begun){
parent.Begun={};
}
values=parent.Begun.storageValues=parent.Begun.storageValues||{};
}catch(ex){
values={};
}
}

return{
getV:values,
set:function(prop,data){
if(typeof data!='object'||!values[prop]){
values[prop]=data;
}else{
Begun.extend(values[prop],data);
}
},
erase:function(prop){
values[prop]={};
},
get:function(prop){
return values[prop];
},

incProperty:function(obj,prop){
if(typeof values[obj]!=='object'){
values[obj]={};
values[obj][prop]=0;
}else{
values[obj][prop]=typeof values[obj][prop]=='number'?values[obj][prop]+1:0;
}
}
};
};

this.prepareRequestParams=function(newValues){
var comma="",
begunStorage=_this.Storage,
padId=_this.requestParams.pad_id=window.begun_auto_pad;

if(begunStorage.get('url')&&begunStorage.get('url')!==document.URL){
begunStorage.erase(padId);
begunStorage.set('pageId',false);
}

if(_this.Monitor.setFirst(padId,'requested')){
_this.requestParams.first='1';
}

_this.requestParams.domain_filter=_this.getGraphBannerDomains();
_this.requestParams.version=Begun.VERSION;
if(typeof(window.begun_js_force_load)!='undefined'&&window.begun_js_force_load){
ExtBlockTypes.loadAll();
var moduleNames=Module.getNames('all').split(','),
baseUrl=_this.Strings.urls.base_scripts_url,
j;
for(j=0;j<moduleNames.length;j++){
if(moduleNames[j]!=="toolbar"){
Module.load(baseUrl+moduleNames[j]+".js");
}
}
}
var frame_level=(function(){
var level=0,
_parent=window;
while(_parent&&_parent!==top&&level<999){
_parent=_parent.parent;
level++;
}
return level;
})();
if(frame_level){
_this.requestParams.frm_level=frame_level;
try{
_this.requestParams.frm_top=top.location.href;
}catch(exc){
_this.requestParams.frm_top='top_not_accessible';
}
}

var blockEl=_this.Blocks.getDomObj(window.begun_block_id);
if(blockEl&&blockEl.parentNode){
_this.requestParams.width=blockEl.parentNode.clientWidth;
_this.requestParams.height=blockEl.parentNode.clientHeight;
}

if(typeof _this.isNotFirstRequest==="undefined"){
_this.isNotFirstRequest=true;
comma=",";
_this.requestParams.block_id=BLOCK_ID_TOP_MOBILE;
}

if(window.begun_block_ids){
_this.requestParams.block_id+=comma+window.begun_block_ids.replace(/\s/g,"");
}else{
if(window.begun_block_id&&isBFSApplicable()){
_this.requestParams.block_id+=comma+window.begun_block_id;
}
}
if(_this.requestParams.block_id==BLOCK_ID_FULLSCREEN||window.begun_fullscreen){
_this.requestParams.width=window.innerWidth/2;
_this.requestParams.height=window.innerHeight/2;
}

if(window.begun_request_params&&window.begun_request_params.constructor===Object){
Begun.extend(_this.requestParams,window.begun_request_params);
}
if(newValues){
Begun.extend(_this.requestParams,newValues);
}
begunStorage.incProperty(padId,'rq');
if(!begunStorage.get('pageId')){
begunStorage.set('pageId',(function(){
var ret="",i=0;
while(i<32){
ret+=Math.floor(Math.random()*16).toString(16);i++;
}
return ret.toUpperCase();
})());
begunStorage.set('url',document.URL);
}
_this.requestParams.rq=begunStorage.get(padId)['rq'];
_this.requestParams.rq_sess=begunStorage.get('pageId');
_this.requestParams.begun_self_keywords=window.begun_self_keywords||'';
_this.requestParams.begun_self_categories=window.begun_self_categories||'';
_this.requestParams.format_w=window.begun_format_w||'';
_this.requestParams.format_h=window.begun_format_h||'';
_this.requestParams.do_cpm=window.begun_cpm?1:0;
_this.requestParams.secure=Begun.Scripts.getConformProtocol()=='https:'?1:0;
_this.requestParams.section=window.begun_usertag||'';
window.begun_self_keywords='';
window.begun_self_categories='';
window.begun_format_w='';
window.begun_format_h='';
window.begun_usertag='';
window.begun_cpm=0;
};
this.init=function(){
_this.Customization.init();
_this.Pads.init();
_this.initCurrentBlock();
if(typeof arguments.callee.run==="undefined"){
arguments.callee.run=true;
}
};

this.initToolbar=function(debug){
if(Begun.Toolbar){
var toolbar=Begun.Toolbar.init(debug);
}
};
this.initHypercontextBlock=function(block,pad_id){
if(!Begun.Hypercontext||!block){
return;
}
this.hyperBlock=new Begun.Hypercontext(block,pad_id);
};
this.initPhotocontextBlock=function(block,pad_id){
if(!Begun.Photocontext||!block){
return;
}
this.photoBlock=new Begun.Photocontext(block,pad_id);
};
this.initMediaTextBlock=function(block){
if(!Begun.MediaText){
return false;
}
new Begun.MediaText(block);
};

this.setRichMiniSizes=function(img,max){
var minP='width',
maxP='height',
px='px';

var res={};
res[minP]=img['naturalWidth'];
res[maxP]=img['naturalHeight'];

if(res[maxP]!==res[minP]){
if(res[minP]>res[maxP]){
var sw=maxP;
maxP=minP;
minP=sw;
}

res[minP]=Math.round(max*res[minP]/res[maxP]);
res[maxP]=max;

var offset=(max-res[minP])/2,
offsetDir=minP=='width'?'left':'top';
res['offset_'+offsetDir]=offset;
img.style[offsetDir]=offset+px;
}else{
res[maxP]=res[minP]=max;
}

img.style[maxP]=res[maxP]+px;
img.style[minP]=res[minP]+px;

return res;
};

this.initRichMiniSizes=function(block){
var rich_mini_blocks_div=_this.Blocks.getDomObj(block.id);
if(rich_mini_blocks_div){

var min=60,
small_images=[],
i,l,
cells=Begun.Utils.getElementsByClassName(rich_mini_blocks_div,'*','begun_adv_cell');
for(i=0,l=cells.length;i<l;i++){
small_images[i]=Begun.Utils.getElementsByClassName(cells[i],'img','begun_adv_picture')&&Begun.Utils.getElementsByClassName(cells[i],'img','begun_adv_picture')[0];
}
for(i=0,l=small_images.length;i<l;i++){
if(small_images[i]){
var setSizes=function(num,image,max,key,obj){
_this.setRichMiniSizes.call(obj,image,max);
};
var detectImgDimensions=function(img,i,value,key,obj,block){
if(img.complete){
setSizes(i,img,value,key,obj,block);
}else{
window.setTimeout((function(img,i,value,key,obj,block){
return function(){
detectImgDimensions(img,i,value,key,obj,block);
};
})(img,i,value,key,obj,block),Begun.DOM_TIMEOUT);
}
};
detectImgDimensions(small_images[i],i,min,'min',_this,block);
}
}
}
};

this.parseLinks=function(){
var feed=_this.getFeed();
if(!feed){
return;
}
var links=feed.links;
if(links){
var i=0,
link,
linksArr=[];
while(link=links[i]){
switch(link.type){
case'js':
Module.load(link.url);
break;
case'swf':
var isFlashInstalled=Begun.Utils.checkFlash();
if(isFlashInstalled){
var swf_url=link.url;
Begun.Utils.addEvent(window,'load',function(){
Begun.Utils.includeSWF(swf_url);
});
}
break;
case'iframe_js':
linksArr.push('script='+encodeURIComponent(link.url));
break;
case'img':
case'gif':
case'png':
case'204':
case 204:
case'302':
case 302:
default:
linksArr.push('img='+encodeURIComponent(link.url));
break;
}
i++;
}
url="//profile.price.ru/sandbox?"+linksArr.join('&'),
linksFrame=document.createElement("iframe");
linksFrame.setAttribute("style","height:0;width:0;border:0");
linksFrame.setAttribute("width",0);
linksFrame.setAttribute("height",0);
linksFrame.setAttribute("src",encodeURI(url));
Begun.$$('head',document,0).appendChild(linksFrame);
}
};

this.loadExtraResources=function(){
var feed=_this.getFeed();
if(!feed){
return;
}
var isHyper,isPhoto,isMediaText,
blocks=feed.blocks;
for(var k=0;k<blocks.length;k++){
if(_this.isMediaText(blocks[k])){
isMediaText=true;
}
if(_this.Blocks.checkType(blocks[k],'hyper')||_this.Blocks.checkType(blocks[k],'price_hyper')){
isHyper=true;
}
if(_this.Blocks.checkType(blocks[k],'photo')){
isPhoto=true;
}
}

Module.baseLoadIf(isHyper,"auto_hyper.js");
Module.baseLoadIf(isPhoto,"auto_photo.js");
Module.baseLoadIf(isMediaText,"auto_mediatext.js");
};

this.draw=function(){
if(!arguments.callee.run){
_this.Blocks.init();
}
arguments.callee.run=true;
if(ExtBlockTypes.isLoading()){
_this.fillBlocks.delayedCall=true;
}else{
_this.fillBlocks();
}
};

this.useBlockIdDistr=function(){
return!!(_this.getBanner('autocontext',0)&&_this.getBanner('autocontext',0)["block_id"]);
};
this.isFakeBlockId=function(block_id){
return block_id<this.options.fake_block_high_limit&&block_id>this.options.fake_block_offset&&this.lastBlockId;
};
this.initCurrentBlock=function(){
var fakeBlockId;
if((typeof window.begun_auto_pad!=="undefined"&&window.begun_auto_pad>0)&&
(typeof window.begun_block_id!=="undefined"&&window.begun_block_id>0)){

if(window.begun_extra_block){
var total_banners=window.begun_total_banners||_this.getActualBlockBannersCount();
fakeBlockId=this.options.fake_block_offset+parseInt(total_banners);
this.lastBlockId=window.begun_block_id;
}

_this.begun_click_wrap=window.begun_click_wrap||'';
window.begun_click_wrap='';

_this.printBlockPlace(window.begun_block_id);

_this.getLoadingStrategy().loadBlock(window.begun_block_id);

if(fakeBlockId){
window.begun_block_id=fakeBlockId;
}
_this.initFeedLoad();
}else if((_this.init.run)||(typeof window.begun_total_banners==="undefined"
&&typeof window.begun_block_ids==="undefined")){
Begun.Error.send("begun_block_id is missing",document.URL,-1);
}
};
this.getActualBlockBannersCount=function(block){
if(typeof window.begun_extra_block!=="undefined"){
return window.begun_extra_block.options.banners_count;
}else{
return 0;
}
};
this.initFeedLoad=function(){
if(_this.isFeedStarted()){
return false;
}
if(isBFSApplicable()||window.begun_extra_block||!_this.getFeed()){
_this.setFeedStarted();
this.feedLoad();
}
return false;
};
this.feedLoad=function(paramsUpdate){
_this.prepareRequestParams(paramsUpdate);

var params=Begun.Utils.toQuery(_this.requestParams);

var feedURL=(
window.begun_feed_source?
_this.Strings.urls.rtb_daemon+window.begun_feed_source:
_this.Strings.urls.daemon+params
).replace(/%[0-9a-fA-F]?$/,'');

var included=Begun.Utils.includeScript(
feedURL,
'write',
null,
'begunAds'
);
_this.requestParams.block_id="";
_this.requestParams.begun_self_keywords="";
_this.requestParams.begun_self_categories="";
return included;
};
this.getGraphHTML=function(graph_banner,callback,width,height,block_id){
width=width||240;
height=height||400;

var inlineStyles='',
type='img',
src=graph_banner.source,
block=this.Blocks.getBlockById(block_id);

var screenWidth=window.innerWidth,
screenHeight=window.innerHeight,
scaleWidth=screenWidth/width,
oldWidth=width,
oldHeight=height,
size=(graph_banner.visible_bbox||'').match(/(\d+),(\d+)/)||[null,graph_banner.width,graph_banner.height],
bboxWidth=parseInt(size[1]),
bboxHeight=parseInt(size[2]);

if(block.options.dimensions.type=='320x50'){
if(width>320){
scaleWidth=320/width;
width=320;
height=height*scaleWidth;
}else{
scaleWidth=1;
}
}

if(block_id&&block_id==BLOCK_ID_TOP_MOBILE){
if(width>screenWidth){
width=screenWidth;
height=height*scaleWidth;
}else{
scaleWidth=1;
}
}

if(block_id&&(block_id==BLOCK_ID_FULLSCREEN||window.begun_fullscreen)){
if(!_this.fullscreenResizeHandlerSet){
_this.fullscreenResizeHandlerSet=true;
Begun.Utils.addEvent(window,'resize',(function(a,b,c,d,e){
return function(){
var blockPlace=document.getElementById('begun_block_'+e);
if(!blockPlace)return;
if(a.mime=='text/html'||a.mime=='html'){
var screenw=window.innerWidth,
screenh=window.innerHeight,
s=(a.visible_bbox||'').match(/(\d+),(\d+)/)||[null,a.width,a.height],
bbw=parseInt(s[1]),
bbh=parseInt(s[2]),
scalew,
oldw=a.width,
oldh=a.height,
w,h,istyles,frameel;
if(bbw/screenw>=bbh/screenh){
scalew=screenw/bbw;
}else{
scalew=screenh/bbh;
}
w=oldw*scalew;
h=oldh*scalew;

blockPlace.style.left=((screenw-w)/2)+'px';
blockPlace.style.top=((screenh-h)/2)+'px';
Begun.Utils.setStyle(blockEl,'width',w+'px');
Begun.Utils.setStyle(blockEl,'height',h+'px');
frameel=blockPlace.getElementsByTagName('iframe')[0];
istyles='width:'+oldw+'px;height:'+oldh+'px;-webkit-transform: scale('+scalew+');-webkit-transform-origin: 0 0;'+
'-moz-transform: scale('+scalew+');-moz-transform-origin: 0 0;-ms-transform: scale('+scalew+');-ms-transform-origin: 0 0;max-width:none;';
frameel&&frameel.setAttribute('style',istyles);
frameel.contentWindow.postMessage(JSON.stringify({
'message':'resize',
'screenWidth':screenw,
'screenHeight':screenh
}),'*');
}else{
blockPlace.innerHTML=Begun.Autocontext.getGraphHTML(a,b,c,d,e);
}
}
}(graph_banner,null,0,0,block_id)));
Begun.Utils.addEvent(window,'message',function(event){
try{
var data=JSON.parse(event.data);
}catch(e){
return false;
}
if(data&&data.message&&data.message=='getOrientation'){
event.source.postMessage(JSON.stringify({
'message':'resize',
'screenWidth':window.innerWidth,
'screenHeight':window.innerHeight
}),'*');
}
});
}

if(bboxWidth/screenWidth>=bboxHeight/screenHeight){
scaleWidth=screenWidth/bboxWidth;
}else{
scaleWidth=screenHeight/bboxHeight;
}

width=graph_banner.width*scaleWidth;
height=graph_banner.height*scaleWidth;
oldWidth=graph_banner.width;
oldHeight=graph_banner.height;

var blockEl=document.getElementById('begun_block_'+block_id);
blockEl.style.left=((screenWidth-width)/2)+'px';
blockEl.style.top=((screenHeight-height)/2)+'px';
Begun.Utils.setStyle(blockEl,'width',width+'px');
Begun.Utils.setStyle(blockEl,'height',height+'px');
}

if(("swf"==graph_banner.mime)||("application/x-shockwave-flash"==graph_banner.mime)){
type='swf';
inlineStyles='width:'+width+'px;height:'+height+'px;';
}else if(("html"==graph_banner.mime)||("text/html"==graph_banner.mime)){
type='html';
if(block_id==BLOCK_ID_TOP_MOBILE||block_id==BLOCK_ID_FULLSCREEN||block.options.dimensions.type=='320x50'||window.begun_fullscreen){
inlineStyles='width:'+oldWidth+'px;height:'+oldHeight+'px;-webkit-transform: scale('+scaleWidth+');-webkit-transform-origin: 0 0;'+
'-moz-transform: scale('+scaleWidth+');-moz-transform-origin: 0 0;-ms-transform: scale('+scaleWidth+');-ms-transform-origin: 0 0;';
var blockPlace=document.getElementById('begun_block_'+block_id);
if(blockPlace){
Begun.Utils.setStyle(blockPlace,'width',width+'px');
Begun.Utils.setStyle(blockPlace,'height',height+'px');
}else if(block.options.dimensions.type=='320x50'){
blockPlace=document.getElementById('begun_block_'+block_id);
if(blockPlace){
Begun.Utils.setStyle(blockPlace,'width',width+'px');
Begun.Utils.setStyle(blockPlace,'height',height+'px');
}
}
width='';
height='';
}
}else if(("js"==graph_banner.mime)||("application/x-javascript"==graph_banner.mime)){
type='js';
if(graph_banner.tracking){
Begun.Utils.includeImage(graph_banner.tracking);
}
Begun.Utils.includeScript(src,'append',callback);
}else if(graph_banner.mime=='application/x-html'){
type='xhtml';
var feed=_this.getFeed(),
impression_id='';
if(feed&&feed.params&&feed.params.impression_id){
impression_id=feed.params.impression_id;
}
(function(blockId,banner){
var XHR=((new XMLHttpRequest()).withCredentials!==undefined)?XMLHttpRequest:XDomainRequest;
try{
var xhr=new XHR();
}catch(e){

}
xhr.open('GET',src,true);

xhr.onload=function(){
var outerContainer=document.getElementById('begun_block_'+blockId),
innerContainer;
if(!outerContainer)return;
innerContainer=Begun.Utils.getElementsByClassName(outerContainer,'div','xhtml_banner')[0];
if(innerContainer){
innerContainer.innerHTML=this.responseText;
Begun.Utils.reattachScripts(innerContainer.childNodes);
Begun.Utils.addEvent(innerContainer,'click',function(){
Begun.Utils.includeImage(banner.url);
});
}
};

xhr.onerror=function(){
};

xhr.send();

})(block_id,graph_banner);
}else if(graph_banner.mime=='application/x-iframe-html'||graph_banner.mime=='application/x-fixed-iframe-html'){
type='xiframe';
inlineStyles='width:'+width+'px;height:'+height+'px;';
feed=_this.getFeed();
impression_id='';
if(feed&&feed.params&&feed.params.impression_id){
impression_id=feed.params.impression_id;
}
(function(blockId,banner){
var XHR=((new XMLHttpRequest()).withCredentials!==undefined)?XMLHttpRequest:XDomainRequest;
try{
var xhr=new XHR();
}catch(e){

}
xhr.open('GET',src,true);

xhr.onload=function(){
var outerContainer=document.getElementById('begun_block_'+blockId),
innerContainer;
if(!outerContainer)return;
innerContainer=Begun.Utils.getElementsByClassName(outerContainer,'iframe','xhtml_banner')[0];
if(innerContainer){
var innerWindow=innerContainer.contentWindow,
innerDocument=innerWindow.document;
innerDocument.open();
innerDocument.write(this.responseText);
innerDocument.close();
var setClickHandler=(function(doc,url){
return function(){
if(doc.body){
Begun.Utils.addEvent(doc.body,'click',function(){
Begun.Utils.includeImage(url);
});
}else{
setTimeout(setClickHandler,100);
}
}
})(innerDocument,banner.url);

if(banner.mime=='application/x-iframe-html'){
var resizeIframe=(function(iframe){
var counter=0;
return function resize(){
var wnd=iframe.contentWindow,
doc=wnd.document,
bdy=doc.body,
html=doc.documentElement,
height,
width;
if(!bdy){
setTimeout(resize,100);
return;
}
if(counter<10){
height=Math.max(bdy.scrollHeight,bdy.offsetHeight,html.clientHeight,html.scrollHeight,html.offsetHeight);
width=Math.max(bdy.scrollWidth,bdy.offsetWidth,html.clientWidth,html.scrollWidth,html.offsetWidth);
iframe.style.height=height+"px";
iframe.style.width=width+"px";
iframe.style.display="block";
counter++;
setTimeout(resize,500);
}
}
})(innerContainer);

var oldHandler=innerWindow.onload;
if(innerDocument.readyState=='complete'){
resizeIframe();
}else{
innerWindow.onload=function(){
oldHandler&&oldHandler();
setTimeout(resizeIframe,100);
}
}
}
}
};

xhr.onerror=function(){
};

xhr.send();

})(block_id,graph_banner);
}else if(!Begun.Browser.Gecko){
inlineStyles='width:'+width+'px;height:'+height+'px;';
}
if(block_id==BLOCK_ID_FULLSCREEN||block_id==BLOCK_ID_TOP_MOBILE||window.begun_fullscreen){
inlineStyles+='max-width:none;';
}

var vars={
'url':graph_banner.url,
'source':src,
'width':width,
'height':height,
'styles':inlineStyles,
'impression_id':impression_id
};

if(_this.begun_click_wrap){
vars.url=_this.begun_click_wrap+vars.url;
}

var hasFlash=function(){
if(typeof window.navigator.plugins=="undefined"||window.navigator.plugins.length==0){
if(typeof window.ActiveXObject!="undefined"){
try{
var a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
return!!a;
}
catch(e){
return false;
}
}else{
return false;
}
}else{
return window.navigator.plugins["Shockwave Flash"]
}
};

if(type=='swf'){
if(!hasFlash()){
Begun.Utils.includeImage(_this.Strings.urls.no_flash);
type='img';
vars.source=vars.source+'&stub=1';
}else{
vars.url=encodeURIComponent(vars.url);
}
}

if(type=='html'){
vars.sandbox=hasFlash()?'':'sandbox="allow-scripts allow-forms allow-popups allow-same-origin"';
var ieMobile=/IEMobile\/(\d+\.?(\d+)?)/.exec(navigator.userAgent);
if(ieMobile){
vars.sandbox='';
}
}

block.banner_id=graph_banner.banner_id;

this.Banners.infoValues.setAll(
block_id,graph_banner
);

return new Begun.Template(
_this.Tpls.getHTML('search_banner_'+type)
).evaluate(vars);
};
this.initFilledBannersData=function(block){
if(block&&!block.filled_banners_data){
block.filled_banners_data={
text:0,
graph:0,
code:0
};
}
};

this.insertNonTextBlock=function(block){
if(_this.Blocks.checkType(block,'hyper')||_this.Blocks.checkType(block,'price_hyper')){
return;
}
this.initFilledBannersData(block);
arguments.callee.blocksHandled=arguments.callee.blocksHandled||[];
if(Begun.Utils.in_array(arguments.callee.blocksHandled,block)){
return;
}else{
arguments.callee.blocksHandled.push(block);
}

var feed=_this.getFeed();

if(feed&&!feed.code_patched){
if(feed.code&&feed.banners&&!feed.banners.code){
feed.banners.code=feed.code;
}
feed.code_patched=true;
}
var block_id=block.id;
var codes=this.getBannersByBlockId(block_id,'code');
var graphs=this.getBannersByBlockId(block_id,'graph');

if(codes){
var code,i,l=codes.length,codePlace,codeScript;

for(i=0;i<l;i++){
code=codes[i].js;

if(code){
codePlace=_this.Blocks.getDomObj(block_id);
codeScript=document.createElement('script');
codeScript.text=code;
codePlace.appendChild(codeScript);

block.filled_banners_data.code++;
block.nonTextBannersInserted=true;
}
}
}
var type=block&&block.options&&block.options.dimensions&&block.options.dimensions.type;
if(graphs){
for(i=0,l=graphs.length;i<l;i++){
if(graphs[i].loaded){
continue;
}

if(block.options.view_type&&((block.options.view_type.indexOf('Graph')!=-1)||(block.options.view_type.indexOf('Fullscreen')!=-1)||(block.options.view_type.indexOf('Filled')!=-1))){
var blockId=block.id;

if(!arguments.callee.top_mobile_inserted&&block_id==BLOCK_ID_TOP_MOBILE&&Begun.Browser.getUaType()!==UA_DESKTOP){
_this.prepareTopMobileBlock(block.id);
arguments.callee.top_mobile_inserted=true;
}

if(!arguments.callee.fullscreen_mobile_inserted&&(block_id==BLOCK_ID_FULLSCREEN||window.begun_fullscreen)&&Begun.Browser.getUaType()!==UA_DESKTOP){
_this.prepareFullScreenBlock(block.id);
arguments.callee.fullscreen_mobile_inserted=true;
var fullscreenWrapper=document.getElementById('begun_fullscreen_mobile_block_wrapper'),
fullscreenClicked=false;
document.getElementById('begun_close_fullscreen').onclick=function(){
fullscreenClicked=true;
fullscreenWrapper.style.display='none';
};
document.getElementById('begun_block_'+block_id).onclick=function(){
fullscreenClicked=true;
fullscreenWrapper.style.display='none';
};
}

var size=_this.getGraphDimensions(graphs[i]);

var logo_display=true;
if(block.options&&(typeof block.options.json!='undefined')&&(typeof block.options.json.logo!='undefined')){
logo_display=(Number(block.options.json.logo))?true:false;
}
if(feed&&feed.params&&feed.params.disable_logo){
logo_display=false;
}

var html=_this.getGraphHTML(graphs[i],function(){
if(window.begunJsBannerString){
var elem=_this.Blocks.getDomObj(block.id);
if(logo_display){
window.begunJsBannerString=_this.insertGraphLogo(window.begunJsBannerString,elem,size.width);
}
elem.innerHTML=window.begunJsBannerString;
}
},size.width,size.height,block_id);

block.filled_banners_data.graph++;
block.nonTextBannersInserted=true;
graphs[i].loaded=true;

var block_place=_this.Blocks.getDomObj(block_id);
if(html&&block_place){
if(logo_display){
html=_this.insertGraphLogo(html,block_place,type=='320x50'?320:size.width);
}
if(graphs[i].tracking){
Begun.Utils.includeImage(graphs[i].tracking);
}
block_place.innerHTML=html;
(function(context,url,isFullscreen){
var frameHovered=false,
frameEl=context.getElementsByTagName('iframe')[0];
if(frameEl){
if(frameEl.className&&frameEl.className.indexOf('xhtml_banner')!=-1)return;
Begun.Utils.addEvent(frameEl,'mouseenter',function(){
frameHovered=true;
if(window!=window.top){
window.focus&&window.focus();
}
});
Begun.Utils.addEvent(frameEl,'mouseleave',function(){
frameHovered=false;
if(window!=window.top){
window.blur&&window.blur();
}
});
Begun.Utils.addEvent(window,'blur',function(){
if(frameHovered||isFullscreen){
if(!fullscreenClicked){
fullscreenClicked=true;
Begun.Utils.includeImage(url);
}
if(isFullscreen){
window.setTimeout(function(){
var wrapper=document.getElementById('begun_fullscreen_mobile_block_wrapper');
if(wrapper){
fullscreenClicked=true;
wrapper.style.display='none';
}
},250);
}
}
});
}
})(block_place,graphs[i].url,(block_id==BLOCK_ID_FULLSCREEN||window.begun_fullscreen));
return;
}
}
}
}
if(!arguments.callee.top_mobile_inserted&&block_id==BLOCK_ID_TOP_MOBILE&&Begun.Browser.getUaType()!==UA_DESKTOP&&this.getBannersByBlockId(BLOCK_ID_TOP_MOBILE,'autocontext').length){
_this.prepareTopMobileBlock(block_id);
arguments.callee.top_mobile_inserted=true;
}
};

this.insertGraphLogo=function(html,block_place,width){
var graph_logo_html=(new Begun.Template(_this.Tpls.getHTML('graph_price_logo'))).evaluate({price_logo:_this.Strings.urls.price,price_logo_src:_this.Strings.urls.price_team_logo_src}),
htmlWithLogo=html+graph_logo_html;
if(block_place&&(block_place.id=='begun_block_'+BLOCK_ID_FULLSCREEN)||window.begun_fullscreen){
var mobileWrapper=document.getElementById('begun_fullscreen_mobile_block_wrapper');
if(mobileWrapper&&mobileWrapper.insertAdjacentHTML){
mobileWrapper.insertAdjacentHTML('afterbegin',graph_logo_html);
}
return html;
}
if(block_place&&block_place.id=='begun_block_2'&&width>window.innerWidth){
width=window.innerWidth;
}
if(html.indexOf('xhtml_banner')==-1)Begun.Utils.setStyle(block_place,'width',width+'px');
Begun.Utils.setStyle(block_place,'position','relative');
return htmlWithLogo;
};

this.getGraphDimensions=function(banner){
return{
width:banner.width,
height:banner.height
};
};

this.prepareTopMobileBlock=function(block_id){
try{
var vars={id:_this.Strings.css.block_prefix+block_id};
var block_wrapper=top.document.getElementById('begun_top_mobile_block_wrapper');
if(!block_wrapper){
var bo=top.document.getElementsByTagName('BODY');
block_wrapper=top.document.createElement('div');
block_wrapper.id='begun_top_mobile_block_wrapper';
bo[0].insertBefore(block_wrapper,bo[0].firstChild);
}
block_wrapper.innerHTML=(new Begun.Template(_this.Tpls.getHTML('blck_place'))).evaluate(vars);
}catch(e){}
};

this.prepareFullScreenBlock=function(block_id){
try{
var vars={id:_this.Strings.css.block_prefix+block_id};
vars.width=window.screen.width+'px';
vars.height=window.screen.height+'px';
vars.close_fullscreen=_this.Strings.urls.close_fullscreen;
var block_wrapper=top.document.getElementById('begun_fullscreen_mobile_block_wrapper');
if(!block_wrapper){
var bo=top.document.getElementsByTagName('BODY');
block_wrapper=top.document.createElement('div');
block_wrapper.id='begun_fullscreen_mobile_block_wrapper';
bo[0].insertBefore(block_wrapper,bo[0].firstChild);
}
block_wrapper.innerHTML=(new Begun.Template(_this.Tpls.getHTML('fullscreen_place'))).evaluate(vars);
}catch(e){}
};

this.loadFeedDone=(function(_this){
var extendVisualOptions=function(newVisualOptions){
Begun.extend(this.options.visual,newVisualOptions);
};

var loadToolbar=function(feed){
if(feed.debug&&feed.debug.request){
Module.baseLoad('toolbar.js');
_this.unhandledDebugs.push(feed.debug);
delete feed.debug;
_this.begunToolbarLoaded();
}
};

return function(){
var feed=window.begunAds;

if(!feed){
Begun.Error.send(
'Attempted to load an undefined feed.',
document.URL,-1
);
return null;
}

this.registerGraphBannerDomains(feed);

this.links_parsed=false;

this.Callbacks.dispatch('feed','load',this,[feed]);

var feedParams=feed.params||{},
isExtraBlock=false,
block,options,banner,i;

var replaceBlockTypeRich=function(options){
if(options.dimensions.type.toLowerCase()=='rich'){
options.dimensions.type='240x400';
if(typeof options.view_type=='string'&&options.view_type.length>0){
options.view_type+=',rich';
}else{
options.view_type='rich';
}
}
};

for(i=0;feed.blocks&&i<feed.blocks.length;i++){
block=feed.blocks[i];
options=block.options;

if(block){
if(block.id&&block.id==BLOCK_ID_TOP_MOBILE&&options&&options.dimensions){
options.dimensions.type='mediatext_mobile';
}

block.setVisualOptions=extendVisualOptions;

_this.initFilledBannersData(block);

if(
options&&
options.dimensions&&
options.dimensions.type
){
replaceBlockTypeRich(options);
ExtBlockTypes.load("begun_tpl_block_"+options.dimensions.type);
}

if(this.isFakeBlockId(block.id)&&window.begun_block_id==block.id){
block.id=this.lastBlockId;
isExtraBlock=true;
}
}
}

if(isExtraBlock){
for(var bannersType in feed.banners){
for(i=0;i<feed.banners[bannersType].length;i++){
banner=feed.banners[bannersType][i];
if(banner.block_id==window.begun_block_id){
banner.block_id=this.lastBlockId;
}
}
}
window.begun_block_id=this.lastBlockId;
}

if(
window.begun_extra_block&&
window.begun_extra_block.options&&
window.begun_extra_block.options.dimensions&&
window.begun_extra_block.options.dimensions.type
){
replaceBlockTypeRich(window.begun_extra_block.options);
ExtBlockTypes.load("begun_tpl_block_"+window.begun_extra_block.options.dimensions.type);
}

if(typeof Begun.Browser!='undefined'){
Begun.Browser.getUaType=function(){
return feedParams.is_mobile||0;
};
}

if(feed.banners&&feed.banners.charge){
var chargeUrl=feed.banners.charge.url;
if(chargeUrl){
Begun.Utils.includeImage(chargeUrl);
}
}


loadToolbar(feed);


this.setFeed(feed);

Begun.extend(_this.responseParams,_this.getFeed()&&_this.getFeed().params||{});
_this.getLoadingStrategy().parseFeed();

var visualOptions,j;

block=_this.Blocks.getBlockById(BLOCK_ID_TOP_MOBILE);
if(block){
for(j=0;j<_this.getBlocks().length;j++){
if(BLOCK_ID_TOP_MOBILE!==_this.getBlocks()[j].id){
visualOptions={};
Begun.extend(visualOptions,_this.getBlocks()[j].options.visual,true);
Begun.extend(visualOptions,block.options.visual,true);
block.options.visual=visualOptions;
if(block.options.visual.block&&block.options.visual.block.backgroundColor&&block.options.visual.block.backgroundColor.toLowerCase()=='transparent'){
block.options.visual.block.backgroundColor='#FFF';
if(!block.options.visual.block_hover){
block.options.visual.block_hover={};
}
if(!block.options.visual.title){
block.options.visual.title={};
}
block.options.visual.block_hover.backgroundColor='#FFF';
block.options.visual.title.color='#0066DF';
}
break;
}
}
_this.insertNonTextBlock(block);
}

_this.draw();
};
}(this));
this.printBlockPlace=function(block_id){
var vars={id:_this.Strings.css.block_prefix+block_id};
var tmpl=_this.Tpls.getHTML('blck_place');

if(document.body){
document.write((new Begun.Template(tmpl)).evaluate(vars));
}else{
document.write("<body>"+(new Begun.Template(tmpl)).evaluate(vars)+"</body>");
}
};
this.printDefaultStyle=function(){
Begun.Utils.includeStyle(_this.Tpls.getCSS('default'),'write');
};
var getBGColor=function(block){
var bgcolor=Begun.Utils.getStyle(block,'background-color');
while(bgcolor=='transparent'){
if(block.nodeName=='BODY'){
var body_bg=Begun.Utils.getStyle(block,'background-color');
if(body_bg=='transparent'){
bgcolor='#FFFFFF';
}else{
bgcolor=Begun.Utils.getStyle(block,'background-color');
}
break;
}
block=block.parentNode;
bgcolor=Begun.Utils.getStyle(block,'background-color');
}
return bgcolor;
};
this.getLogoColor=function(styles,block_id){
var default_logo_color=_this.Strings.css.logo_color,bgColor,
alternativeColor="#ffffff";

var toNumbers=function(str){
var ret=[];
str.replace(/(..)/g,function(str){
ret.push(parseInt(str,16));
});
return ret;
};

var areColorsTooClose=function(c1,c2,delta){
for(var i=0;i<arguments.length;i++){
if(0==arguments[i].indexOf('#')){
arguments[i]=toNumbers(arguments[i].slice(1));
}else{
return false;
}
}
delta=delta||160;
return(Math.sqrt((c1[0]-c2[0])*(c1[0]-c2[0])+(c1[1]-c2[1])*(c1[1]-c2[1])+(c1[2]-c2[2])*(c1[2]-c2[2]))<delta);
};

if(styles.block){
bgColor=styles.block.backgroundColor||getBGColor(_this.Blocks.getDomObj(block_id));
if(areColorsTooClose(bgColor,default_logo_color)){
return alternativeColor;
}
}
return default_logo_color;
};
var prepareColorStyles=function(styles){
var checkColorDef=function(obj,prop){
if(obj!==null&&typeof obj!=="undefined"){
if(obj[prop]===""){
obj[prop]="transparent";
}
}
};

var checkBgColor=function(obj){
checkColorDef(obj,"backgroundColor");
};

var checkBorderColor=function(obj){
checkColorDef(obj,"borderColor");
};

var mkTransparentBordersForIE=function(obj){
if(obj!==null&&typeof obj!=="undefined"){
obj.filter="font-family:inherit;";
if(Begun.Browser.IE&&Begun.Browser.less(7)&&obj.borderColor&&(obj.borderColor.toLowerCase()=='transparent'||obj.borderColor=='')){
obj.borderColor="white";
obj.filter="filter:chroma(color=white);";
obj.transparentBorders='transparentBorders';
}
}
};

checkBgColor(styles.block_hover);
checkBorderColor(styles.block_hover);

checkBgColor(styles.block);
checkBorderColor(styles.block);

mkTransparentBordersForIE(styles.block);
mkTransparentBordersForIE(styles.block_hover);
};
this.printBlockStyle=function(block_id,styles,pad){
styles=styles||{};
var vars={};
var block=_this.Blocks.getBlockById(block_id,false,pad.pad_id),
block_type=block.options.dimensions.type.toLowerCase();
vars.block_id=block_id||-1;
vars.block_logo_color=this.getLogoColor(styles,block_id);
vars.backgroundImg=_this.Strings.urls.mediatext_price_background+block_type.replace('mediatext_','').replace('price_','')+'_'+(Math.floor(Math.random()*7)+1)+'.png';

prepareColorStyles(styles);
for(var key in styles){
if(styles[key]&&styles.hasOwnProperty&&styles.hasOwnProperty(key)){
for(var key2 in styles[key]){
if(styles[key][key2]&&styles[key].hasOwnProperty&&styles[key].hasOwnProperty(key2)){
vars[key+':'+key2]=typeof styles[key][key2]=='number'?styles[key][key2]+'px':styles[key][key2];
}
}
}
}
var css_text=(new Begun.Template(_this.Tpls.getCSS('block'))).evaluate(vars);
css_text+=(new Begun.Template(_this.Tpls.getCSS('block_'+block.options.dimensions.type.toLowerCase()))).evaluate(vars);

if(block_id==BLOCK_ID_TOP_MOBILE){
Begun.Utils.includeStyle(css_text,'append','begun-block-css-'+block_id,top);
}else{
Begun.Utils.includeStyle(css_text,'append','begun-block-css-'+block_id);
}

if(styles.name){
if(styles.mediatext){
Begun.Utils.includeStyle((new Begun.Template(_this.Tpls.getCSS('backgroundImg'))).evaluate(vars),'append','begun-block-background-'+block_id);
}
Begun.Utils.includeCSSFile(_this.Strings.urls.styles+'name='+styles.name+'&block_id='+block_id,'begun-additional-'+block_id);
}
};
this.isFeedStarted=function(){
return!!_this.getPad().feed_started;
};
this.setFeedStarted=function(){
_this.getPad().feed_started=true;
};
this.getBannerIndex=function(pad_id,section,banner_id){
if(!banner_id){
return _this.getPad(pad_id).banner_index;
}else{
section=section||'autocontext';
var banner_index=0;
var banner;
while(banner=_this.getBanner(section,banner_index,pad_id)){
if(banner.banner_id==banner_id){
return banner_index;
}
banner_index++;
}
}
};
this.setBannerIndex=function(index,pad_id){
_this.getPad(pad_id).banner_index=index;
};
this.incBannerIndex=function(pad_id){
_this.setBannerIndex(_this.getBannerIndex(pad_id)+1,pad_id);
};
this.resetBannerIndex=function(pad_id){
_this.setBannerIndex(0,pad_id);
};
this.registerGraphBannerDomains=function(feed){
var graphBanners=feed&&feed.banners&&feed.banners.graph;
if(graphBanners){
for(var i=0;i<graphBanners.length;i++){
if(graphBanners[i].domain){
_this.graphBannerDomains.push(graphBanners[i].domain);
}
}
}
};
this.getGraphBannerDomains=function(){
return _this.graphBannerDomains.join(',');
};
this.getPad=function(pad_id){
return _this.Pads.getPad(pad_id||window.begun_auto_pad);
};

this.getFeed=function(pad_id){
var pad=_this.getPad(pad_id);
if(pad){
return pad.feed;
}
};

this.setFeed=function(feed,pad_id){
this.getPad(pad_id).feed=feed;
};

this.getBlock=function(index,pad){
if(typeof pad==="undefined"){
pad=_this.getPad();
}
var padBlocks=pad.blocks;
if(padBlocks.length>index){
return padBlocks[index];
}else{
return null;
}
};
this.getBlocks=function(pad_id){
var blocks=[];
if(pad_id){
blocks=_this.getPad(pad_id).blocks;
}else{
var pads=_this.Pads.getPads();
for(var i=0,l=pads.length;i<l;i++){
for(var j=0,n=pads[i].blocks.length;j<n;j++){
blocks.push(pads[i].blocks[j]);
}
}
}
return blocks;
};
this.getBanner=function(type,index,pad_id){
if(!_this.getFeed(pad_id)||typeof _this.getFeed(pad_id).banners==="undefined"||
typeof _this.getFeed(pad_id).banners[type]==="undefined"||
typeof _this.getFeed(pad_id).banners[type][index]!=="object"){
return null;
}
var banner=_this.getFeed(pad_id).banners[type][index];
banner.setImages=function(newImages){
if(typeof this.images==="undefined"){
this.images={};
}
Begun.extend(this.images,newImages);
};
return banner;
};
this.getBanners=function(pad_id){
var feed=_this.getFeed(pad_id);
return feed&&feed.banners;
};
this.getBannersByBlockId=function(block_id,type,pad_id){
var i=0;
var obj=[];
var banner=null;
while(banner=_this.getBanner(type,i,pad_id)){
if(banner.block_id==block_id){
obj[obj.length]=banner;
}
i++;
}
return obj;
};
this.getBannersByViewType=function(block_id,type,view_type){
var i=0;
var obj=[];
var banner=null;
while(banner=_this.getBanner(type,i)){
if(banner.view_type.toLowerCase()==view_type.toLowerCase()){
obj[obj.length]=banner;
}
i++;
}
return obj;
};
this.getRichPictureSrc=function(banner){
var banner_id=banner.banner_id+'',
src=_this.responseParams['thumbs_src']?'//'+_this.responseParams['thumbs_src']+'/':_this.Strings.urls.thumbs,
src_s,
src_b;
if(banner_id&&banner_id.length>3){
src+='rich/';
src+=banner_id.charAt(banner_id.length-2);
src+='/'+banner_id.charAt(banner_id.length-1);
src+='/'+banner_id;
src_s=src+'s';
src_b=src+'b';
}else{
src_s=_this.Strings.urls.blank;
src_b=src_s;
}
if(banner.images&&banner.images.richpreview){
src_s=banner.images.richpreview;
}
if(banner.images&&banner.images.rich){
src_b=banner.images.rich;
}
return{
small:src_s,
big:src_b
};
};
this.getThumbSrc=function(banner){
return banner.images&&banner.images.thematic;
};
this.getFaviconSrc=function(banner){
return banner.images&&banner.images.favicon;
};
this.getBannerContacts=function(banner,block,fullDomain,pad_id,section,banner_id){
return this.getBannerDomainGeoHTML(banner,block,['domain','geo'],fullDomain);
};

this.getBannerDomainGeoHTML=function(banner,block,banner_contacts_names,fullDomain){
var banner_contacts=[],
i=0,
banner_contacts_name,
vars={};
while(banner_contacts_name=banner_contacts_names[i]){
vars[banner_contacts_name]=banner[banner_contacts_name];
vars.url=banner.url;
if(_this.begun_click_wrap){
vars.url=_this.begun_click_wrap+vars.url;
}
vars.fullDomain=fullDomain;
if(banner_contacts_name==='domain'&&banner.bottom&&banner.bottom.length){
vars.domain=banner.bottom;
}
if(vars[banner_contacts_name]){
banner_contacts.push((new Begun.Template(_this.Tpls.getHTML('bnnr_'+banner_contacts_name))).evaluate(vars));
}
i++;
}
return banner_contacts;
};
this.clickBanner=function(click_event,orig_elem){
click_event=click_event||window.event;
if(click_event.done){
return;
}
var curr_elem=click_event.target||click_event.srcElement;
var isInsideTag=function(child_elem,parent_tag){
var child_elem_parent=child_elem;
do{
if(child_elem_parent.tagName&&child_elem_parent.tagName.toUpperCase()==parent_tag.toUpperCase()){
return true;
}
}while(child_elem_parent=child_elem_parent.parentNode);
return false;
};

if(curr_elem.tagName.toUpperCase()=='A'||isInsideTag(curr_elem,'A')){
click_event.done=true;
_this.Callbacks.dispatch('banner','click',curr_elem);
_this.clickHandler(orig_elem).apply(_this);
}else if(orig_elem.getAttribute('_url')){
var anyLink=curr_elem.getElementsByTagName("a")[0];
if(anyLink&&typeof anyLink.click!=="undefined"){
if(typeof click_event.preventDefault!=="undefined"){
click_event.preventDefault();
}else{
click_event.returnValue=false;
}
if(typeof click_event.stopPropagation!=="undefined"){
click_event.stopPropagation();
}else{
click_event.cancelBubble=true;
}
anyLink.click();
}else{
_this.Callbacks.dispatch('banner','click',curr_elem);
_this.clickHandler(orig_elem).apply(_this);
window.open(orig_elem.getAttribute('_url'));
}
}
};

this.getBannerHTML=function(banner,block,block_banner_count){

if(!banner){
return'';
}

if(banner.domain){
banner.domain=Begun.Utils.punycode.toUnicode(banner.domain);
banner.domain=banner.domain.replace(/[<]wbr[>]/ig,'');
banner.fullDomain=banner.domain;
banner.domain=Begun.Utils.unescapeTruncateDomain(banner.domain);
}else{
banner.fullDomain=banner.domain='';
}
banner.domain=banner.domain.replace(/\./g,'.<wbr>');
banner.title=banner.title.replace(/\,/g,',<wbr>');
banner.title=banner.title.replace(/-<(i|b)>/g,'-<wbr><$1>');
var banner_contacts=_this.getBannerContacts(banner,block,banner.fullDomain);
var vars={};
Begun.extend(vars,banner);
vars.url=banner.url;
if(_this.begun_click_wrap){
vars.url=_this.begun_click_wrap+vars.url;
}
vars.onclick=_this.Strings.js.banner_onclick;
vars.block_id=block.id;
vars.banner_id=banner.banner_id;
vars.id=block_banner_count||0;
vars.descr=vars.descr.replace(/(\,|\.|\?|\!|\:)(\S\D)/g,'$1 $2');
vars.descr=vars.descr.replace(/-<(i|b)>/g,'-<wbr><$1>');
vars.banner_width=Math.round(100/Number(_this.getBannersByBlockId(block.id,'autocontext')))+'%';
vars.price_fixture_logo_new=_this.Strings.urls.price_fixture_logo_new_src;
vars.basket_src=_this.Strings.urls.basket_src;
block.options.visual=block.options.visual||{};

if(banner.constraints){
var parsedWarning=_this.warningModule.parseWarning(banner.constraints);
if(parsedWarning){
vars.bnnr_warn=(new Begun.Template(_this.Tpls.getHTML('bnnr_warn'))).evaluate({
type:parsedWarning.type,
text:parsedWarning.text
});
}else{
vars.bnnr_warn='';
}
}else{
vars.bnnr_warn='';
}
if(_this.Blocks.checkType(block,'square')&&block.options.json&&block.options.json.col){
vars.banner_width=Math.round(100/Number(block.options.json.col))+'%';
}

var is_use_rich='';

vars.favicon='';
vars.thumb='';
vars.picture='';

if(
_this.checkBannerViewType(banner,'rich')||
_this.checkBannerViewType(banner,'pseudorich')||
_this.checkBannerViewType(banner,'offerrich')||
_this.checkBannerViewType(banner,'offerrichindirect')||
_this.isRichExpanded(block)
){
var pictures=_this.getRichPictureSrc(banner);
vars.pictureSrc=pictures.big;
vars.picture=(new Begun.Template(_this.Tpls.getHTML('bnnr_picture'))).evaluate({src:pictures.big,url:vars.url});

is_use_rich='_rich';
if(_this.isRichExpanded(block)){
is_use_rich+='_exp';
}else if(_this.isRichMini(block)){
is_use_rich+='_mini';
}
}else if(_this.checkBannerViewType(banner,'offer')){
is_use_rich='_offer';
pictures=_this.getRichPictureSrc(banner);
vars.pictureSrc=pictures.big||_this.Strings.urls.price_fixture_logo_new_src;
vars.picture=(new Begun.Template(_this.Tpls.getHTML('bnnr_picture'))).evaluate({src:vars.pictureSrc,url:vars.url});
}else if(Number(block.options.show_favicons)){
vars.favicon=(new Begun.Template(_this.Tpls.getHTML('bnnr_favicon'))).evaluate({src:_this.getFaviconSrc(banner)});
}else{
vars.thumb=Number(block.options.show_thumbnails)?(new Begun.Template(_this.Tpls.getHTML('bnnr_thumb'))).evaluate({
url:vars.url,
src:_this.getThumbSrc(banner)
}):'';
vars.picture=vars.thumb;
}

if(_this.isRichMini(block)){
vars.contact='';
}else{
vars.contact=banner_contacts.join(_this.Tpls.getHTML('bnnr_glue'));
}

if(banner.view_type.toLowerCase().indexOf('offer')>-1&&banner.bottom){
var parsedPrice=banner.bottom.split('|');
vars.contact=(new Begun.Template(_this.Tpls.getHTML('bnnr_domain'))).evaluate(vars);
vars.price=parsedPrice[0];
vars.shop_name=parsedPrice[1];
vars.offers_link=banner.card||'';
vars.bottom=parsedPrice[0];
}

var bannerType='banner_'+
block.options.dimensions.type.toLowerCase()+
is_use_rich;

if(bannerType.indexOf('mediatext_price')!=-1){
vars.domain=vars.domain.replace(/[<]wbr[>]/ig,'');
vars.domain=vars.domain.replace(/^www\./ig,'');
}

if(bannerType=='banner_eda_offer'||bannerType=='banner_eda'||bannerType=='banner_eda_rich'){
vars.bottom=vars.bottom||'';
vars.bottom=vars.bottom.replace(/\u0440./,'');
vars.bottom=vars.bottom.replace(/&#x440;./,'');
}

if(block.options.dimensions.type.toLowerCase()=='horizontal'){
bannerType='banner_horizontal';
}
return(new Begun.Template(
_this.Tpls.getHTML(bannerType)
)).evaluate(vars);
};

this.checkBannerViewType=function(banner,viewtype){
return Begun.Utils.inList(banner.view_type,viewtype);
};

this.addBannerViewType=function(banner,viewtype){
if(!this.checkBannerViewType(banner,viewtype)){
banner.view_type+=(banner.view_type?',':'')+viewtype;
}
};
this.removeBannerViewType=function(banner,viewtype){
if(this.checkBannerViewType(banner,viewtype)){
var reg=new RegExp('(,?\\s?|^)'+viewtype+'(,?\\s?|$)');
banner.view_type=banner.view_type.replace(reg,',');
}
};

this.bannersContainViewType=function(view_type,pad_id,section,block_id){
if(null==section){
section='autocontext';
}

var banners;

if(null==block_id){
banners=this.getBanners(pad_id);

if(banners){
banners=banners[section];
}
}else{
banners=this.getBannersByBlockId(block_id,section,pad_id);
}

return Begun.Utils.in_array(
banners,
function(item){
return this.checkBannerViewType(item,view_type);
},
this
);
};

this.getTableWithAds=function(blockId){
var getSingleTable=function(id){
var element=_this.Blocks.getDomObj(id);
if(!element){
return undefined;
}
var tables=element.getElementsByTagName("table");
for(var i=0;i<tables.length;i++){
if(tables[i].className&&tables[i].className.indexOf("begun_adv_table")>-1){
return tables[i];
}
}
return undefined;
};
switch(typeof blockId){
case"number":
case"string":
return getSingleTable(blockId);
default:
var blocks=_this.getBlocks();
var res=[];
for(var i=0;i<blocks.length;i++){
var tbl=getSingleTable(blocks[i].id);
if(tbl){
res.push(tbl);
}
}
return(res.length>0?res:undefined);
}
};

this.updateUrlParamInTd=(function(){
var updateParamInLink=function(td,link,param,value){
var hrefText=link.getAttribute('href');

if(hrefText.indexOf('http://')==-1&&hrefText.indexOf('https://')==-1&&hrefText.indexOf('//')!=0){
return false;
}

var newHref='';

if(hrefText.indexOf('?')===-1){
hrefText=hrefText+'?addingParams';
}

if(hrefText.indexOf('&'+param+'=')===-1){
newHref=hrefText+'&'+param+'='+value;
}else{
var firstPosition=hrefText.indexOf('&'+param+'=')+param.length+1,
lastPosition=hrefText.indexOf('&',firstPosition+1);

if(lastPosition===-1){
newHref=hrefText.substring(0,firstPosition+1)+value;
}else{
newHref=hrefText.substring(0,firstPosition+1)+value+hrefText.slice(lastPosition);
}
}


var linkText=firstText(link);

if(null==linkText){
linkText='';
}

link.setAttribute('href',newHref);


firstText(link,linkText);

return newHref;
};

var firstText=function(el,txt){
var fc=el.firstChild;


if(fc&&3===fc.nodeType){
if(null==txt){
return fc.nodeValue;
}else{
fc.nodeValue=txt;
}
}
};

return function(td,param,value){
var linksInTd=td.getElementsByTagName('a'),
href;
for(var i=0,len=linksInTd.length;i<len;i++){
href=updateParamInLink(td,linksInTd[i],param,value);
if(0===i){
td.setAttribute('_url',href);
}
}
};
}());

this.getBlockHTML=function(banners_html_arr,block,pad){
if(!banners_html_arr){
return'';
}
var banners_html=banners_html_arr.join('');
var logo_display='';
if(block.options&&(typeof block.options.json!='undefined')&&(typeof block.options.json.logo!='undefined')){
logo_display=(Number(block.options.json.logo))?'':'none';
}
var extended_block_class='';
if(logo_display=='none'){
extended_block_class='begun_extended_block';
}

var rich_nopics_class='';

var getMobileClass=function(){
var cls='',
ua=Begun.Browser.getUaType();

if(ua===UA_CLASSIC_MOBILE||Begun.Browser.TabletPC||ua===UA_RICH_MOBILE){
cls=_this.Strings.css.mobile_classic;
}
return cls;
};

if((_this.Blocks.checkViewType(block,'rich')||_this.Blocks.checkViewType(block,'pseudorich'))&&block.options.show_favicons!=1){
var elem=_this.Blocks.getDomObj(block.id);
if(elem){
Begun.Utils.addClassName(elem,'begun_auto_rich');

if(_this.isRichMini(block)){
Begun.Utils.addClassName(elem,'begun_rich_mini');
}
}
if(!_this.bannersContainViewType('rich',pad.pad_id,null,block.id)&&!_this.bannersContainViewType('pseudorich',pad.pad_id,null,block.id)){
rich_nopics_class=' begun_rich_nopics';
}
}

var vars={};
var block_hover_html='';
var block_opts=block.options.visual||{};
if(block_opts.block&&block_opts.block_hover&&block_opts.block_hover.backgroundColor&&block_opts.block_hover.borderColor){
vars.bgcolor_over=block_opts.block_hover.backgroundColor;
vars.brdcolor_over=block_opts.block_hover.borderColor;
vars.bgcolor_out=block_opts.block.backgroundColor||'transparent';
vars.brdcolor_out=block_opts.block.borderColor||'transparent';
vars.block_id=block.id;
block_hover_html=(new Begun.Template(_this.Tpls.getHTML('blck_hover'))).evaluate(vars);
}
var pad_id=pad.pad_id;

vars={
block_id:block.id,
block_hover:block_hover_html,
banners:banners_html,
begun_warning:banners_html.indexOf('begun_warn_message')!=-1?'begun_warning':'',
banners_count:banners_html_arr.length,
block_width:Number(block.options.dimensions.width)?Number(block.options.dimensions.width)+'px':'',
begun_url:_this.Strings.urls.price,
price_url:_this.Strings.urls.price,
css_thumbnails:(Number(block.options.show_thumbnails)&&!Number(block.options.show_favicons)&&!getMobileClass()?_this.Strings.css.thumb:'')+rich_nopics_class,
css_mobile_class:getMobileClass(),
logo_display:logo_display,
extended_block_class:extended_block_class,
transparent_borders_class:(block_opts&&((block_opts.block&&block_opts.block.transparentBorders)||(block_opts.block_hover&&block_opts.block_hover.transparentBorders)))?'transparentBorders':'',
fix_layout:(Begun.Browser.IE&&Begun.Browser.version()<8&&document.compatMode&&document.compatMode=="CSS1Compat"&&_this.Blocks.isBlockFixed(block))?_this.Strings.css.fix_layout:'',
begun_logo:(new Begun.Template(_this.Tpls.getHTML('begun_logo'))).evaluate({
src:this.Strings.urls.price_team_logo_src
}),
price_logo:(new Begun.Template(_this.Tpls.getHTML('price_logo'))).evaluate({
src:this.Strings.urls.price_logo_src
}),
price_search_logo:(new Begun.Template(_this.Tpls.getHTML('price_search_logo'))).evaluate({
src:this.Strings.urls.price_search_logo_src
}),
begun_new_logo:(new Begun.Template(_this.Tpls.getHTML('price_search_logo'))).evaluate({
src:this.Strings.urls.begun_new_logo_src
}),
price_new_logo:(new Begun.Template(_this.Tpls.getHTML('price_search_logo'))).evaluate({
src:this.Strings.urls.price_new_logo_src
}),
begun_graph_logo:(new Begun.Template(_this.Tpls.getHTML('graph_begun_logo'))).evaluate({
price_logo:this.Strings.urls.price,price_logo_src:_this.Strings.urls.price_team_logo_src
}),
price_team_logo:(new Begun.Template(_this.Tpls.getHTML('price_search_logo'))).evaluate({
src:this.Strings.urls.price_team_logo_src
}),
price_team_logo_small:(new Begun.Template(_this.Tpls.getHTML('price_search_logo'))).evaluate({
src:this.Strings.urls.price_team_logo_small_src
})
};
var block_type=block.options.dimensions.type.toLowerCase();

if(block_type=='price_grid'){

var decodeEntities=(function(){

var element=document.createElement('div');

function decodeHTMLEntities(str){
if(str&&typeof str==='string'){

str=str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi,'');
str=str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi,'');
element.innerHTML=str;
str=element.textContent;
element.textContent='';
}

return str;
}

return decodeHTMLEntities;
})();

var titleMap={},banner,j=0,key,
rowCount=0,rowLimit=6,colLimit=3;
while(banner=_this.getBanner('autocontext',j++)){
titleMap[banner.words]=titleMap[banner.words]||[];
banner.bottom=banner.bottom.split('|')[0];
banner.final_price=banner.bottom.replace(/&#x440;./,'').replace(' ','');
titleMap[banner.words].push(banner);
}
var titleHTML='';

for(key in titleMap){
rowCount++;
if(rowCount>rowLimit)break;
if(titleMap.hasOwnProperty(key)){
if(titleMap[key].length>1){
titleMap[key].sort(function(a,b){
return a.final_price-b.final_price;
});
}
var offerHTML='';
for(j=0;j<colLimit;j++){
offerHTML+=(new Begun.Template(_this.Tpls.getHTML(titleMap[key][j]?
'banner_price_grid_offer_item':'banner_price_grid_offer_fixture')))
.evaluate(titleMap[key][j]||{encoded_title:encodeURIComponent(decodeEntities(key))});
}
titleHTML+=(new Begun.Template(_this.Tpls.getHTML('banner_price_grid_offer_row'))).evaluate({banners:offerHTML,title:key});
}
}
vars.banners=titleHTML;
}

var tmpl=_this.Tpls.getHTML('block_'+block_type);
return(new Begun.Template(tmpl)).evaluate(vars);
};

this.clickHandler=function(targetTd){
return function(){
var nowTime=(new Date).valueOf();
this.updateUrlParamInTd(targetTd,"click_time",nowTime);
this.updateUrlParamInTd(targetTd,"frame_level",_this.requestParams.frm_level);
};
};
this.printBlock=function(banners_html,block,pad){
if(banners_html.length){
var regEvents=function(){
var mouseOverHandler=function(targetTd){
return function(e){
if(!e){
e=window.event;
}
var relTarget=e.relatedTarget||e.fromElement;
if(relTarget===targetTd){
return;
}
var tdElements=targetTd.getElementsByTagName("*");
for(var i=0;i<tdElements.length;i++){
if(tdElements[i]===relTarget){
return;
}
}
if(!arguments.callee.count){
arguments.callee.count=1;
}
var nowTime=(new Date).valueOf();
_this.updateUrlParamInTd(targetTd,"mouseover_time",nowTime);
_this.updateUrlParamInTd(targetTd,"mouseover_count",arguments.callee.count++);
};
};
var mouseDownHandler=function(targetTd){
return function(){
var nowTime=(new Date).valueOf();
_this.updateUrlParamInTd(targetTd,"mousedown_time",nowTime);
};
};
var table=_this.getTableWithAds(block.id);
if(table){
var tds=table.getElementsByTagName("td");
var showTime=(new Date).valueOf();
for(var i=0;i<tds.length;i++){
_this.updateUrlParamInTd(tds[i],"show_time",showTime);
Begun.Utils.addEvent(tds[i],"mouseover",mouseOverHandler(tds[i]));
Begun.Utils.addEvent(tds[i],"mousedown",mouseDownHandler(tds[i]));
}
}else{
var newLayoutBannersContainer=Begun.Utils.getElementsByClassName(_this.Blocks.getDomObj(block.id),'div','begun_adv_new_layout')[0];
if(newLayoutBannersContainer){
var cells=Begun.Utils.getElementsByClassName(newLayoutBannersContainer,'div','begun_adv_cell');
showTime=(new Date).valueOf();
for(i=0;i<cells.length;i++){
_this.updateUrlParamInTd(cells[i],"show_time",showTime);
Begun.Utils.addEvent(cells[i],"mouseover",mouseOverHandler(cells[i]));
Begun.Utils.addEvent(cells[i],"mousedown",mouseDownHandler(cells[i]));
}
}
}
};
var elem=_this.Blocks.getDomObj(block.id);


if(!elem){
return false;
}
this.setExtraBlockResponseParams(block);
_this.dom_change=true;
var html=_this.getBlockHTML(banners_html,block,pad),
show,showDefault;

show=showDefault=function(elem,html){
elem.innerHTML=html;
_this.dom_change=false;
regEvents();
};


if(Begun.Browser.IE){
show=function(elem,html){
var n=elem.cloneNode(true);
n.innerHTML=html;
elem.parentNode.insertBefore(n,elem);
elem.parentNode.removeChild(elem);
_this.dom_change=false;
regEvents();
};
var appendTableCell=function(tr,elem){
if(tr.offsetHeight){
var td=document.createElement('td');
tr.appendChild(td);
td.innerHTML=elem.outerHTML;
show(td.firstChild,html);
elem.parentNode.removeChild(elem);
}else{
var func=arguments.callee;
window.setTimeout(function(){
func(tr,elem);
},Begun.DOM_TIMEOUT);
}
};
var parent=null;
if((parent=elem.parentNode)&&(parent.tagName)&&(Begun.Utils.in_array(['ol','ul','li'],parent.tagName.toLowerCase()))){
window.setTimeout(function(){
var parent2=parent.parentNode;
parent2.insertBefore(elem,parent);
showDefault(elem,html);
},Begun.DOM_TIMEOUT);
}else if((parent)&&(parent=elem.parentNode.parentNode)&&(parent.tagName)){
try{
show(elem,html);
}catch(e){
switch(parent.tagName.toLowerCase()){
case'table':
var tr=document.createElement('tr');
window.setTimeout(function(){
parent.lastChild.appendChild(tr);
appendTableCell(tr,elem);
},Begun.DOM_TIMEOUT);
break;
case'tr':
window.setTimeout(function(){
appendTableCell(parent,elem);
},Begun.DOM_TIMEOUT);
break;
case'thead':
case'tbody':
case'tfoot':
var tr=document.createElement('tr');
window.setTimeout(function(){
parent.appendChild(tr);
appendTableCell(tr,elem);
},Begun.DOM_TIMEOUT);
break;
default:
_this.dom_change=false;
}
}
}else{
try{
show(elem,html);
}catch(e){
_this.dom_change=false;
}
}
}else{
show(elem,html);
}
return true;
}else{
return false;
}
};
this.hideBlock=function(block_id){
var elem=_this.Blocks.getDomObj(block_id);
if(elem){
elem.className='';
elem.innerHTML='';
}
};
this.dispatchBlockDrawCallback=function(block){
if(block&&!block.drawCallbackDispatched){
_this.Callbacks.dispatch('block','draw',_this,[block]);
block.drawCallbackDispatched=true;
this.Monitor.prepare()&&this.Monitor.count();
}
};

this.fillBlocks=(function(_this){
var repeat=function(fn){
Begun.Utils.repeat(fn,Begun.DOM_TIMEOUT);
};

var initHypercontext=function(block,pad_id){
repeat(function(){
if(!_this.dom_change&&Begun.Hypercontext){
_this.initHypercontextBlock(block,pad_id);
return true;
}
});
};

var initPhotocontext=function(block,pad_id){
repeat(function fn(){
if(!_this.dom_change&&Begun.Photocontext){
_this.initPhotocontextBlock(block,pad_id);
return true;
}
});
};

var isValidSquareBlock=function(block){
return(
_this.Blocks.checkType(block,'square')&&
block.options.json&&
block.options.json.row&&
block.options.json.col
);
};

var addHTML=function(block,banner,banners_html,block_banner_count){
banner&&_this.Banners.infoValues.setAll(
banner.block_id,banner
);

var banner_html=_this.getBannerHTML(
banner,block,(block_banner_count+1)
);

if(isValidSquareBlock(block)){
if(!(block_banner_count%block.options.json.col)){
banner_html='<tr>'+banner_html;
}

if(!((block_banner_count+1)%block.options.json.col)){
banner_html+='</tr>';
}
}

if(banner_html){

if(banner.tracking){
Begun.Utils.includeImage(banner.tracking);
}

banners_html.push(banner_html);

block.filled_banners_data.text++;

_this.Callbacks.dispatch(
'banner','draw',_this,[banner]
);
}
};

var fillBlocks=function(){
var pad=this.getPad(),
pad_id=pad.pad_id,
block_index=0,
out_of_banners=false,
block;

var includeRamblerCounter=function(block){
if(!block){return false;}

var type=_this.Blocks.getBlockType(block),
typesForInclude=[
'vertical',
'240x400'
];

for(var i=0,lengthTypes=typesForInclude.length;i<lengthTypes;i+=1){
if(type===typesForInclude[i]){
(new Image).src="//counter.rambler.ru/top100.scn?2761206&le=1&rn="+(+new Date)+"&rf="+encodeURIComponent(document.referrer);
return true;
}
}

};

if(!fillBlocks.blocksHandled){
fillBlocks.blocksHandled=[];
}

while(!out_of_banners&&(block=this.getBlock(block_index,pad))){

if(!this.Blocks.getDomObj(block.id)){
block_index++;

continue;
}

if(!Begun.Utils.in_array(fillBlocks.blocksHandled,block)){
this.Callbacks.dispatch(
'block','predraw',this,[block]
);

if(block.options&&block.options.visual){
this.printBlockStyle(block.id,block.options.visual,pad);
}

fillBlocks.blocksHandled.push(block);
}

if(block.loaded){
block_index++;

continue;
}else if(block.nonTextBannersInserted){
this.dispatchBlockDrawCallback(block);
block_index++;

continue;
}else if(this.Blocks.checkType(block,'hyper')||this.Blocks.checkType(block,'price_hyper')){
initHypercontext(block,pad_id);
block.loaded=true;
block_index++;

continue;
}else if(this.Blocks.checkType(block,'photo')){
initPhotocontext(block,pad_id);
block.loaded=true;
block_index++;

continue;
}

var banners_html=[],
block_banner_count=0,
banner;

this.setExtraBlockResponseParams(block);

var banners_count,banner_html;

if(isValidSquareBlock(block)&&Begun.Browser.getUaType()!==UA_DESKTOP){
banners_count=1;
}

if(this.useBlockIdDistr()){
var i=0;

banners_count=banners_count||this.getBannersByBlockId(block.id,'autocontext').length;

while(banner=this.getBanner('autocontext',i,pad_id)){
this.Callbacks.dispatch(
'banner','predraw',this,[banner]
);

if(
banner.block_id&&
!banner.disabled&&
(this.lastBlockId&&
this.lastBlockId==block.id||
banner.block_id==block.id)
){
addHTML(
block,
banner,
banners_html,
block_banner_count
);

block_banner_count++;
}

i++;
}
}else{
banners_count=banners_count||this.getBanners(pad_id)['autocontext']||0;

while(block_banner_count<banners_count){
banner=this.getBanner('autocontext',this.getBannerIndex(pad_id),pad_id)||null;

if(banner){
this.Callbacks.dispatch(
'banner','predraw',this,[banner]
);

addHTML(
block,
banner,
banners_html,
block_banner_count
);
}else{
out_of_banners=true;
break;
}

block_banner_count++;

this.incBannerIndex(pad_id);
}
}

if(
block_banner_count<banners_count&&
block_banner_count!=0&&
isValidSquareBlock(block)
){
while(block_banner_count<banners_count){
banner_html='';

if(!(
block_banner_count%
block.options.json.col
)){
banner_html+='<tr>';
}

banner_html+='<td>&nbsp;</td>';

if(!(
(block_banner_count+1)%
block.options.json.col
)){
banner_html+='</tr>';
}

banners_html.push(banner_html);

block_banner_count++;
}
}

if(this.printBlock(banners_html,block,pad)){
includeRamblerCounter(block);
block.loaded=true;
}

this.dispatchBlockDrawCallback(block);

Module.initInBlock(block,pad);

block_index++;
}

if(!this.links_parsed){
this.parseLinks();
this.links_parsed=true;
}
if(!this.fullScreenLoaded&&!this.requestParams.frm_level&&!window.begun_fullscreen){
var feed=this.getFeed();
if(Begun.Browser.getUaType()!==UA_DESKTOP&&feed&&feed.params&&!feed.params.no_fullscreen){
window.begun_block_id=BLOCK_ID_FULLSCREEN;
this.fullScreenLoaded=true;
Begun.Autocontext.init();
}
}
};

fillBlocks.delayedCall=false;

return fillBlocks;
})(this);

this.begunToolbarLoaded=function(){
if(!Begun.Toolbar||!Begun.Toolbar.init){
return;
}
while(this.unhandledDebugs.length>0){
Begun.Toolbar.init(this.unhandledDebugs.pop());
}
};
this.nullGlobalBlockParams=function(){
window.begun_block_id=null;
window.begun_feed_source=null;
window.begun_extra_block=null;
};
this.setExtraBlockResponseParams=function(block){
block.options.show_thumbnails=typeof block.options.show_thumbnails!='number'||isNaN(block.options.show_thumbnails)?Number(_this.responseParams['thumbs']):block.options.show_thumbnails;
};
this.isRichExpanded=function(block){
return block&&Begun.Utils.inList(block.options.block_options,'RichExpanded');
};
this.isRichMini=function(block){
if('string'===typeof block){
block=this.Blocks.getBlockById(block);
}

return block&&block.options&&Begun.Utils.inList(
block.options.block_options,'RichMini'
);
};
this.isMediaText=function(block){
if(block&&block.options&&block.options.dimensions&&block.options.dimensions.type){
var type=block.options.dimensions.type;
if(type.indexOf('mediatext')!=-1||type.indexOf('320x50')!=-1||block.options.visual.mediatext){
return true;
}
}
return false;
};
};

(function(Begun){
var ac=Begun.Autocontext;

ac.Monitor=new function(){
var _this=this;
this.init=function(){
var onLoad=function(){
_this.prepare()&&_this.count();
};

if(ac.domContentLoaded){
onLoad();
}else{
ac.onContent(onLoad);
}

Begun.Utils.addEvent(window,'unload',function(){
if(_this.data){
_this.sendHidden(_this.data);
}
});
Begun.Utils.addEvent(window,'scroll',function(){
_this.count();
});
Begun.Utils.addEvent(window,'resize',function(){
_this.count();
});
};

this.prepare=function(){
var pads=ac.Pads.getPads();

if(pads.length===0){
Begun.Error.send("begun_auto_pad is missing",document.URL,-1);
return;
}

for(var n=0,ln=pads.length;n<ln;n++){
for(var i=0,length=pads[n].blocks.length;i<length;i++){
var block=pads[n].blocks[i];
var dom_obj=ac.Blocks.getDomObj(block.id),
conditions=[],
banners_ids=[],
kwtypes=[];

if(!dom_obj){
if(conditions.length){
block.condition_id=conditions;
block.kwtype=kwtypes;
block.banners_ids=banners_ids;
}
continue;
}
var tds=dom_obj.getElementsByTagName('td'),
tdsLen=tds.length;

var newLayoutBannersContainer=Begun.Utils.getElementsByClassName(dom_obj,'div','begun_adv_new_layout')[0];

if(newLayoutBannersContainer){
tds=Begun.Utils.getElementsByClassName(newLayoutBannersContainer,'div','begun_adv_cell');
tdsLen=tds.length;
}

block.hidden=false;
block.dom_obj=dom_obj;

if(tdsLen){
for(var k=0;k<tdsLen;k++){
var td=tds[k],
bannerId=td.getAttribute('_banner_id');

if(bannerId){
var conditionId=ac.Banners.infoValues.get(
block.id,bannerId,'condition_id'
);

if(null!=conditionId){
conditions.push(conditionId);
}
var kwtype=ac.Banners.infoValues.get(
block.id,bannerId,'kwtype'
);

if(null!=kwtype){
kwtypes.push(kwtype);
}
banners_ids.push(bannerId);
}
}
}else{
var graphCondition=ac.Banners.infoValues.get(
block.id,block.banner_id,'condition_id'
);

graphCondition&&
conditions.push(graphCondition);
var graphKwtype=ac.Banners.infoValues.get(
block.id,block.banner_id,'kwtype'
);

graphKwtype&&
kwtypes.push(graphKwtype);
banners_ids.push(block.banner_id);
}

block.condition_id=conditions;
block.kwtype=kwtypes;
block.banners_ids=banners_ids;
}
}

return true;
};

this.count=function(isForcedLogging){
var data=[],
pads=ac.Pads.getPads(),
wSize=Begun.Utils.countWindowSize(),
wScroll=Begun.Utils.getScrollXY(),
_this=this;
var sendShowUrl=function(blockId,bannerId){
var showUrl=ac.Banners.infoValues.get(
blockId,bannerId,'show_url'
);
if(showUrl){
_this.send('',showUrl);
}
};

for(var n=0,ln=pads.length;n<ln;n++){
var padId=pads[n].pad_id;

for(var i=0,l=pads[n].blocks.length;i<l;i++){
var block=pads[n].blocks[i],
conditionIds=block.condition_id,
condLen=conditionIds&&conditionIds.length,
kwtypes=block.kwtype,
kwtypesLen=kwtypes&&kwtypes.length,
banners_ids=block.banners_ids,
banners_idsLen=banners_ids&&banners_ids.length,
dom_obj=block.dom_obj,
k;
if(condLen&&dom_obj||isForcedLogging){
var logData=[
{block_id:block.id}
];
for(k=0;k<condLen;k++){
logData.push(
{condition_id:conditionIds[k]}
);
}
for(k=0;k<kwtypesLen;k++){
logData.push(
{kwtype:kwtypes[k]}
);
}
for(k=0;k<banners_idsLen;k++){
logData.push(
{banner_id:banners_ids[k]}
);
}

if(!block.alreadySeen){
var blockVisible=this.isVisible(dom_obj,wSize,wScroll);

if(blockVisible||isForcedLogging){
block.alreadySeen=true;

sendShowUrl(block.id,block.banner_id);
block.hidden=false;

this.sendVisible({
pad_id:padId,
data:logData
});

}else{
block.hidden=true;

data.push(
{pad_id:padId},
logData
);
}
}
}
}

}
this.data=data.length?data:null;
};

this.countBanner=function(banner,padId,blockId){
var data={
pad_id:padId,
block_id:blockId,
banner_id:banner.data.banner_id,
kwtype:banner.data.kwtype,
condition_id:banner.data.condition_id
};
this.sendVisible(data);
};

this.isVisible=function(dom_obj,wSize,wScroll){
var COMPULSORY_PART=2/3;
if(!dom_obj.offsetHeight){
var els=dom_obj.childNodes,
elsLen=els.length;

for(var i=0;i<elsLen;i++){
var el=els[i];

if(1===el.nodeType&&dom_obj!==el.offsetParent){
dom_obj=el;
break;
}
}
}

var pos=Begun.Utils.findPos(dom_obj),
blockHeight=dom_obj.offsetHeight;

return(pos&&(pos.top<wSize.height+wScroll.y-
blockHeight*COMPULSORY_PART)&&(pos.left<wSize.width+wScroll.x));
};

this.sendVisible=function(data,url){
var padId=data.pad_id,
visValue='visible';

data.first=+this.setFirst(padId,visValue);

data.visibility=visValue;

return this.send(data,url);
};

this.sendHidden=function(data,url){
data.push({
visibility:'hidden'
});

this.send(data,url);
};

this.setFirst=function(padId,eventType){
var stored=ac.Storage.get(padId);

if(!stored||!stored[eventType]){
stored=stored||{};
stored[eventType]=true;

ac.Storage.set(
padId,stored
);

return true;
}

return false;
};

this.send=function(data,url){
url=url||ac.Strings.urls.log_banners_counter;
data=Begun.Utils.serialize(data);

if(data){
var last=url.substring(url.length-1),
delim=(last==='?'||last==='&')?'':'?';

url+=delim+data;
}

return Begun.Utils.includeImage(url);
};

this.sendJSON=function(data,url){
return Begun.Utils.includeCounter(url,data);
};

};

ac.Pads=new function(){
var pads=[];
this.init=function(){
if(window['begun_auto_pad']&&!this.getPad()){
this.push(window['begun_auto_pad']);
}
};
this.push=function(pad_id){
pads[pads.length]={
pad_id:pad_id,
feed:null,
blocks:[],
banner_index:0,
feed_started:false
};
};
this.getPad=function(pad_id){
pad_id=pad_id||window['begun_auto_pad'];
for(var i=0,l=pads.length;i<l;i++){
if(pads[i].pad_id==pad_id){
return pads[i];
}
}
return null;
};
this.getPads=function(){
return pads;
};
};

ac.Banners={
infoValues:{
ids:{},

set:function(blockId,bannerId,type,value){
if(null==value){
return value;
}
var block=this.ids[blockId];
if(!block){
block=this.ids[blockId]={};
}

if(!block[bannerId]){
block[bannerId]={};
}
block[bannerId][type]=value;

return value;
},

setAll:function(blockId,banner){
var properties=['condition_id','kwtype','show_url'],
i=properties.length;
while(i--){
this.set(blockId,banner.banner_id,properties[i],banner[properties[i]]);
}
},

get:function(blockId,bannerId,type){
var block=this.ids[blockId];
return block&&block[bannerId]&&block[bannerId][type];
}
}
};

ac.Blocks=new function(){
this.init=function(){
ac.resetBannerIndex();
};
this.add=function(elem,pad_id){
var blocks=ac.getPad(pad_id).blocks;
blocks[blocks.length]=elem;
};
this.push=function(elem,pad_id){
var blocks=ac.getPad(pad_id).blocks;
if(window.begun_extra_block){
blocks[0]=elem;
}else{
blocks[blocks.length]=elem;
}
if(!ac.isFeedStarted()){
ac.initFeedLoad();
}else if(!!ac.getFeed()){
ac.insertNonTextBlock(elem);
ac.draw();
}
ac.nullGlobalBlockParams();
};
this.del=function(block_id,pad_id){
var block=null;
var i=0;
var blocks=ac.getPad(pad_id).blocks;
while(block=blocks[i]){
if(block.id==block_id){
blocks[i].id=-1;
break;
}
i++;
}
};

this.deleteAll=function(pad_id){
var pad=ac.getPad(pad_id),
blocks=pad&&pad.blocks;

if(blocks&&blocks.length){
blocks.length=0;
}
};

this.pushAll=function(blocks,pad_id){
this.deleteAll(pad_id);
this.init();

var block=null;
var i=0;
while(block=blocks[i]){
this.push(block);
i++;
}
};

this.getBlockById=function(block_id,blocks,pad_id){
var block=null;
var i=0;
blocks=blocks||ac.getPad(pad_id).blocks;
while(block=blocks[i]){
if(block.id==block_id){
return block;
}
i++;
}
return null;
};

this.deleteBlockById=function(block_id,blocks,pad_id){
blocks=blocks||ac.getPad(pad_id).blocks;

for(var i=0;i<blocks.length;i++){
if(blocks[i].id===block_id){
blocks.splice(i,1);
return true;
}
}

return false;
};

this.getDomObj=function(block_id){
var resultBlock;
if(ac.getBlockIdTopMobile()==block_id){
try{
resultBlock=top.document&&top.document.getElementById(ac.Strings.css.block_prefix+block_id);
}catch(e){}
}
return resultBlock||Begun.$(ac.Strings.css.block_prefix+block_id)||null;
};
this.checkType=function(block,type){
return(this.getBlockType(block)==type);
};

this.checkTypeContains=function(block,substring){
return this.getBlockType(block).indexOf(substring)>=0;
};

this.checkViewType=function(block,viewtype){
return Begun.Utils.inList((block.options&&block.options.view_type),viewtype);
};

this.getBlockType=function(block){
return block&&block.options&&block.options.dimensions&&block.options.dimensions.type&&block.options.dimensions.type.toLowerCase()||"";
};
this.isBlockFixed=function(block){
return(/(\d+)x(\d+)/.test(this.getBlockType(block)));
};
};

ac.Tpls=new function(){
var css={};
css['default']='\
#begun-default-css {display:none !important;}\
';
css['block']='.begun_adv * {clear:none !important;color:#000 !important;float:none !important;margin:0 !important;padding:0 !important;letter-spacing:normal !important;word-spacing:normal !important;z-index:auto !important;font-size:12px !important;font:normal normal 12px Arial,sans-serif !important;text-transform:none !important;list-style:none !important;position:static !important;text-indent:0 !important;visibility:visible !important;white-space:normal !important;}.begun_adv_common {position:relative !important;width:100% !important;}#begun_block_{{block_id}} .begun_adv_custom {background-color:{{block:backgroundColor}} !important;border-color:{{block:borderColor}} !important;}#begun_block_{{block_id}} .banner__item.begun_adv_custom {background-color:{{block:backgroundColor}} !important;border-color:{{block:borderColor}} !important;}#begun_block_{{block_id}} .begun_adv_new_layout.begun_adv_custom_border {border-color:{{block:borderColor}} !important;}#begun_block_{{block_id}} .begun_adv_image img.begun_adv_picture {border-color:{{image:borderColor}} !important;}#begun_block_{{block_id}} .begun_adv_new_layout .begun__adv__block__img img {border-color:{{image:borderColor}} !important;}#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_text_custom,#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_text_custom *{color:{{text:color}} !important;}#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_title_custom,#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_title_custom *{color:{{title:color}} !important;}#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_domain_custom,#begun_block_{{block_id}} .begun_adv_new_layout .begun_adv_domain_custom *{color:{{domain:color}} !important;}.begun_adv_common tr,.begun_adv_common td,.begun_adv_common a,.begun_adv_common b,.begun_adv_common div,.begun_adv_common span {background:none !important;border:none !important;}#begun_block_{{block_id}} {height:auto !important;width:auto !important;line-height:normal !important;margin:0 !important;padding:0 !important;font:12px/18px Arial,sans-serif !important;color:#000 !important;text-align:left !important;}#begun_block_{{block_id}} wbr {display:inline-block !important;}#begun_block_{{block_id}} .begun_adv_span {display:inline-block !important;position:relative !important;width:auto !important;height:auto !important;margin:0 !important;padding:0 !important;}#begun_block_{{block_id}} .begun_adv {-moz-box-sizing:border-box !important;-webkit-box-sizing:border-box !important;box-sizing:border-box !important;}#begun_block_{{block_id}} *:after,#begun_block_{{block_id}} *:before {content:normal !important;}#begun_block_{{block_id}} b {font-weight:bold !important;display:inline !important;}#begun_block_{{block_id}} .begun_adv,#begun_block_{{block_id}} table,#begun_block_{{block_id}} td,#begun_block_{{block_id}} div {padding:0 !important;text-align:left !important;table-layout:auto !important;}#begun_block_{{block_id}} .begun_adv table {border:none !important;border-collapse:collapse !important;}#begun_block_{{block_id}} td {vertical-align:middle !important;}#begun_block_{{block_id}} .begun_adv_cell {text-align:left !important;}#begun_block_{{block_id}} .begun_adv_bullit {color:#aaa !important;}#begun_block_{{block_id}} .begun_adv_title,#begun_block_{{block_id}} .begun_adv_text {display:block !important;}#begun_block_{{block_id}} .begun_adv_title .begun_favicon {width:16px !important;height:16px !important;margin-right:6px !important;vertical-align:middle !important;}#begun_block_{{block_id}} a.begun_adv_sys_logo {position:absolute !important;right:2px !important;bottom:2px !important;z-index:2 !important;display:block !important;height:16px !important;width:11px !important;padding:0 !important;border-top:1px solid #fff !important;border-bottom:1px solid #fff !important;border-left:3px solid #fff !important;border-right:3px solid #fff !important;overflow:hidden !important;vertical-align:middle !important;line-height:16px !important;background:#fff !important;-webkit-transition:all 0.3s !important;-moz-transition:all 0.3s !important;-ms-transition:all 0.3s !important;-o-transition:all 0.3s !important;transition:all 0.3s !important;}#begun_block_{{block_id}} .begun_adv_common_300x250 a.begun_adv_sys_logo {border:none !important;}#begun_block_{{block_id}} .begun_adv_sys_logo:hover {width:52px !important;}#begun_block_{{block_id}} .begun_adv_square .begun_adv_sys_logo:hover {width:auto !important;}#begun_block_{{block_id}} .begun_adv_square .snap_noshots {display:inline-block !important;height:16px !important;margin-top:3px !important;}#begun_block_{{block_id}} .begun_adv_sys_logo img {display:inline-block !important;height:16px !important;margin-left:-29px !important;max-width:none !important;-webkit-transition:all 0.3s !important;-moz-transition:all 0.3s !important;-ms-transition:all 0.3s !important;-o-transition:all 0.3s !important;transition:all 0.3s !important;}#begun_block_{{block_id}} .begun_adv_sys_logo:hover img {margin-left:0 !important;}#begun_block_{{block_id}} #begun_adv_square_{{block_id}} .begun_adv_sys_logo img,#begun_block_{{block_id}} #begun_adv_square_{{block_id}}.begun_hover .begun_adv_sys_logo img {margin-left:0 !important;background-color:#fff !important;}#begun_block_{{block_id}} span.begun_adv_age {position:absolute !important;right:0 !important;top:0 !important;padding:2px 2px 0 0 !important;font-style:italic !important;color:#622678 !important;color:{{text:color}} !important;font-weight:bold !important;}#begun_block_{{block_id}} .begun_adv_sys_logo,#begun_block_{{block_id}} .begun_adv_sys_logo a {font-size:14px !important;line-height:16px !important;text-align:right !important;color:{{block_logo_color}} !important;text-decoration:none !important;font-weight:bold !important;font-style:normal !important;}#begun_block_{{block_id}} .begun_adv_sys_logo strong {display:none !important;line-height:16px !important;font-size:14px !important;font-weight:bold !important;letter-spacing:-1px !important;color:{{block_logo_color}} !important;}#begun_block_{{block_id}} .begun_adv_sys_logo strong {*display:inline !important;}#begun_block_{{block_id}} .begun_adv_sys_logo img {*display:none !important;}#begun_block_{{block_id}} .begun_collapsable .begun_adv_cell .begun_adv_cell {padding:5px 2px 4px 5px !important;}#begun_block_{{block_id}} .begun_adv_fix .begun_adv_title {margin-bottom:2px !important;}#begun_block_{{block_id}} .begun_adv_fix .begun_adv_common {overflow:hidden !important;width:auto !important;}#begun_block_{{block_id}}.begun_auto_rich .begun_adv_fix .begun_adv_common {overflow:visible !important;}#begun_block_{{block_id}} .begun_adv_text {padding:2px 0 !important;line-height:1 !important;}#begun_block_{{block_id}} .begun_adv_block {border:none !important;cursor:pointer !important;cursor:hand !important;}#begun_block_{{block_id}} .begun_adv_title a.begun_cross {float:right !important;margin-left:8px !important;font-size:18px !important;text-decoration:none !important;font-weight:normal !important;line-height:14px !important;color:{{domain:color}} !important;opacity:0.25 !important;filter:alpha(opacity=25) !important;}#begun_block_{{block_id}} .begun_adv_title a.begun_cross:hover {color:{{domain:color}} !important;}#begun_block_{{block_id}} .begun_adv_phone_wrapper {padding-left:15px !important;white-space:nowrap !important;position:relative !important;display:inline-block !important;_display:inline !important;zoom:1 !important;}#begun_block_{{block_id}} .begun_adv_phone_wrapper.begun_adv_phone_no_icon {padding-left:0 !important;}#begun_block_{{block_id}} .begun_adv_title * {line-height:1.2 !important;color:{{title:color}} !important;font-size:18px !important;font-size:{{title:fontSize}} !important;font-weight:normal !important;font-weight:{{title:fontWeight}} !important;}#begun_block_{{block_id}} .begun_collapsable .begun_adv_title *{font-size:12px !important;}#begun_block_{{block_id}} .begun_adv_title a:hover,#begun_block_{{block_id}} .begun_adv_title a:hover * {color:#f00 !important;color:{{title_hover:color}} !important;}#begun_block_{{block_id}} .begun_adv_text * {line-height:1.2 !important;color:#000 !important;color:{{text:color}} !important;font-size:12px !important;font-size:{{text:fontSize}} !important;text-decoration:none !important;}#begun_block_{{block_id}} .begun_adv_ver .begun_adv_cell .begun_adv_block .begun_adv_text {font-size:14px !important;font-size:{{text:fontSize}} !important;}#begun_block_{{block_id}} .begun_adv_ver .begun_adv_cell .begun_adv_block .begun_adv_text * {font-size:14px !important;font-size:{{text:fontSize}} !important;}#begun_block_{{block_id}} .begun_adv_hor .begun_adv_cell .begun_adv_block .begun_adv_text {font-size:14px !important;font-size:{{text:fontSize}} !important;}#begun_block_{{block_id}} .begun_adv_hor .begun_adv_cell .begun_adv_block .begun_adv_text * {font-size:14px !important;font-size:{{text:fontSize}} !important;}#begun_block_{{block_id}} .begun_adv_geo,#begun_block_{{block_id}} .begun_adv_geo * {color:#000 !important;color:{{text:color}} !important;text-decoration:none !important;font-size:{{domain:fontSize}} !important;font-weight:bold !important;cursor:text !important;}#begun_block_{{block_id}} div.begun_adv_contact {*position:relative !important;*top:3px !important;*margin-top:-3px !important;}#begun_block_{{block_id}} .begun_adv_contact,#begun_block_{{block_id}} .begun_adv_contact * {color:{{domain:color}} !important;font-size:12px !important;font-size:{{domain:fontSize}} !important;line-height:1.2 !important;}#begun_block_{{block_id}} .begun_adv_contact span {padding-right:2px !important;}#begun_block_{{block_id}} .begun_adv_contact a {color:{{domain:color}} !important;text-decoration:none !important;}#begun_block_{{block_id}} .begun_adv_thumb .begun_thumb {float:left !important;display:block !important;_display:inline !important;z-index:1 !important;overflow:hidden !important;zoom:1 !important;margin:0 auto 5px 7px !important;}#begun_block_{{block_id}} .begun_adv_thumb .begun_thumb img {z-index:20 !important;}#begun_block_{{block_id}} .begun_adv_rich {overflow:visible !important;}#begun_block_{{block_id}} .begun_adv_rich .begun_adv_image {float:left !important;margin-right:10px !important;_margin-right:7px !important;top:0 !important;width:72px !important;height:72px !important;position:relative !important;}#begun_block_{{block_id}} .begun_adv_thumb .begun_adv_block {margin-left:60px !important;_zoom:1 !important;}#begun_block_{{block_id}} .begun_adv_rich .begun_adv_block {margin-left:82px !important;_margin-left:79px !important;word-wrap:break-word !important;}#begun_block_{{block_id}}.begun_auto_rich .banners_count_1 .begun_adv_block * {text-align:left !important;}#begun_block_{{block_id}} .begun_mobile_classic .begun_adv_common .begun_adv_table .begun_adv_title * {font-size:18px !important;}#begun_block_{{block_id}} .begun_mobile_classic .begun_adv_common .begun_adv_table .begun_adv_text * {font-size:14px !important;}#begun_block_{{block_id}} .begun_mobile_rich .begun_adv_common .begun_adv_table .begun_adv_title * {font-size:24px !important;font-weight:bold !important;}#begun_block_{{block_id}} .begun_mobile_rich .begun_adv_common .begun_adv_table .begun_adv_text * {font-size:18px !important;}#begun_block_{{block_id}} .gift {display:none !important;}#begun_block_{{block_id}} .begun_warn_message {position:relative !important;display:block !important;margin-top:4px !important;padding-left:16px !important;line-height:10px !important;font-size:9px !important;text-indent:-16px !important;color:#aaa !important;}#begun_block_{{block_id}} .begun_warn_message .begun_warn_icon {display:inline-block !important;position:relative !important;padding-right:16px !important;vertical-align:top !important;_display:inline !important;zoom:1 !important;}#begun_block_{{block_id}} .begun_warn_message .begun_warn_icon i {position:absolute !important;top:-2px !important;width:12px !important;height:13px !important;background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAANCAYAAACdKY9CAAAACXBIWXMAAAsSAAALEgHS3X78AAAA10lEQVQoz43SvUpDQRAF4G/XC2muxD98AYsEe7HIC1jYiM+RSsFWGxvzLkJsfAVha4m1VhKCcmvRZoQ1iObAMGcPZ9iZ3UmlFBV2cYL9OD/iFq/fhqYyn+ESrZ+Y4CqyHOJ1CC067EV0od2ERyqlHOABKYrfsRH8Df3gnzjMGFfmv5AwzhhZHaNcXbkK+g2esV2JLUrFa7xk3P3S62bE8mzTVErZwRO2/nmlBQYN5jjFFOvo4SJMvchdeOapWo1hfN4R1kL7wD3OMVtejRmOo7VhpS3qIb4AJKgth4BJRpoAAAAASUVORK5CYII=\") transparent 0 0 no-repeat !important;}#begun_fullscreen_mobile_block_wrapper {position:absolute !important;left:0 !important;top:0 !important;width:100% !important;height:100% !important;z-index:999999999 !important;opacity:0.99 !important;}#begun_block_{{block_id}} .begun_brand,#begun_fullscreen_mobile_block_wrapper .begun_brand {position:absolute !important;right:0 !important;top:0 !important;overflow:hidden !important;}#begun_block_{{block_id}} .begun_brand_icon,#begun_fullscreen_mobile_block_wrapper .begun_brand_icon {background:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAAiCAYAAADmvn/1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPH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0MVw7MuOHJM83gYsCgW3pS8h98R30KRciDRIPw8m/Ve5TERExEdAiqeNjQ1WxhbeSmKxmB4cHCwCkn9763KZs0Zra+tQfn7+76CidWyOWGGFhYUPQFH30f84SES2S+Qyr1QIwQKhkNc4dt9ayZNIXxEKIbYMQQhByJsIf39/gpDn1xaopqYGX1kaLiGQSCLIpFFdXR1aWFhAWVlZCLLzd//YfVHw+Xx8HYGYTObhyyh8TWl4CmGz2fiq4ggZMpkMpaeno9HRUcNTSEJCAr7ORBKJBAkEAtTT04MGBgbw/a9hfKkeDwcHB1RfX681UIVCYXjJ3fFPd29vb/w/IMPNdolchvhSJQh5o/GPAAMATQ0zrB0WLrMAAAAASUVORK5CYII=\") no-repeat scroll right -18px rgba(0,0,0,0) !important;display:inline-block !important;height:16px !important;position:relative !important;transition:width 0.3s ease 0s !important;vertical-align:top !important;width:16px !important;}#begun_fullscreen_mobile_block_wrapper .begun_brand {left:0 !important;right:auto !important;z-index:99999999 !important;}#begun_block_2 .begun_brand .begun_brand_icon,#begun_fullscreen_mobile_block_wrapper .begun_brand .begun_brand_icon {width:68px !important;background-position:right 0 !important;}#begun_block_{{block_id}} .begun_brand_name {display:inline-block !important;left:100% !important;line-height:16px !important;margin-right:5px !important;opacity:0 !important;overflow:hidden !important;position:relative !important;transition:all 0.3s ease 0s !important;vertical-align:middle !important;}#begun_block_{{block_id}} .begun_brand:hover .begun_brand_name + .begun_brand_icon {width:16px !important;}#begun_block_{{block_id}} .begun_brand:hover .begun_brand_name {display:inline-block !important;left:0 !important;margin-right:5px !important;opacity:1 !important;}#begun_block_{{block_id}} .begun_brand:hover .begun_brand_icon {width:68px !important;background-position:right 0 !important;}#begun_block_{{block_id}} .price_brand,#begun_fullscreen_mobile_block_wrapper .price_brand {position:absolute !important;right:0 !important;top:0 !important;display:block !important;vertical-align:middle !important;height:18px !important;line-height:18px !important;overflow:hidden !important;width:11px !important;-webkit-transition:all 0.3s !important;-moz-transition:all 0.3s !important;-ms-transition:all 0.3s !important;-o-transition:all 0.3s !important;transition:all 0.3s !important;background:#fff !important;border-left:3px solid #fff !important;border-right:3px solid #fff !important;z-index:2 !important;}#begun_fullscreen_mobile_block_wrapper #begun_block_{{block_id}} {z-index:9999999 !important;position:fixed !important;}#begun_fullscreen_mobile_block_wrapper .price_brand {left:0 !important;right:auto !important;z-index:99999999 !important;}#begun_block_{{block_id}} .price_brand:hover,#begun_fullscreen_mobile_block_wrapper .price_brand:hover {width:52px !important;}#begun_block_{{block_id}} .price_brand img,#begun_fullscreen_mobile_block_wrapper .price_brand img {display:inline-block !important;vertical-align:middle !important;margin-left:-29px !important;max-width:none !important;-webkit-transition:all 0.3s !important;-moz-transition:all 0.3s !important;-ms-transition:all 0.3s !important;-o-transition:all 0.3s !important;transition:all 0.3s !important;}#begun_block_{{block_id}} .price_brand:hover img,#begun_fullscreen_mobile_block_wrapper .price_brand:hover img {margin-left:0 !important;}#begun_fullscreen_mobile_block_wrapper .fullscreen_layer {position:fixed !important;width:100% !important;height:100% !important;left:0 !important;top:0 !important;z-index:9999999 !important;background:url(\"//ssp.rambler.ru/img/background_fullscreen.png\") !important;}#begun_fullscreen_mobile_block_wrapper #begun_close_fullscreen {position:fixed !important;top:20px !important;right:20px !important;z-index:99999999 !important;}#begun_close_fullscreen img {width:40px !important;height:40px !important;}\
#begun_block_{{block_id}} .begun_adv a {\
display: inline;\
vertical-align: baseline;\
text-decoration: underline;\
opacity: 1 !important;\
}\
#begun_block_{{block_id}} .begun_adv {\
background-color: {{block:backgroundColor}}; /* no !important for hover */\
border: 1px solid {{block:borderColor}}; /* no !important for hover */\
{{block:filter}} /* no !important for hover */\
}\
#begun_block_{{block_id}} .begun_adv *, .begun_adv *:hover {\
width: auto; /* no !important for rich-images */\
height: auto; /* no !important for rich-images */\
background: none; /* no !important for hover */\
border: none; /* no !important for hover */\
}\
#begun_block_{{block_id}} .begun_adv.begun_hover {\
background-color: {{block_hover:backgroundColor}}; /* no !important for hover */\
border: 1px solid {{block_hover:borderColor}}; /* no !important for hover */\
{{block_hover:filter}} /* no !important for hover */\
}\
#begun_block_{{block_id}} td {\
overflow: visible;\
}\
#begun_block_{{block_id}} .begun_adv_rich .begun_active_image {\
z-index:1000;\
}\
#begun_block_{{block_id}} .begun_adv_rich .begun_active_image img {\
z-index:1000 !important;\
}\
#begun_block_{{block_id}} .begun_adv_rich .begun_adv_image img {\
border:1px solid {{block:borderColor}};\
position:absolute !important;\
background:#fff !important;\
top:0;\
left:0;\
max-width:none !important;\
z-index:20;\
cursor:pointer;\
}\
#begun_block_{{block_id}} .begun_adv_rich .begun_adv_picture {\
position:absolute !important;\
z-index:20;\
}\
#begun_block_{{block_id}} .begun_collapsed {\
height:45px !important;\
overflow:hidden !important;\
}\
#begun_block_{{block_id}} .begun_collapsed .begun_adv_title {\
margin-bottom:30px !important;\
}\
';
css['backgroundImg']='#begun_block_{{block_id}} {\
   background: transparent url("{{backgroundImg}}") repeat-x scroll -1px -1px !important;\
   }';
var html={};
html['blck_place']='<div id="{{id}}"></div>';
html['fullscreen_place']='<div class="fullscreen_layer"></div><div id="begun_close_fullscreen"><img src="{{close_fullscreen}}"/></div><div id="{{id}}"></div>';
html['bnnr_glue']=' <span class="begun_adv_bullit"> &#149; </span> ';
html['bnnr_card']='\
<span class="begun_adv_phone_wrapper"><span class="begun_adv_card"><a target="_blank" href="{{url}}" class="snap_noshots">{{card_text}}</a></span></span>\
';
html['bnnr_card_no_phone']='\
<span class="begun_adv_phone_wrapper begun_adv_phone_no_icon"><span class="begun_adv_card"><a target="_blank" href="{{url}}" class="snap_noshots">{{card_text}}</a></span></span>\
';
html['bnnr_domain']='<span class="begun_adv_contact"><a class="snap_noshots" target="_blank" href="{{url}}" title="{{fullDomain}}">{{domain}}</a></span>';

html['bnnr_geo']='<span class="begun_adv_city"><a class="snap_noshots" target="_blank" href="{{url}}" title="{{fullDomain}}">{{geo}}</a></span>';

html['bnnr_geo_add']='<div class="begun_adv_geo"><a href="javascript:void(0)">{{address}}</a></div>';

html['bnnr_favicon']='<img class="begun_favicon" src="{{src}}" width="16" height="16" alt="" />';
html['bnnr_thumb']='\
<a href="{{url}}" class="begun_thumb snap_noshots" style="width:42px !important;height:42px !important;" target="_blank"><img src="{{src}}" {{pngfix}} {{mouse_events}} width="42" height="42" alt="" /></a>\
';
html['bnnr_picture']='\
<div class="begun_adv_image"><a href="{{url}}" class="snap_noshots" target="_blank"><img src="{{src}}" class="begun_adv_picture" alt="" onload="Begun && Begun.Autocontext && Begun.Autocontext.replaceInvalidPicture && Begun.Autocontext.replaceInvalidPicture(this)" /></a></div>\
';
html['bnnr_warn']='<div class="begun_warn_message begun_warn_{{type}}"><span class="begun_warn_icon"><i></i></span>{{text}}</div>';

html['blck_hover']=' onmouseover="Begun.Utils.addClassName(this, \'begun_hover\');" onmouseout="Begun.Utils.removeClassName(this, \'begun_hover\');"';
html['search_banner_swf']='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{{width}}" height="{{height}}"><param name="movie" VALUE="{{source}}&link1={{url}}"><param name="wmode" value="opaque"><param name="allowScriptAccess" value="always"><param name="quality" VALUE="high"><embed src="{{source}}&link1={{url}}" quality="high" width="{{width}}" height="{{height}}" style="{{styles}}" type="application/x-shockwave-flash" wmode="opaque"></embed></object>';
html['search_banner_js']='';
html['search_banner_html']='<iframe src="{{source}}" width="{{width}}" height="{{height}}" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" hspace="0" style="{{styles}}" vspace="0" {{sandbox}}></iframe>';

html['search_banner_img']='<a href="{{url}}" target="_blank"><img src="{{source}}&redir=1" border="0" width="{{width}}" height="{{height}}" style="{{styles}}" /></a>';
html['search_banner_xhtml']='<div class="xhtml_banner" id="axhtml-{{impression_id}}" style="{{styles}}"></div>';
html['search_banner_xiframe']='<iframe class="xhtml_banner" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" id="axhtml-{{impression_id}}" style="{{styles}}"></iframe>';

html['graph_begun_logo']='<a class="price_brand" target="_blank" href="{{price_logo}}"><img class="price_brand_icon" src="{{price_logo_src}}"/></a>';
html['graph_price_logo']='<a class="price_brand" target="_blank" href="{{price_logo}}"><img class="price_brand_icon" src="{{price_logo_src}}"/></a>';
html['graph_begun_logo_text']='<a class="begun_brand" target="_blank" href="{{begun_logo}}"><span class="begun_brand_name">begun</span><i class="begun_brand_icon"></i></a>';
html['begun_logo']='<img src="{{src}}" border="0" alt="price"/><strong>price</strong>';
html['price_logo']='<img src="{{src}}" border="0" alt="price"/><strong>price</strong>';
html['price_search_logo']='<img src="{{src}}" border="0" alt="price"/>';
html['begun_new_logo']='<img src="{{src}}" border="0" alt="price"/>';
html['offer_stores']='&#1084;&#1072;&#1075;&#1072;&#1079;&#1080;&#1085;&#1099;: <span class="begun_adv_stores_count">{{count}}</span>';

this.getCSS=function(type){
return css[type];
};
this.getHTML=function(type){
return html[type];
};
this.addTpls=function(newTpls){
var types=['html','css'];
var i=0;
var type=null;
var is_default_css_override=false;
if(css['default']&&window['begun_css_tpls']&&window['begun_css_tpls']['default']&&css['default']!=window['begun_css_tpls']['default']){
is_default_css_override=true;
}
var tplContainer=typeof newTpls==="undefined"?window:newTpls;
while(type=types[i]){
if(typeof tplContainer['begun_'+type+'_tpls']!=="undefined"){
var j=0;
var tpl=null;
while(tpl=tplContainer['begun_'+type+'_tpls'][j]){
Begun.extend(type=='html'?html:css,tpl);
j++;
}
}
i++;
}
return is_default_css_override;
};
};

ac.Customization=new function(){
var _this=this;
this.init=function(){
if(typeof window.begun_urls!=="undefined"){
_this.setURLs(window.begun_urls);
window.begun_urls=null;
}
if(typeof window.begun_callbacks!=="undefined"){
_this.setCallbacks(window.begun_callbacks);
window.begun_callbacks=null;
}
if(_this.setTpls()||!arguments.callee.run){
ac.printDefaultStyle();
arguments.callee.run=true;
}
};
this.setURLs=function(urls){
Begun.extend(ac.Strings.urls,urls||{});
};
this.setCallbacks=function(callbacks){
ac.Callbacks.register(callbacks||{});
};
this.setTpls=function(newTpls){
ac.Tpls.addTpls(newTpls);
};
};
})(Begun);

(function(){
var ac=Begun.Autocontext;

ac.onContent=function(f){
var u=navigator.userAgent,
e=false,
CHECK_TIME;
if(/webkit/i.test(u)){
setTimeout(function(){
var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){
f()
}else{
setTimeout(arguments.callee,CHECK_TIME);
}
},CHECK_TIME);
}else if((/mozilla/i.test(u)&&!/(compati)/.test(u))||(/opera/i.test(u))){
document.addEventListener("DOMContentLoaded",f,false);
}else if(e){
(function(){
var t=document.createElement('doc:rdy');
try{
t.doScroll('left');
f();
t=null;
}catch(e){
setTimeout(arguments.callee,0);
}
})();
}else{
Begun.Utils.addEvent(window,'load',function(){
f();
});
}
};

ac.onContent(function(){
ac.Callbacks.dispatch('blocks','draw',ac);
ac.domContentLoaded=true;
});

ac.Monitor.init();
})();
Begun.Autocontext.init();
}
};

if(typeof Begun.Autocontext==="object"){
Begun.Autocontext.init();
}

Begun.Scripts.addStrictFunction(Begun.Scripts.Callbacks['ac']);
}

if(typeof Begun.Scripts!=="object"){
(function(){
var scripts={
"begun_scripts":"508f4b3b74"
};

var baseUrl=(function(){
if(window.begun_urls&&window.begun_urls.base_scripts_url){
return window.begun_urls.base_scripts_url;
}else{
return"//autocontext.price.ru/";
}
}());

for(var scriptName in scripts){
if(scripts.hasOwnProperty(scriptName)){
document.write("<scr"+"ipt type=\"text/javascript\" src=\""+baseUrl+"acp/"+scriptName+"."+scripts[scriptName]+".js"+"\"></scr"+"ipt>");
}
}
})();
}else{
if(typeof Begun.Scripts.addStrictFunction!=="undefined"){
begun_load_autocontext();
}
}
