var topadvert_loader_domain="loader.topadvert.ru";var topadvert_hit_domain="hit.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+="</"+this.name+">";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;f<b.length;f++){g+=f?b[f].substring(0,1).toUpperCase()+b[f].substring(1):b[f]}h[g]=this.styles[d]}var c=this._get_inner_html();if(c){l.innerHTML=c}return l};this._get_style_str=function(){var c="";for(var b in this.styles){c+=b+":"+this.styles[b]+";"}return c};this._get_inner_html=function(){var b="";for(var c=0;c<this.childs.length;c++){b+=this.childs[c].to_string()}return b}}function TopadvertHtmlText(a){this.text=a;this.to_string=function(){return this.text}}var topadvert_params_array;if(topadvert_params_array==null){topadvert_params_array=[]}var topadvert_blocks;if(topadvert_blocks==null){topadvert_blocks=[]}var topadvert_request_id;if(topadvert_request_id==null){topadvert_request_id=0}var topadvert_blocks_map;if(topadvert_blocks_map==null){topadvert_blocks_map={}}var topadvert_before_onload_timer;var topadvert_isIE=navigator.appName.indexOf("Microsoft")!=-1;var topadvert_lock;if(topadvert_lock==null){topadvert_lock=false}var topadvert_is_body;if(topadvert_is_body==null){topadvert_is_body=false}var topadvert_is_draw;if(topadvert_is_draw==null){topadvert_is_draw=true}var topadvert_div_map;var topadvert_div_blocks_map;if(topadvert_div_blocks_map==null){topadvert_div_blocks_map={}}var topadvert_draw;var topadvert_auto_id;if(topadvert_auto_id==null){topadvert_auto_id=0}var topadvert_handled_textareas;if(topadvert_handled_textareas==null){topadvert_handled_textareas={}}var topadvert_is_opera;if(topadvert_is_opera==null){topadvert_is_opera=window.opera!=null&&window.opera.version!=null}var topadvert_is_webkit;if(topadvert_is_webkit==null){topadvert_is_webkit=/AppleWebKit\/\d+?\.\d+?\s/.test(""+navigator.userAgent)}if(topadvert_is_good_brower()){topadvert_init()}var topadvert_is_opera_lost_click_event;function topadvert_is_good_brower(){return typeof(encodeURIComponent)!="undefined"&&navigator.userAgent.indexOf("MSIE 5")==-1}function topadvert_init(){topadvert_load_params_array();topadvert_load_textareas();topadvert_load_textareas_sync();topadvert_div_init();if(topadvert_before_onload_timer==null){topadvert_before_onload_timer=setInterval(function(){topadvert_before_onload_handler()},100)}if(document.addEventListener){document.addEventListener("DOMContentLoaded",topadvert_onload,false)}}function topadvert_load_params_array(){var d=topadvert_params_array;topadvert_params_array=[];for(var b=0;b<d.length;b++){var c=d[b];var a={};a[TOPADVERT_BLOCK_PARAMS]=c[0];a[TOPADVERT_BLOCK_DIV_ID]=c[1]["div_id"];a[TOPADVERT_BLOCK_ALT_DIV_ID]=c[1]["alt_div_id"];a[TOPADVERT_BLOCK_IS_SYNC]=a[TOPADVERT_BLOCK_DIV_ID]==null||document.getElementById(a[TOPADVERT_BLOCK_DIV_ID])==null;topadvert_handle_block(a)}}function topadvert_load_textareas(){var a;while(a=topadvert_get_next_unhandled_textarea("topadvert_request")){var b=topadvert_get_basic_textarea_block(a);b[TOPADVERT_BLOCK_IS_SYNC]=b[TOPADVERT_BLOCK_DIV_ID]==null;topadvert_handle_block(b)}}function topadvert_load_textareas_sync(){var a;while(a=topadvert_get_next_unhandled_textarea("topadvert_request_sync")){var b=topadvert_get_basic_textarea_block(a);b[TOPADVERT_BLOCK_IS_SYNC]=true;topadvert_handle_block(b)}}function topadvert_load_textareas_async(){var a;while(a=topadvert_get_next_unhandled_textarea("topadvert_request_async")){var b=topadvert_get_basic_textarea_block(a);if(b[TOPADVERT_BLOCK_DIV_ID]!=null&&document.getElementById(b[TOPADVERT_BLOCK_DIV_ID])!=null){b[TOPADVERT_BLOCK_IS_SYNC]=false;topadvert_handle_block(b)}}}function topadvert_load_textareas_onclick(){var a;while(a=topadvert_get_next_unhandled_textarea("topadvert_request_onclick")){var c=a.id;if(c==null||c==""){c=topadvert_get_auto_id();a.id=c}var b=topadvert_get_link_elem(a);if(b){b.onclick=function(d){return function(f){f=f?f:window.event;topadvert_open_div(d,f,TOPADVERT_DIV_BIG_CLOSE_TIMEOUT,this);return false}}(c);b.onmouseout=function(d){return function(f){f=f?f:window.event;topadvert_internal_close_div(d,TOPADVERT_DIV_BIG_CLOSE_TIMEOUT)}}(c)}}}function topadvert_load_textareas_onmouseover(){var a;while(a=topadvert_get_next_unhandled_textarea("topadvert_request_onmouseover")){var c=a.id;if(c==null||c==""){c=topadvert_get_auto_id();a.id=c}var b=topadvert_get_link_elem(a);if(b){b.onclick=function(d){d=d?d:window.event;return false};b.onmouseover=function(d){return function(f){f=f?f:window.event;topadvert_open_div(d,f,TOPADVERT_DIV_SMALL_CLOSE_TIMEOUT,this)}}(c);b.onmouseout=function(d){return function(f){f=f?f:window.event;topadvert_internal_close_div(d,TOPADVERT_DIV_SMALL_CLOSE_TIMEOUT)}}(c)}}}function topadvert_get_link_elem(b){var c=null;var a=10;while(a>0&&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";var b="";for(var c in d){var g=d[c];b+="&"+c+"="+encodeURIComponent(g==null?"":""+g)}var f="http://"+topadvert_hit_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('<script type="text/javascript" charset="windows-1251" src="'+f+'"><\/script>')}else{var e=f.replace(/'/g,"\\'");setTimeout("topadvert_append_script('"+e+"')",100)}}}function topadvert_end_draw(b){if(!topadvert_blocks_map[b][TOPADVERT_BLOCK_IS_LOAD]){topadvert_is_draw=false;for(var a in topadvert_blocks_map){topadvert_alt_draw(a)}}}function topadvert_alt_draw(d){var a=topadvert_blocks_map[d];if(!a[TOPADVERT_BLOCK_IS_LOAD]){var c=a[TOPADVERT_BLOCK_ALT_DIV_ID];if(c!=null){a[TOPADVERT_BLOCK_IS_LOAD]=true;var b=document.getElementById(c);if(b!=null){b.style.display="block"}}}}function topadvert_request_handler(b,f,g){topadvert_lock=false;if(g==null){g={}}var j=topadvert_blocks_map[b];if(!j[TOPADVERT_BLOCK_IS_LOAD]){g.div_id=j[TOPADVERT_BLOCK_DIV_ID];g.alt_div_id=j[TOPADVERT_BLOCK_ALT_DIV_ID];var c=topadvert_draw(f,g);if(c==null||c==""){if(g.alt_text!=null&&g.alt_text!=""){c=g.alt_text}}var d=j[TOPADVERT_BLOCK_DIV_TEXTAREA_ID];var h;if(c!=null&&c!=""){j[TOPADVERT_BLOCK_IS_LOAD]=true;if(d==null){var e=j[TOPADVERT_BLOCK_DIV_ID];var i=e!=null&&e!="";var a=i?document.getElementById(e):null;if(a==null){if(j[TOPADVERT_BLOCK_IS_SYNC]){if(i){document.write('<div id="'+e+'">'+c+"</div>")}else{document.write(c)}}}else{a.innerHTML=c;a.style.display="block"}}else{h=topadvert_div_blocks_map[d];if(h!=null){h.html=c;h.is_loaded=true;if(g.location_horizontal!=null){h.location_horizontal=g.location_horizontal}if(g.location_vertical!=null){h.location_vertical=g.location_vertical}if(g.shift_horizontal!=null){h.shift_horizontal=parseInt(g.shift_horizontal)}if(g.shift_vertical!=null){h.shift_vertical=parseInt(g.shift_vertical)}if(!topadvert_is_webkit&&!topadvert_is_opera){if(h.a!=null){h.a.style.cursor="pointer"}}if(h.status>0){h.status--;topadvert_internal_open_div(d,null,null,null)}}}}else{if(d==null){topadvert_alt_draw(b)}else{h=topadvert_div_blocks_map[d];if(h!=null){if(!topadvert_is_webkit&&!topadvert_is_opera){if(h.a!=null){h.a.style.cursor="pointer"}}}}}}}function topadvert_append_script(b){var a=document.createElement("script");a.charset="windows-1251";a.defer="defer";a.src=b;topadvert_get_head().appendChild(a)}function topadvert_get_head(){var a=document.getElementsByTagName("head")[0];if(a==null){a=document.createElement("head");document.getElementsByTagName("html")[0].appendChild(a)}return a}function topadvert_create_div(){var a=new TopadvertHtmlElement("div");a.set_style("display","block");a.set_style("visibility","visible");a.set_style_sides("margin","","0");a.set_style("text-align","left");a.set_style_sides("border","style","solid");a.set_style_sides("border","width","0");a.set_style("vertical-align","top");a.set_style("white-space","normal");a.set_style("clear","none");a.set_style("float","none");a.set_style("width","");a.set_style("height","");return a}function topadvert_create_table(){var a=new TopadvertHtmlElement("table");a.set_style("visibility","visible");a.set_style("border-collapse","separate");a.set_style("border-spacing","0");a.set_attribute("cellpadding","0");a.set_attribute("cellspacing","0");a.set_style_sides("margin","","0");a.set_style_sides("padding","","0");a.set_style_sides("border","style","solid");a.set_style_sides("border","width","0");a.set_style("clear","none");return a}function topadvert_create_tr(){var a=new TopadvertHtmlElement("tr");a.set_style("visibility","visible");a.set_attribute("valign","top");a.set_style_sides("margin","","0");a.set_style_sides("padding","","0");a.set_style_sides("border","style","solid");a.set_style_sides("border","width","0");a.set_style("clear","none");return a}function topadvert_create_td(){var a=new TopadvertHtmlElement("td");a.set_style("visibility","visible");a.set_style_sides("margin","","0");a.set_style_sides("padding","","0");a.set_style_sides("border","style","solid");a.set_style_sides("border","width","0");a.set_style("text-align","left");a.set_style("vertical-align","top");a.set_style("clear","none");return a}function topadvert_create_a(){var b=new TopadvertHtmlElement("a");b.set_style("visibility","visible");b.set_style_sides("margin","","0");b.set_style_sides("padding","","0");b.set_attribute("target","_blank");b.set_style("text-decoration","underline");return b}function topadvert_create_img(){var a=new TopadvertHtmlElement("img");a.set_style("visibility","visible");a.set_style("float","none");a.set_style_sides("margin","","0");a.set_style_sides("padding","","0");a.set_attribute("hspace","0");a.set_attribute("vspace","0");a.set_style_sides("border","width","0");return a}function topadvert_create_span(){var a=new TopadvertHtmlElement("span");a.set_style("visibility","visible");return a}function topadvert_create_1x1_img(){var a=topadvert_create_img();a.set_attribute("width","1");a.set_attribute("height","1");a.set_attribute("src","http://"+topadvert_loader_domain+"/1x1.gif");return a}function topadvert_pattern_4(g,k){if(g==null){return null}var n=null;var d=k.div_id;if(d==null||d==""){d=topadvert_get_random_id();k.div_id=d}var h=g.items;var m=Math.min(h.length,k.limit);if(m>0){n="";n+='<table width="100%" class="'+d+'_main">';n+='<tr valign="top"><td class="'+d+'_main">';n+='<table width="100%" class="'+d+'_main_content">';if(k.ref_valign=="top"){n+=topadvert_pattern_4_ref(g,k)}n+='<tr valign="top"><td class="'+d+'_main_content">';n+='<table width="100%" class="'+d+'_item">';if(k.type=="horizontal"){var j=Math.floor(100/m)+"%";n+='<tr valign="top">';for(var b=0;b<m;b++){var l=h[b];if(k.is_items_distance&&b>0){n+='<td width="1"><div class="'+d+'_items_distance">&nbsp;</div></td>'}n+='<td width="'+j+'" class="'+d+'_item">';n+=topadvert_pattern_4_item(g,k,l);n+="</td>"}n+="</tr>"}else{for(var b=0;b<m;b++){var l=h[b];if(k.is_items_distance&&b>0){n+='<tr><td height="1"><div class="'+d+'_items_distance">&nbsp;</div></td></tr>'}n+='<tr valign="top"><td class="'+d+'_item">';n+=topadvert_pattern_4_item(g,k,l);n+="</td></tr>"}}n+="</table>";n+="</td></tr>";if(k.ref_valign=="bottom"){n+=topadvert_pattern_4_ref(g,k)}n+="</table>";n+="</td></tr>";n+="</table>";var a=document.createElement("style");a.type="text/css";var c=k.css;c=c.replace(/%div_id%/g,k.div_id);c=c.replace(/%item_width%/g,j);if(a.styleSheet){try{a.styleSheet.cssText=c;document.getElementById("a1").innerHTML=escapeHTML(c);document.getElementById("a2").innerHTML=escapeHTML(n)}catch(f){}}else{a.textContent=c}topadvert_get_head().appendChild(a)}else{if(k.alt_text!=null&&k.alt_text!=""){n=k.alt_text}}return n}function escapeHTML(a){if(!a){return""}return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")}function topadvert_pattern_4_item(f,g,h){var i="";var d=g.div_id;var c=g.topics_map[h.topic_id];var e=c!=null&&c.title_is_link=="1";var a=c!=null&&c.image_is_link=="1";if(g.draw_images&&(h.is_image||g.image_is_empty)){i+='<div style="float: left">';if(a){i+=topadvert_pattern_4_item_open_a(f,g,h.url)}i+='<img src="'+h.image+'" alt=""/>';if(a){i+="</a>"}i+="</div>"}if(g.is_title_margin){i+=topadvert_pattern_4_title_margin(f,g)}i+='<div class="'+d+'_title">';if(e){i+=topadvert_pattern_4_item_open_a(f,g,h.url)}i+=h.title;if(e){i+="</a>"}i+="</div>";if(h.type!=2){if(g.is_description_margin){i+='<div class="'+d+'_description_margin">&nbsp;</div>'}else{i+="<br/>"}i+='<div class="'+d+'_description">'+h.description+"</div>"}if(g.is_cost_text_margin){i+='<div class="'+d+'_cost_text_margin">&nbsp;</div>'}else{i+="<br/>"}var b=h.cost_text;b=b.replace(/<a>/gi,topadvert_pattern_4_item_open_a(f,g,h.url));i+='<div class="'+d+'_cost_text">'+b+"</div>";return i}function topadvert_pattern_4_ref(b,a){var c=a.div_id;return'<tr><td class="'+c+'_ref">'+topadvert_pattern_4_item_open_a(b,a,b.ref_url)+"Рекламная сеть Topadvert</a></td></tr>"}function topadvert_pattern_4_title_margin(b,a){var c=a.div_id;return'<div class="'+c+'_title_margin">&nbsp;</div>'}function topadvert_pattern_4_item_open_a(c,b,a){return"<a"+(b.is_blank?' target="_blank"':"")+' href="'+a+'">'}function topadvert_get_random_id(){return("topadvert_"+Math.random()).replace(/0?\./g,"")}function topadvert_get_auto_id(){return"topadvert_auto_id_"+(++topadvert_auto_id)}function topadvert_div_init(){if(topadvert_div_map!=null){var a=topadvert_div_map;topadvert_div_map=null;for(var b in a){topadvert_create_div_block(b,a[b],null,null)}}}function topadvert_create_div_block(c,g,b,h){var i=document.getElementById(c);if(i!=null){var j={};j[TOPADVERT_BLOCK_DIV_TEXTAREA_ID]=c;j[TOPADVERT_BLOCK_IS_SYNC]=false;var e={};e.request=topadvert_get_textarea_value(i);j[TOPADVERT_BLOCK_PARAMS]=e;var f={};f.textarea=i;f.status=g==null?0:1;f.coords=g;f.close_timeout=b;f.location_horizontal="right";f.location_vertical="bottom";f.shift_horizontal=5;f.shift_vertical=-5;f.is_loaded=false;f.onmouseover=true;f.requests_count=0;if(!topadvert_is_webkit&&!topadvert_is_opera){if(h!=null){f.a=h;f.a.style.cursor="wait"}}f.topadvert_block=j;topadvert_div_blocks_map[c]=f;topadvert_add_params_element(j);var d;d=setInterval(function(){if(f.is_loaded||f.requests_count>=2){clearInterval(d)}else{if(f.status>0){f.requests_count++;topadvert_send_topadvert_block_request(f.topadvert_block)}}},3000)}}function topadvert_internal_open_div(l,n,p,t){var v=topadvert_div_blocks_map[l];if(v==null){topadvert_create_div_block(l,n,p,t)}else{if(v.status<0){v.status=0}v.status++;if(v.is_loaded){if(n!=null){v.coords=n}if(v.html!=null){var j=v.div;if(j==null){var g=topadvert_create_div();g.set_style("display","none");g.set_style("z-index","1000000");g.set_style("position","absolute");g.set_style("background","white");var i=topadvert_create_div();i.set_style_sides("border","width","1px");i.set_style_sides("border","color","black");var o=topadvert_create_table();o.set_style("width","1px");var u=topadvert_create_tr();var f=topadvert_create_td();f.set_style("line-height","0");f.set_attribute("nowrap","true");f.set_attribute(topadvert_get_is_opera_lost_click_event()?"onmouseup":"onclick","topadvert_internal_full_close_div('"+l+"')");f.set_attribute("align","right");f.set_style("text-align","right");var w=topadvert_create_img();w.set_style("width","12px");w.set_style("height","12px");w.set_attribute("src","http://"+topadvert_loader_domain+"/x.gif");f.append_child(w);u.append_child(f);o.append_child(u);var s=topadvert_create_tr();var e=topadvert_create_td();e.set_attribute("nowrap","true");e.set_style("padding-right","12px");e.set_style("padding-bottom","12px");e.set_style("padding-left","12px");e.append_text(v.html);s.append_child(e);o.append_child(s);i.append_child(o);var k=v.textarea;g.append_child(i);j=g.to_document_element();j.onmouseover=function(a){a=a?a:window.event;v.onmouseover=true;topadvert_internal_open_div(l,null,null)};var d=v.close_timeout?v.close_timeout:TOPADVERT_DIV_SMALL_CLOSE_TIMEOUT;j.onmouseout=function(a){a=a?a:window.event;v.onmouseover=false;topadvert_internal_close_div(l,d)};j.innerHTML=j.innerHTML;var h=document.getElementsByTagName("body")[0];if(h==null){k.parentNode.insertBefore(j,k)}else{h.insertBefore(j,h.firstChild)}v.div=j}if(j.style.display=="none"){var q=v.coords;if(q!=null){j.style.visibility="hidden";j.style.display="block";var m=v.div_width;if(m==null){m=j.offsetWidth;v.div_width=m}j.style.width=m+"px";var r=document.getElementsByTagName("body")[0];if(r!=null){if(v.location_horizontal=="right"){if(q[0]+m+v.shift_horizontal>r.scrollLeft+document.documentElement.scrollLeft+r.clientWidth){j.style.left=(q[0]-m-v.shift_horizontal)+"px"}else{j.style.left=(q[0]+v.shift_horizontal)+"px"}}else{if(m+v.shift_horizontal>q[0]){j.style.left=(q[0]+v.shift_horizontal)+"px"}else{j.style.left=(q[0]-m-v.shift_horizontal)+"px"}}if(v.location_vertical=="bottom"){if(q[1]+j.offsetHeight+v.shift_vertical>r.scrollTop+document.documentElement.scrollTop+r.clientHeight){j.style.top=(q[1]-j.offsetHeight-v.shift_vertical)+"px"}else{j.style.top=(q[1]+v.shift_vertical)+"px"}}else{if(j.offsetHeight+v.shift_vertical>q[1]){j.style.top=(q[1]+v.shift_vertical)+"px"}else{j.style.top=(q[1]-j.offsetHeight-v.shift_vertical)+"px"}}}j.style.display="none";j.style.visibility="visible";j.style.width=m+"px"}topadvert_internal_close_all();j.style.display="block"}}}else{topadvert_send_topadvert_block_request(v.topadvert_block)}}}function topadvert_internal_close_all(){for(var c in topadvert_div_blocks_map){var a=topadvert_div_blocks_map[c];var b=a.div;if(b!=null){b.style.display="none"}}}function topadvert_internal_close_div(d,b){var a=topadvert_div_blocks_map[d];if(a!=null){a.status--;if(a.status<=0){a.status=0;if(a.div!=null){var c=a.timeout;if(c){clearTimeout(c)}if(b){a.timeout=setTimeout(function(){topadvert_internal_delay_close_div(d)},b)}else{a.timeout=null;topadvert_internal_delay_close_div(d)}}}}}function topadvert_internal_full_close_div(c){var a=topadvert_div_blocks_map[c];if(a!=null){var b=a.div;a.status=0;b.style.display="none"}}function topadvert_internal_delay_close_div(b){var a=topadvert_div_blocks_map[b];if(a!=null){if(a.status==0){a.div.style.display="none"}}}function topadvert_get_textarea_value(a){return a.value.replace(/\s+/g," ")}function topadvert_open_div(g,f,c,b){var d=topadvert_create_coords(f);topadvert_internal_open_div(g,d,c,b)}function topadvert_close_div(a){topadvert_internal_close_div(a,TOPADVERT_DIV_SMALL_CLOSE_TIMEOUT)}function topadvert_create_coords(b){var a=0;var c=0;if(b.pageX||b.pageY){a=b.pageX;c=b.pageY}else{if(b.clientX||b.clientY){a=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;c=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}if(a<0){a=0}if(c<0){c=0}return[a,c]}function topadvert_get_basic_textarea_block(g){var k={};var f={};f.request=topadvert_get_textarea_value(g);k[TOPADVERT_BLOCK_PARAMS]=f;var a=null;var i=null;var c=g;var j=false;var d=10;while(d>0&&(a==null||i==null)&&c!=null){d--;if(j){c=c.parentNode;j=false;continue}if(c.nextSibling==null){j=true;continue}c=c.nextSibling;if(c.nodeType==1){j=true;var b=c.tagName.toLowerCase();if(b=="div"){if(a==null&&/topadvert_div/.test(c.className)){a=c;j=false}if(i==null&&/topadvert_alt_div/.test(c.className)){i=c;j=false}}}}if(a!=null){var e=a.id;if(e==null||e==""){e=topadvert_get_auto_id();a.id=e}k[TOPADVERT_BLOCK_DIV_ID]=e}if(i!=null){var h=i.id;if(h==null||h==""){h=topadvert_get_auto_id();i.id=h}k[TOPADVERT_BLOCK_ALT_DIV_ID]=h}return k}function topadvert_handle_block(a){if(a[TOPADVERT_BLOCK_IS_SYNC]){topadvert_add_params_element(a)}else{topadvert_blocks.push(a)}}function topadvert_get_next_unhandled_textarea(e){var g=topadvert_handled_textareas[e];if(g==null){g=[];topadvert_handled_textareas[e]=g}var a=document.getElementsByName(e);for(var f=0;f<a.length;f++){var b=a[f];var c=false;for(var d=0;d<g.length;d++){if(b==g[d]){c=true;break}}if(!c){g.push(b);return b}}return null}function topadvert_get_is_opera_lost_click_event(){if(topadvert_is_opera_lost_click_event==null){topadvert_is_opera_lost_click_event=topadvert_is_opera&&window.opera.version()>9.27}return topadvert_is_opera_lost_click_event};