function PopReviewWindow (source, height, width, scroll) {
  var op = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",width=" + width + ",height=" + height
  
  PicWin = window.open (source,"",op);

}

function PopWindow (source, height, width, scroll) {
  var op = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + scroll + ",width=" + width + ",height=" + height
  
  PicWin = window.open ("","",op);
  PicWin.document.open();
  PicWin.document.writeln('<html>');
  PicWin.document.writeln('<head>');
  PicWin.document.writeln('</head>');
  
  if (scroll) {
    PicWin.document.writeln('<body><img style="overflow: scroll;" src="' + source + '">');
  } else {
    PicWin.document.writeln('<body background="' + source + '">');
  }
  
  PicWin.document.writeln('</body>');
  PicWin.document.writeln('</html>');
  PicWin.document.close();
}

function FormatDate (date) {
  var d = date.getDate();
  var m = date.getMonth() + 1;
  var y = date.getYear();
  var c;
  var mmm = 
    (m==1)?'January':(m==2)?'February':(m==3)?'March':
    (m==4)?'April':(m==5)?'May':(m==6)?'June':
    (m==7)?'July':(m==8)?'August':(m==9)?'September':
    (m==10)?'October':(m==11)?'November':'December';
  
  switch (d) {
    case 1 :
	case 21 :
	case 31 :
	  c = "st";
	  break;
	case 2 :
	case 22 :
	  c = "nd";
	  break;
	case 3 :
	case 23 :
	  c = "rd";
	  break;
	default :
	  c = "th";
	  break;
  }
  
  if (y < 1000) y += 1900;
	
  return (mmm + " " + d + c + ", " + y);
}

function DisplayLastModified () {
  var lmd = document.lastModified;
  var s = "unknown";
  var d1;
  
  if ((d1 = Date.parse (lmd)) != 0) {
    s = "" + FormatDate (new Date (d1));
  }

  s = "This page was last updated on " + s + ".";
  if (document.getElementById("dlm")) {
    document.getElementById("dlm").textContent = s;
  }
}

function ClearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

var addr1 = "mai" + "lto" + ":krait" + "@" + "eigh" + "t-cube" + "d.c" + "om";
var encoded1 = [];
var encoded2 = [];
var codeIt;
var found = 0;
var j = 0;
for (var i=0;i<addr1.length;i++){
  codeIt = Math.round(Math.random()*100);
  if (codeIt > 50 || addr1.charAt(i)=="@"){
    encoded1[i] = "&#" + addr1.charCodeAt(i) + ";";
  } else {
    encoded1[i] = addr1.charAt(i);
  }
  if (found){
    if (codeIt > 50 || addr1.charAt(i)=="@"){
	  encoded2[j++] = "&#" + addr1.charCodeAt(i) + ";"
	} else {
	  encoded2[j++] = addr1.charAt(i);
	}
  }
  if (addr1.charAt(i)==":") {
      found = 1;
  }
}
  
encoded1 = encoded1.join("");
encoded2 = encoded2.join("");
  
function doAddr() {
    document.write(encoded2);
}

function doMail() {
  document.write("<a href='" + encoded1 + "'>");
  doAddr();
  document.write("</a>");
  document.write("&#160;");
  document.write("<sup><a href='pgp.html' title='PGP key block available'>*</a></sup>");
}

