OpenWindow = null;
function doCloseWin()
{
if (OpenWindow)
{OpenWindow.close();}
}
function zoom(url_img,wid,heid,zagolovok)
{
	if (OpenWindow)
	{OpenWindow.close();}

	if (!OpenWindow || (OpenWindow.closed))
	{
	www=""+url_img;
	OpenWindow=window.open('', 'xxx', 'width='+wid+',height='+heid+'resizable=yes,scrollbars=no,top=50,left=50');
	OpenWindow.document.write("<HTML>")
	OpenWindow.document.write("<TITLE>")
	OpenWindow.document.write(zagolovok)
	OpenWindow.document.write("</TITLE>")
	OpenWindow.document.write('<BODY topmargin="0" leftmargin="0">')
	OpenWindow.document.write("<CENTER>")
	OpenWindow.document.write('<link href="/style.css" type="text/css" rel="stylesheet">')
	OpenWindow.document.write('<img onclick="window.close()" src="')
	OpenWindow.document.write(url_img)
	OpenWindow.document.write('" alt="" border="0">')
	OpenWindow.document.write("</CENTER>")
	OpenWindow.document.write("</BODY>")
	OpenWindow.document.write("</HTML>")
	OpenWindow.document.close()
	}
}

function getBrowserInfo() {
 var t,v = undefined;
 if (window.opera) t = 'Opera';
 else if (document.all) {
  t = 'IE';
  var nv = navigator.appVersion;
  var s = nv.indexOf('MSIE')+5;
  v = nv.substring(s,s+1);
 }
 else if (window.sidebar) t = 'Netscape';
 return {type:t,version:v};
}

function addBookmark(url,title)
{
  if (!url) url = "http://sauna.spb.ru/";
  if (!title) title = "Сауны Санкт-Петербурга — Sauna.Spb.Ru";

 var b = getBrowserInfo();
 if (b.type == 'IE') window.external.AddFavorite(url,title);
 else if (b.type == 'Opera') {
	alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
	return true;
 }
 else if (b.type == "Netscape") window.sidebar.addPanel(title,url,"");
 else alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
 return true;
}

function addBookmarkOld(url, title)
{
  if (!url) url = "http://sauna.spb.ru/";
  if (!title) title = "Сауны Санкт-Петербурга — Sauna.Spb.Ru";

  //Gecko
  if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, '');
  //IE4+
  else if (typeof window.external == "object") window.external.AddFavorite(url, title);
  //Opera7+
  else if (window.opera && document.createElement)
  {
    //var a = document.createElement('A');
    //if (!a) return false; //IF Opera 6
    //a.setAttribute('rel','sidebar');
    //a.setAttribute('href',url);
    //a.setAttribute('title',title);
    //a.click();
	alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
  }
  else {
	alert("Нажмите CTRL-D, чтобы добавить страницу в закладки.");
  }

  return true;
}

function overTd(id_td) 
{
sale=document.getElementById(id_td);
sale.style.backgroundColor='#B1B1B1';
}

function outTd(id_td) 
{
sale=document.getElementById(id_td);
sale.style.backgroundColor='#DBDBDB';
}

function showmap(x,y) {
	if (document.getElementById("map-contener").style.display == "block")
	{
	document.getElementById("map-contener").style.display = "none";
	document.getElementById("showmap").innerHTML='<img src="http://sauna.spb.ru/gif/chupa.png" alt="показать на карте"> показать на карте';
	pageTracker._trackEvent("Map", "Hide");
	}
	else 
	{
	document.getElementById("map-contener").style.display = "block";
	document.getElementById("showmap").innerHTML='<img src="http://sauna.spb.ru/gif/chupa.png" alt="показать на карте"> скрыть карту';
	pageTracker._trackEvent("Map", "Show");
	}
}

function popupurl (fileName,w,h,s,door,m) {
	    if (w == null) var w = 500;
            if (h == null) var h = 400;
            if (s == null) var s = 1;
            if (m == null) var m = 0;
            if (door == null) var door = '';
                    
            var t = (screen.height - h) / 2;
	    var l = (screen.width - w) / 2;
   	    var winArgs = 'height=' + h + ',width=' + w + ',top=' + t + ',left=' + l + 'status=no,toolbar=no,menubar=' + m + ',location=no,fullscreen=no,resizable=no,directories=no' + ',scrollbars=' + s;
            //if(x_newWin != null) x_newWin.close();
            //x_newWin = window.open(fileName,'',winArgs);
            window.open(fileName,door,winArgs);
}