function BookmarkSite()
{
  var title = "Nice-Places.com - действительно красивые места"; 
  var url = "http://www.nice-places.com";

  if (window.sidebar) 
    window.sidebar.addPanel(title, url,"");
  else 
    if( window.opera && window.print )
    {
      var mbm = document.createElement('a');
      mbm.setAttribute('rel','sidebar');
      mbm.setAttribute('href',url);
      mbm.setAttribute('title',title);
      mbm.click();
    }
    else 
      if( document.all ) 
        window.external.AddFavorite( url, title);

}


// Poll ///////////////////////////////////////////////////////////////////////////////////////////

var xmlHttp;

function getVote(variant, script_url) {
  xmlHttp = GetXmlHttpObject();
  if (xmlHttp == null) {
    alert("Извините, Ваш браузер не поддерживает HTTPRequest");
    return;
  } 
  var url = script_url + "?vote=" + variant + "&sid=" + Math.random();
  xmlHttp.onreadystatechange = stateChanged;
  xmlHttp.open("GET", url, true);
  xmlHttp.send(null);
} 


function stateChanged() { 
  if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") { 
    document.getElementById("poll").innerHTML = xmlHttp.responseText;
  } 
} 


function GetXmlHttpObject() { 
  var objXMLHttp = null;

  if (window.XMLHttpRequest) {
    try {
      objXMLHttp = new XMLHttpRequest();
    } catch (expn) {
    }
  } else if (window.ActiveXObject) {
    try {
      objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (expn) {
    }
  }
  return objXMLHttp;
}

function showimg(name,path, width, height) {
  if (width == 0 || height == 0) {
    alert("Картинка не назначена");
    return false;
  }
  sb = "auto";
  maxWidth = screen.availWidth - 16;
  maxHeight = screen.availHeight - 16;
  width += 20;
  if (width < 600) {
    width = 600;
    sb = "no";
  }
  if (width > maxWidth) {
    width = maxWidth;
    sb = "yes";
  }
  height += 40;
  if (height < 320) {
    height = 320;
    sb = "no";
  }
  if (height > maxHeight) {
    height = maxHeight;
    sb = "yes";
  }
  x = (maxWidth - width) / 2;
  y = (maxHeight - height - 40) / 2;
  window.open(path, name, 'left='+x+',top='+y+',height=' + height + ',width=' + width + ',menubar=no,resizable=yes,status=no,location=0,scrollbars=' + sb);
}

