function addBookmark(url, title)
{
  if (!url) url = location.href;
  if (!title) title = document.title;

  //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();
  }
  else return false;

  return true;
}

function mwShowP(mName,mTitle,mWidth,mHeight)
{
	var mwin;
	mwin=open('', '','status=no,menubar=no,toolbar=no,resizable=no,width=' + mWidth + ',height=' + mHeight);
	mwin.focus();
	mwin.document.write('<html><head><title>' + mTitle + '</title></head><body bottomMargin=0 leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0><a href="javascript:window.close()"><img border=0 src="' + mName + '" alt="закрыть окно просмотра" width=' + mWidth + ' height=' + mHeight + '></a></body>');
	mwin.document.close();
}

