function writeFlash(out) {
  document.write(out);
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
  document.write('<SCRIPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('Sub popupbanner_FSCommand(ByVal command, ByVal args)\n');
  document.write(' call popupbanner_DoFSCommand(command, args)\n');
  document.write('end sub\n');
  document.write('</SCRIPT\> \n');
}

function popupbanner_DoFSCommand(command, args) {
  var cDate = new Date();
  cDate.setDate(cDate.getDate()+365);
  if (command=='close') {
    document.getElementById('popupbanner').style.display = 'none';
    alert('Для того, что бы увидеть меня снова, кликни на мою иконку в правом верхнем углу.');
    document.cookie = "show_popup=false; expires=" + cDate.toGMTString() +  '; path=/';
  }
}

function processPopup() {
  var cDate = new Date();
  cDate.setDate(cDate.getDate()+365);
  ban = document.getElementById('popupbanner');
  if (ban.style.display == 'none') {
    ban.style.display = 'block';
    document.cookie = "show_popup=true; expires=" + cDate.toGMTString() + '; path=/';
  }
  else {
    ban.style.display = 'none';
    document.cookie = "show_popup=false; expires=" + cDate.toGMTString() + '; path=/';
  }
}

function getCookie(c_name) {
  if (document.cookie.length>0) {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1) {
      c_start=c_start + c_name.length+1;
      c_end=document.cookie.indexOf(";",c_start);
      if (c_end==-1) c_end=document.cookie.length;
      return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}