var m_timeout=500;var m_closetimer=0;var m_catmenu=0;var m_scatmenu=0;var staticbar_control=0;var showadres=new Array();function mopen(c,b){mcancelclosetime();window.onclick=function(){mclose()};var a=document.getElementById(c);a.style.visibility="visible";if(b){if(m_scatmenu!=a){mclose(b);m_scatmenu=a}}else{m_catmenu=a}ie6select("hidden")}function mclose(a){mcancelclosetime();if(a){if(m_scatmenu){m_scatmenu.style.visibility="hidden"}}else{if(m_scatmenu){m_scatmenu.style.visibility="hidden"}if(m_catmenu){m_catmenu.style.visibility="hidden"}window.onclick=undefined}ie6select("visible")}function mclosetime(){mcancelclosetime();m_closetimer=window.setTimeout(mclose,m_timeout)}function mcancelclosetime(){if(m_closetimer){window.clearTimeout(m_closetimer);m_closetimer=null}}function grayOut(l,n){var h=document.getElementById(l);if(!h){return}var n=n||{};var m=n.zindex||50;var g=n.opacity||70;var f=(g/100);var o=n.bgcolor||"#000";var b=n.noscroll||2;var d=100;if(n.offset){d+=n.offset}if(n.dark){var j=document.getElementById("darkenScreenObject");if(!j){var e=document.getElementsByTagName("body")[0];var a=document.createElement("div");a.style.position="absolute";a.style.top="0px";a.style.left="0px";a.style.overflow="hidden";a.style.display="none";a.id="darkenScreenObject";e.appendChild(a);j=document.getElementById("darkenScreenObject")}}if(h.style.display!="block"){if(n.dark){if(window.innerHeight&&window.scrollMaxY){var c=window.innerHeight+window.scrollMaxY;var k=window.innerWidth+window.scrollMaxX}else{if(document.body.scrollHeight>document.body.offsetHeight){var c=document.body.scrollHeight;var k=document.body.scrollWidth}else{var c=document.body.offsetHeight;var k=document.body.offsetWidth}}if(c&&k){j.style.opacity=f;j.style.MozOpacity=f;j.style.filter="alpha(opacity="+g+")";j.style.zIndex=m;j.style.backgroundColor=o;j.style.width=k+"px";j.style.height=c+"px";j.style.display="block"}}staticbar(l,d,1,b);h.style.zIndex=m+1;h.style.display="block"}else{h.style.display="none";if(n.dark){j.style.display="none"}staticbar_control=0}}function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}function staticbar(e,c,a,f){bar_src=document.getElementById(e);if(!bar_src){return}staticbar_control=1;bar_src.style.display="block";barheight=bar_src.offsetHeight;var b=(navigator.appName.indexOf("Netscape")!=-1)||window.opera;var g=document;function h(j){var d=g.getElementById(j);if(g.layers){d.style=d}d.sP=function(k,l){this.style.top=l+"px"};d.y=c;return d}window.stayTopLeft=function(){var d=b?pageYOffset:iecompattest().scrollTop;if(f==3){ftlObj.y+=d-ftlObj.y}else{ftlObj.y+=(d-ftlObj.y)/8}if(ftlObj.y<=c&&f==1){staticbar_control=0}else{if(ftlObj.y<c){ftlObj.y=c}else{if(f==2){ftlObj.y+=d-ftlObj.y+c}else{if(a){ftlObj.y+=c/8}}}}ftlObj.sP(ftlObj.x,ftlObj.y);if(staticbar_control==1){if(f==3){window.onscroll=function(){stayTopLeft()}}else{setTimeout("stayTopLeft()",10)}}};ftlObj=h(e);stayTopLeft()}function getlocation(b){var c=0;var a=0;while(b){a+=b.offsetLeft;c+=b.offsetTop;b=b.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){a+=document.body.leftMargin;c+=document.body.topMargin}return({x:a,y:c})}function locshowad(d){var b=document.getElementById(d);var c=document.getElementById("location_"+d);if(!c){return}var a=getlocation(c);b.style.top=a.y+"px";b.style.left=a.x+"px";b.style.display="block"}function showad(src){var res="";var found=0;var len=showadres.length;for(var i=0;i<len;i++){if(showadres[i]==src){found=1}locshowad(showadres[i]);res+='showad("'+showadres[i]+'");'}if(found==0&&src!=0){locshowad(src);res+='showad("'+src+'");';showadres.push(src)}window.onresize=null;window.onresize=function(){eval(res)}}function fxmlhttp_create(){var a=false;if(!a&&typeof XMLHttpRequest!="undefined"){try{a=new XMLHttpRequest()}catch(c){a=false}}if(!a&&window.createRequest){try{a=window.createRequest()}catch(c){a=false}}if(!a){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=false}}}if(!a){alert("Javascript не работает на этом Браузере! Обновите свой Браузер.");return false}return(a)}function fxmlhttp(id,src,type,input,donext){var foc=document.getElementById(id);if(!foc){foc=document.createElement("div");foc.setAttribute("id",id);document.body.appendChild(foc)}var xmlhttp=fxmlhttp_create(src);document.body.style.cursor="wait";if(type=="get"||!type){xmlhttp.open("GET",src,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){foc.innerHTML=xmlhttp.responseText;eval(donext);document.body.style.cursor="default"}};xmlhttp.send(null)}else{if(type=="post"){var params="";if(input){var count=input.elements.length;for(var i=0;i<count;i++){params+=input.elements[i].name+"="+encodeURI(input.elements[i].value)+"&"}}xmlhttp.open("POST",src,true);xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-length",params.length);xmlhttp.setRequestHeader("Connection","close");xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4&&xmlhttp.status==200){foc.innerHTML=xmlhttp.responseText;eval(donext);document.body.style.cursor="default"}};xmlhttp.send(params)}}}function formloading(e,a,c){var c=c||{};if(e){var d=e.elements.length;for(i=0;i<d;i++){e.elements[i].disabled=true}}if(a){var b=document.getElementById(a);if(!b){return}if(c.open){b.style.display="block";if(c.input){b.innerHTML=c.input}}else{if(c.close){b.style.display="none"}else{b.innerHTML='<img src="http://gorodnet.ru/images/spinningprogress.gif" alt="Загрузка...">'}}}}function pageloadingoff(){setTimeout("formloading(0, 'loading', {'close': 1})",1000)}function contactform(){showcontact("gorodnet",0)}function showcontact(b,d){var a="xmlcontact_"+b;var c='{"noscroll":3}';if(b=="gorodnet"){c="{}"}fxmlhttp("xmlhttp_"+a,"/contact.php?contact="+b+"&showadid="+d,"get",false,'grayOut("'+a+'",'+c+")")}function showadpics(a){document.body.style.cursor="wait";document.getElementById("adpicsloading").style.visibility="visible";document.mainImage.src=a;setTimeout("document.getElementById('adpicsloading').style.visibility='hidden';document.body.style.cursor='default';",1000);return false}function searchbox(b,a){var c="Поиск Объявлений...";if(b=="focus"){if(a.value==c){a.value=""}a.style.fontWeight="bold";a.style.color="#000";document.getElementById("submitsearch").style.borderColor=a.style.borderColor="#33677F"}else{if(b=="blur"){if(a.value==""){a.value=c;a.style.fontWeight="normal";a.style.color="#999"}document.getElementById("submitsearch").style.borderColor=a.style.borderColor=""}else{if(b=="over"){document.getElementById("submitsearch").style.borderColor=a.style.borderColor="#35ABD8"}else{if(b=="out"){document.getElementById("submitsearch").style.borderColor=a.style.borderColor=""}else{if(b=="sort"||b=="search_date"){document.f.elements[b].value=a.options[a.selectedIndex].value;document.f.submit()}}}}}}function fhover(h,b,f){if(h=="ads"){var e=document.getElementById("ads");if(e){var a=e.getElementsByTagName("li");for(var d=0;d<a.length;d++){a[d].onmouseover=function(){this.style.background="#fff url(http://gorodnet.ru/images/clistbg.gif) repeat-x scroll 0 100%";this.style.padding="9px 5px 9px 5px";this.style.border="2px solid #7BCBFC"};a[d].onmouseout=function(){this.style.background="";this.style.paddingBottom="10px";this.style.border="2px solid #fff";this.style.borderBottom="1px solid #e7e7e7";imgpopup(this,"")}}}}else{if(h=="header"){var g=b.getElementsByTagName("span");var c=g.length;for(var d=0;d<c;d++){if(g[d].className=="a"){if(f){g[d].style.backgroundPosition="100% -30px";g[d].style.color="#fff"}else{g[d].style.backgroundPosition="100% 0";g[d].style.color=""}}else{if(g[d].className=="b"){if(f){g[d].style.backgroundPosition="0 -30px"}else{g[d].style.backgroundPosition="0 0"}}}}}}}function selectads(c,b){var b=b||{};var a="/selectads.php";var d=false;if(c=="city"){var e=b.id||b.foc.options[b.foc.selectedIndex].value;a+="?scountryid="+e;d=true}else{if(c=="cat"){a+="?scityid="+b.cityid;if(xsearchmode==1){a+="&xsearch="+encodeURI(document.getElementById("search").value)}d=true;document.getElementById("selectcity").style.display="none"}else{if(c=="off"){ie6select("visible");document.getElementById("select"+b.foc).style.display="none"}else{d=true}}}if(d){var c=c||"city";ie6select("hidden");fxmlhttp("xmlhttp_selectads",a,"get",false,'document.getElementById("select'+c+'").style.display="block"')}}function ie6select(d){if(navigator.appVersion.indexOf("MSIE")==-1){return}var b=parseFloat(navigator.appVersion.split("MSIE")[1]);if(b>6.9){return}var a=document.documentElement.getElementsByTagName("select");for(var c=0;c<a.length;c++){a[c].style.visibility=d}}function imgpopup(d,b){var a=document.getElementById("imgpopup");if(!b){a.style.display=a.innerHTML="";return}if(a.style.display=="block"){return}var c=getlocation(d);a.innerHTML='<img src="/pics/'+b+'">';a.style.left=c.x+"px";a.style.top=c.y+"px";a.style.display="block"};