function iView(img,w,h,title) {
    cx=screen.width/2-(w/2);
    cy=screen.height/2-(h/2);
    param="width="+w+",height="+h+",location=no,menubar=no,scrollbars=no,top="+cy+",left="+cx;
    tw = window.open("","",param);
    tw.document.open();
    tw.document.write("<html><head><title>"+title+"</title></head><body style=\'margin:0;padding:0\'>"+
    "<a href=\'javascript: window.close();\'><img src=\'"+img+"\' border=0 alt=\'Закрыть окно\' title=\'Закрыть окно\'></a></body></html>");
    tw.document.close();
}
function ShowWin(url) {
var x, y, cx, cy;
x = 800;
y = 600;
cx=screen.width/2 - (x/2);
cy=screen.height/2-(y/2);
window.open(url,"popup","toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width="+x+",height="+y+",scrollbars=yes,top="+cy+",left="+cx);
}
function ShowWinS(url, x, y, scrl) {
var cx, cy, name;
cx=screen.width/2 - (x/2);
cy=screen.height/2-(y/2);
name = getNameByDate();
window.open(url,name,"toolbar=no,status=no,directories=no,menubar=no,resizable=yes,width="+x+",height="+y+",scrollbars="+scrl+",top="+cy+",left="+cx);
}
function getNameByDate() {
          var s = "";
          var d = new Date();
	  s += d.getFullYear();
	  s += (d.getMonth() + 1);
	  s += d.getDate();
	  s += "_" + d.getHours();
	  s += "mn" + d.getMinutes();
	  s += "s" + d.getSeconds();
	  s += "mls" + d.getMilliseconds();
          return s;
}
function body_onload() {
 var obj0 = document.getElementById("l_div0");
 var obj1 = document.getElementById("l_div");
 if(obj0 != null && obj1 != null) {
	obj0.innerHTML += obj1.innerHTML;
	obj1.innerHTML = "";
 }
 var obj_AdvMark = document.getElementById("AdvMark");
 if (obj_AdvMark == null) obj_AdvMark = document.getElementById("AdvMarkAuto");
 if (obj_AdvMark != null) obj_AdvMark.insertAdjacentHTML("afterEnd", "<span id=begunSpan></span><span id=cAdvSpan></span>");
 MyResize();
}
function MyResize() {
var max_with = 1100;
var w = document.body.clientWidth < max_with ? 1 : document.body.clientWidth - max_with;
var tbm = document.getElementById("rlimit");
if(tbm != '' && tbm != null) {
  tbm.width = w/2;
  tbm.style.width = w/2;
  SetCookie("rlimit", Math.floor(w/2));
}
tbm = document.getElementById("llimit0");
if(tbm != '' && tbm != null) {
  tbm.width = w/2;
  tbm.style.width = w/2;
}
tbm = document.getElementById("llimit");
if(tbm != '' && tbm != null) {
  tbm.width = w/2;
  tbm.style.width = w/2;
}
}
function SetCookie(sName, sValue) 
{
 var expiredays = 1;
 var todayDate = new Date();
 todayDate.setTime(todayDate.getTime() + expiredays * 24 * 60 *60 *1000);
 document.cookie = sName + "=" + escape(sValue) + "; expires=" + todayDate.toGMTString()+"; path=/";
}

// размер шрифтов
var yandex_ad_fontSize = 1;
// внешний вид объявлений директа
var yandex_direct_fontColor = "000000";
var yandex_direct_BorderColor = "FFF9F0";
var yandex_direct_BgColor = "FFF9F0";
var yandex_direct_headerBgColor = "FEEAC7";
var yandex_direct_titleColor = "0000CC";
var yandex_direct_siteurlColor = "006600";
var yandex_direct_linkColor = "0000CC";
