// COMMON JavaScript FILE
// Is the visiting browser compatible with AJAX?
var AJAX_Compatible = false;
m1 = new Image();
m1.src = "http://www.ranez.ru/images/foto/icon_refresh.gif";
m1_sel = new Image();
m1_sel.src = "http://www.ranez.ru/images/foto/icon_refresh_sel.gif";
function show_picture(script, src, alt, width, height)
{
// alt must be escaped or empty because escape(str) doesn't work with russian symbols
  if (  (script.substring(0,7).toLowerCase()) != "http://"  &&  (script.substring(0,8).toLowerCase() != "https://" ) ){
    script = frontBaseHref + script;
  }
  var w_width = 60 + parseInt(width);
  var w_height = 150 + parseInt(height);
  if (w_height > window.screen.availHeight)
    w_height = window.screen.availHeight;
  if (w_width > window.screen.availWidth)
    w_width = window.screen.availWidth;
  window.open(script+"?src=" + escape(src) + "&alt=" + alt + "&width="+width + "&height="+height, "pic", "resizable=yes, status=yes, scrollbars=yes, width=" + w_width + ", height=" + w_height);
}
// ***************************************************************************************************************
function SetCookie (name, value)
{
	var today = new Date(); var days = 7;
	expires = new Date(today.getTime() + days*24*60*60*1000);
	document.cookie = name + "=" + escape(value) +"; path=/; expires=" + expires.toGMTString();
}
function GetCookie (sName) {
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++) {
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0]) return unescape(aCrumb[1]);
	}
	return null;
}
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}