var notopbaner=0;
function Nwind_scroll(name,hig,wid){
	var left=Math.round(screen.width/2)-Math.round(wid/2);
	var top=Math.round(screen.height/2)-Math.round(hig/2);
	options='directories=0, location=0,';
	options=options+'height='+hig+',';
	options=options+'menubar=0,';
	options=options+'resizable=0,';
	options=options+'scrollbars=1,';
	options=options+'status=0,';
	options=options+'toolbar=0,';
	options=options+'directories=0,';
	options=options+'center=yes,';
	options=options+'left='+left+',';
	options=options+'top='+top+',';
	options=options+'width='+wid;
	win=window.open(name,'newWindowScroll',options);
	win.focus();
}
function getCookie(name) {
     var cookie = " " + document.cookie;
     var search = " " + name + "=";
     var setStr = null;
     var offset = 0;
     var end = 0;
     if (cookie.length > 0) {
          offset = cookie.indexOf(search);
          if (offset != -1) {
               offset += search.length;
               end = cookie.indexOf(";", offset)
               if (end == -1) {
                    end = cookie.length;
               }
               setStr = unescape(cookie.substring(offset, end));
          }
     }
     return(setStr);
}

function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
if(getCookie("winsize") == null) {
	  var width=screen.width;
	  if (width>=1280) {
	  	width=1214;
	  } else {
	  	width=958;
	  }
          setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "romo.ua");
          setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "www.romo.ua");
          window.location.reload();
} else {
	var w=getCookie("winsize");
	var width=screen.width;
	if (w==1214 && width<1280) {
		if (width>=1280) {
	  		width=1214;
	  	} else {
	  		width=958;
	  	}
          	setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "romo.ua");
          	setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "www.romo.ua");
          	window.location.reload();
	}
	if (w==958 && width>=1280) {
		if (width>=1280) {
	  		width=1214;
	  	} else {
	  		width=958;
	  	}
          	setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "romo.ua");
          	setCookie("winsize", width, "Mon, 03-Feb-2020 00:00:00 GMT", "/", "www.romo.ua");
          	window.location.reload();
	}	
}
function confirmLink(msg) {
    var is_confirmed = confirm(msg);
    return is_confirmed;
}
(function(){ // определение типа браузера
var ua = navigator.userAgent, av = navigator.appVersion, v, i;
$is={};
$is.Opera = !!(window.opera && opera.buildNumber);
$is.WebKit = /WebKit/.test(ua);
$is.OldWebKit = $is.WebKit && !window.getSelection().getRangeAt;
$is.IE = !$is.WebKit && !$is.Opera && (/MSIE/gi).test(ua) && (/Explorer/gi).test(navigator.appName);
$is.IE6 = $is.IE && /MSIE [56]/.test(ua);
$is.IE5 = $is.IE && /MSIE [5]/.test(ua);
$is.Gecko = !$is.WebKit && /Gecko/.test(ua);
$is.Mac = ua.indexOf('Mac') != -1;
for (i in $is) if (!$is[i]) $is[i]=NaN;
if (!$is.IE5) v = (ua.toLowerCase().match(new RegExp(".+(?:rv|it|ra|ie)[\\/: ]([\\d.]+)"))||[])[1];
switch (true) {
    case ($is.WebKit): v=parseInt(v, 10);$is.WebKit=v=v>599?4:v>499?3:v>399?2:1;break;
    case ($is.Opera): $is.Opera =v=v||9;break;
    case ($is.Gecko): $is.Gecko =v=v.substr(0,3)||1.8;break;
    case ($is.IE): $is.IE =v= window.XMLHttpRequest ? 7 : (/MSIE [5]/.test(av)) ? (/MSIE 5.5/.test(av))?5.5:5 : 6;
    };
$is.verb = v;
$is.ok = !!($is.Opera>=9 || $is.IE>=6 || $is.Gecko || $is.WebKit>2);
$is.debug = /&debug$/.test(location.search);
})();
function change_pos_scroll() {
	var pos=0;
	if (!notopbaner) {
		pos=parseInt(document.body.scrollTop);
		if($is.IE) {

		} else {
			if (pos>90) {
				document.getElementById('top_element').style.top=0;
				document.getElementById('top_element').style.position='fixed';
			} else {
				document.getElementById('top_element').style.top=90;
				document.getElementById('top_element').style.position='absolute';
			}
		}
	}
}
function change_diz(t) {
	if (t==1) {
		setCookie("diz", "1", "Mon, 03-Feb-2020 00:00:00 GMT", "/", "romo.ua");
        setCookie("diz", "1", "Mon, 03-Feb-2020 00:00:00 GMT", "/", "www.romo.ua");
		document.getElementById('body').style.background="#ffffff";
		document.getElementById('main_body').style.background="#ffffff";
		document.getElementById('dizsing').innerHTML="<img align='right' class='cp' onclick='change_diz(0);' id='dizsing' src='http://romo.ua/img/den.gif' onmouseover=\"Tip('&nbsp;режим день&nbsp;', WIDTH, 67); return false;\" onmouseout=\"UnTip('default'); return false;\">";
	} else if (t==0) {
		setCookie("diz", "0", "Mon, 03-Feb-2020 00:00:00 GMT", "/", "romo.ua");
        setCookie("diz", "0", "Mon, 03-Feb-2020 00:00:00 GMT", "/", "www.romo.ua");
		document.getElementById('body').style.background="#000000";
		document.getElementById('main_body').style.background="#000000";
		document.getElementById('dizsing').innerHTML="<img align='right' class='cp' onclick='change_diz(1);' id='dizsing' src='http://romo.ua/img/noch.gif' onmouseover=\"Tip('&nbsp;режим ночь&nbsp;', WIDTH, 67); return false;\" onmouseout=\"UnTip('default'); return false;\">";
	}
}
function add_photo_div(url) {
	document.getElementById("div_for_photo").innerHTML='<img src='+url+' onload=\'show_big_photo("'+url+'");\'>';
}
function show_big_photo(url) {
	var img='<img src="'+url+'">';
	Tip(img, WIDTH, 315, PADDING, 0);
}
