var topadvert_loader_domain="loader.topadvert.ru";var topadvert_feed_domain="feed.topadvert.ru";var TOPADVERT_BLOCK_PARAMS="request_params";var TOPADVERT_BLOCK_DIV_ID="div_id";var TOPADVERT_BLOCK_ALT_DIV_ID="alt_div_id";var TOPADVERT_BLOCK_IS_LOAD="is_load";var TOPADVERT_BLOCK_IS_SYNC="is_sync";var TOPADVERT_BLOCK_DIV_TEXTAREA_ID="textarea_id";var TOPADVERT_BLOCK_REQUEST_ID="request_id";var TOPADVERT_NOT_ALLOWED_LOAD="not_allowed_load";var TOPADVERT_DIV_SMALL_CLOSE_TIMEOUT=500;var TOPADVERT_DIV_BIG_CLOSE_TIMEOUT=5000;function TopadvertHtmlElement(a){this.name=a;this.attributes={};this.styles={};this.childs=[];this.class_name="";this.set_attribute=function(b,c){this.attributes[b]=c};this.set_style=function(b,c){this.styles[b]=c};this.set_style_sides=function(c,b,e){var d=c+"-";var f=b?"-"+b:"";this.styles[d+"top"+f]=e;this.styles[d+"right"+f]=e;this.styles[d+"bottom"+f]=e;this.styles[d+"left"+f]=e};this.set_class_name=function(b){this.class_name=b};this.append_child=function(b){this.childs.push(b)};this.append_text=function(b){this.childs.push(new TopadvertHtmlText(b))};this.to_string=function(){var c="";c+="<"+this.name;for(var b in this.attributes){c+=" "+b+'="'+this.attributes[b]+'"'}if(this.class_name){c+=' class="'+this.class_name+'"'}c+=' style="'+this._get_style_str()+'">';c+=this._get_inner_html();c+="";return c};this.to_document_element=function(){var l=document.createElement(this.name);for(var d in this.attributes){var j=this.attributes[d];if(/^on/.test(d)){l[d]=new Function(j)}else{l[d]=j}}var h=l.style;for(var d in this.styles){var g="";var b=d.split("-");for(var f=0;f0&&b!=null){a--;if(b.nextSibling){b=b.nextSibling}else{b=b.parentNode;continue}if(b!=null&&b.nodeType==1){c=b;break}}return c}function topadvert_onload(){topadvert_is_body=true}function topadvert_before_onload_handler(){if(document.readyState&&/complete/.test(document.readyState)){topadvert_is_body=true}topadvert_load_textareas_async();topadvert_load_textareas_onclick();topadvert_load_textareas_onmouseover();while((topadvert_is_body||(topadvert_isIE&&(!topadvert_is_draw||!topadvert_lock)))&&topadvert_blocks.length>0){topadvert_lock=true;topadvert_add_params_element(topadvert_blocks.shift())}if(topadvert_is_body){clearInterval(topadvert_before_onload_timer)}}function topadvert_add_params_element(a){if(!a[TOPADVERT_BLOCK_IS_LOAD]){a[TOPADVERT_BLOCK_IS_LOAD]=false;var b=++topadvert_request_id;a[TOPADVERT_BLOCK_REQUEST_ID]=b;topadvert_blocks_map[b]=a;if(!topadvert_is_draw&&a[TOPADVERT_BLOCK_ALT_DIV_ID]!=null){topadvert_alt_draw(b)}else{topadvert_send_topadvert_block_request(a)}}}function topadvert_send_topadvert_block_request(a){if(!a[TOPADVERT_NOT_ALLOWED_LOAD]){a[TOPADVERT_NOT_ALLOWED_LOAD]=true;var d=a[TOPADVERT_BLOCK_PARAMS];d.document_title=document.title;d.referer=document.referrer;d.request_id=a[TOPADVERT_BLOCK_REQUEST_ID];d.nocache=Math.random();d.encode="encodeuricomponent";d.response_encoding="utf-8";var b="";for(var c in d){var g=d[c];b+="&"+c+"="+encodeURIComponent(g==null?"":""+g)}var f="http://"+topadvert_feed_domain+"/feed?response_type=js"+b;setTimeout(function(){topadvert_end_draw(a[TOPADVERT_BLOCK_REQUEST_ID]);a[TOPADVERT_NOT_ALLOWED_LOAD]=false},5000);if(a[TOPADVERT_BLOCK_IS_SYNC]){document.write('