/*
 * 99 Bottles of Beer on the Wall in JavaScript
 * This program prints out the lyrics of an old pub song.
 * Copyright (C) 1996, Brian Patrick Lee (blee@media-lab.mit.edu)
 * Modifyed by Giovanni Vertuan (gve@mailcity.com)
 */
function beer(){
if (confirm("Are you old enough to read about beer\n" + "according to your local community standards?")) {
birra=window.open("","beer","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes");
birra.document.open();
birra.document.write("<html><head><title>99 bottles of beer ...</title></head><body bgcolor=\"#007777\" text=\"#ff0000\">");
  for (i = 99 ; i > 0 ; i--) {
    j = i - 1;
    if (i != 1) { 
      icase = "bottles"; 
    } else { 
      icase = "bottle";
    }
    if (j != 1) {
      jcase = "bottles";
    } else {
      jcase = "bottle";
    }
    birra.document.write(i + " " + icase + " of beer on the wall," + " " + i + " " + icase + " of beer.<br>" + "Take 1 down, pass it around,");
    if (j != 0) {
      birra.document.write(" " + j + " " + jcase + " of beer on the wall.<br>");
    } else {
      birra.document.write(" no more bottles of beer on the wall!");
    }
  }
} else{
birra=window.open("","beer","toolbar=no,directories=no,menubar=no,status=no,scrollbars=yes");
birra.resizeTo(240,240);
birra.moveTo(120,120);
birra.document.open();
birra.document.write("<html><head><title>99 bottles of beer ...</title></head><body bgcolor=\"#007777\" text=\"#ff0000\">");
birra.document.write("<center><font size=\"6\"><b>You might want think about moving to another community.</b></font></center>");
}
birra.document.write("</body></html>");
birra.document.close();
}