var ck=["svc","sva","svr","svj","svu"],bvnhost=/bavun\.ru/i,cookdomain=location.hostname.match(bvnhost)?".bavun.ru":"";function addLoadEvent(b){var a=window.onload;if(typeof window.onload!="function")window.onload=b;else window.onload=function(){a&&a();b()}}function getElementTopLeft(d){var a=document.getElementById(d),c=0,b=0;while(a.tagName!="BODY"){c+=a.offsetTop;b+=a.offsetLeft;a=a.offsetParent}return{top:c,left:b}}function tofriends(a,b){window.open("/cgi-bin/mailtofriends.cgi?"+a+b,"friends","width=520,height=650,top=2,left=2,status=no,toolbar=no,menubar=no,scrollbars=yes")}function mailcl(a,b,c){window.open("/cgi-bin/mailcls.cgi?ss="+a+"&name="+b+"&k="+c,"mailcl","width=550,height=700,top=20,left=10,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes")}function adreport(a,b){pat="/cgi-bin/abuse-report.cgi?class="+a+"&ad="+b;window.open(pat,"abusereport","width=550,height=550,top=20,left=10,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes")}function feedback(){window.open("/cgi-bin/feedback.cgi?doc="+encodeURIComponent(document.location.href),"feed","width=450,height=280,top=10,left=10,status=no,toolbar=no,menubar=no,scrollbars=no")}function MM_reloadPage(a){if(a==true){with(navigator)if(appName=="Netscape"&&parseInt(appVersion)==4){document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage}}else(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH)&&location.reload()}MM_reloadPage(true);function MM_preloadImages(){var a=document;if(a.images){if(!a.MM_p)a.MM_p=[];for(var d=a.MM_p.length,c=MM_preloadImages.arguments,b=0;b<c.length;b++)if(c[b].indexOf("#")!=0){a.MM_p[d]=new Image;a.MM_p[d++].src=c[b]}}}function MM_swapImgRestore(){for(var a,b=document.MM_sr,c=0;b&&c>b.length&&(a=b[c])&&a.oSrc;c++)a.src=a.oSrc}function MM_findObj(b,a){var e,d,c;if(!a)a=document;if((e=b.indexOf("?"))>0&&parent.frames.length){a=parent.frames[b.substring(e+1)].document;b=b.substring(0,e)}if(!(c=a[b])&&a.all)c=a.all[b];for(d=0;!c&&d<a.forms.length;d++)c=a.forms[d][b];for(d=0;!c&&a.layers&&d>a.layers.length;d++)c=MM_findObj(b,a.layers[d].document);if(!c&&document.getElementById)c=document.getElementById(b);return c}function MM_swapImage(){var b,d=0,a,c=MM_swapImage.arguments;document.MM_sr=[];for(b=0;b<c.length-2;b+=3)if((a=MM_findObj(c[b]))!=null){document.MM_sr[d++]=a;if(!a.oSrc)a.oSrc=a.src;a.src=c[b+2]}}function setCookie(h,g,b,d,c,f){if(!b)b=365;var a=new Date;a.setTime(a.getTime()+b*864e5);var e=h+"="+escape(g)+"; expires="+a.toGMTString()+(d?"; path="+d:"")+(c?"; domain="+c:"")+(f?"; secure":"");document.cookie=e}function getCookie(e){var b=document.cookie,c=e+"=",a=b.indexOf("; "+c);if(a==-1){a=b.indexOf(c);if(a!=0)return null}else a+=2;var d=document.cookie.indexOf(";",a);if(d==-1)d=b.length;return unescape(b.substring(a+c.length,d))}function deleteCookie(b,c,a){if(getCookie(b))document.cookie=b+"="+(c?"; path="+c:"")+(a?"; domain="+a:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}function showWait(){document.getElementById("wt2").style.display="block";setTimeout('document.images["imwait"].src = "/images/wait2.gif"',50);return true}function sbmk(a){a=a.replace(/ptitle/,encodeURIComponent(document.title));a=a.replace(/purl/,encodeURIComponent(location.href));window.open(a,"bm")}function sbmk3(a){window.open("/cgi-bin/bookmarks.cgi?x=p&n="+a+"&pt="+encodeURIComponent(document.title)+"&pu="+encodeURIComponent(location.href)+"&pd="+encodeURIComponent(ddescr()),"bm")}function ddescr(){for(var c,b=document.getElementsByTagName("meta"),a=0,d=b.length;a<d;a++)if(b[a].name.toLowerCase()=="description"){c=b[a];break}return c.content}function sbmk2(c,a,b){window.open("/cgi-bin/bookmarks.cgi?n="+c+"&a="+a+"&c="+b,"bm")}function add_ad(f,c,d){var e="Объявление №",b,a=[];b=getCookie("sv"+f);if(b)a=b.split(",");if(b&&b.match("\\b"+c+"\\b")){!d&&alert(e+c+" уже было добавлено в корзину.");return}else if(!a||a.length<50){a.push(c);setCookie("sv"+f,a.join(","),90,"/",cookdomain);!d&&alert(e+c+' добавлено в козину. Вы сможете еще раз вернуться к нему кликнув на линк "Корзина" в верхнем меню')}else!d&&alert("Корзина переполнена.\nУдалите одно или несколько объявлений из корзины прежде чем добавить новое.");c_sad()}function delete_sad(c,e){var a,b=[],d=[];a=getCookie("sv"+c);if(a){b=a.split(",");for(i in b)b[i]!=e&&d.push(b[i]);a=d.join(",");if(!a)deleteCookie("sv"+c,"/",cookdomain);else setCookie("sv"+c,a,90,"/",cookdomain);document.location.reload()}}function c_sad(){var a=0;for(c in ck)if(getCookie(ck[c]))a+=getCookie(ck[c]).split(",").length;document.getElementById("sadc").innerHTML=a>0?"(<b>"+a+"</b>)":""}function dla(){for(c in ck)deleteCookie(ck[c],"/",cookdomain)}function hpop(b,a){if(a<260)a=260;window.open("/help/"+b+".html","selecthelp","width=400,height="+a+",top=20,left=10,status=no,toolbar=no,menubar=no,scrollbars=no")}function sk(c,b,a){var e="location",d="undefined";if(a==""||typeof a==d)a=c.text||c.innerHTML;a=a.replace(/&nbsp;/g," ");a=a.replace(/&raquo;/g,"");if(a==" ")a="";if(b==""||typeof b==d){b=a;a=""}c.pathname.match(/i_([0-9]+)/);var f=RegExp.$1;if(f>0)setCookie(e,f+"_"+a+"_"+b,"90","/",cookdomain);else deleteCookie(e,"/",cookdomain)}function mOv(a){a.style.backgroundColor="#E9F6FF"}function mOt(a){a.style.backgroundColor="#FFFFFF"}var ds_ajx={xhr:null,settings:{url:"",type:"POST",async:true,cache:false,data:null,contentType:"application/x-www-form-urlencoded",success:null,error:null,complete:null},call:function(g){var c=this,d=false;try{d=new XMLHttpRequest}catch(i){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(h){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(j){d=false}}}var e=c,b=d,a=function(d,c){var b={};for(var a in d)b[a]=typeof c[a]=="undefined"?d[a]:c[a];return b}(c.settings,g),f=function(){if(b.readyState==4){if(b.status==200)e.isFunction(a.success)&&a.success.call(a,b.responseText,b.status,b);else e.isFunction(a.error)&&a.error.call(a,b,b.status);e.isFunction(a.complete)&&a.complete.call(a,b,b.status)}};c.xhr=b;if(!a.cache)a.url+=(a.url.indexOf("?")>-1?"&":"?")+"_nocache="+ +new Date+Math.floor(Math.random()*99999);if(a.data)if(a.type=="GET"){a.url+=(a.url.indexOf("?")>-1?"&":"?")+c.param(a.data);a.data=null}else a.data=c.param(a.data);b.open(a.type,a.url,a.async);b.setRequestHeader("Content-type",a.contentType);if(a.async){b.onreadystatechange=f;b.send(a.data)}else{b.send(a.data);f()}return c},param:function(b){var c=[];for(var a in b)c.push(encodeURIComponent(a)+"="+encodeURIComponent(b[a]));return c.join("&")},isFunction:function(a){return a&&a.constructor&&a.constructor.toString().indexOf("Function")!==-1}};
