<!--

// Pop up browser window for info text
// Invoke with: <a href="JavaScript:infoWindow('popuppagename.htm')"></a>
function infoWindow(theURL)
  {
  mywin = window.open(theURL,"moleinfo","scrollbars=no,height=300,width=300,left=60,top=60");
  mywin.focus();
  }

// Pop up browser window for picture
// Invoke with: <a href="JavaScript:picWindow('popuppagename.htm')"></a>
function picWindow(theURL,win,w,h)
  {
  mywin = window.open(theURL,win,"scrollbars=yes,left=60,top=60,height=" + h + ",width=" + w);
  mywin.focus();
  }

// Set cookie client-side
function setCookie(name, value, expires, path)
  {
  document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "");
  }

// Write HMID Cookie
function writeHMIDCookie(val)
  {
  setCookie ("HMID", val, "Mon, 01-Feb-2100 00:00:00 GMT", "/");
  }

// Check HMID Cookie - if not present write initial
function writeInitCookie()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("HMID=");
  if (pos == -1)
    {
    writeHMIDCookie("10000000");
    }
  }

// Check HMID Cookie - if not present write initial
function writeInitCookieOLD()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("HMID=");
  if (pos == -1)
    {
    setCookie ("HMID", "10000000", "Mon, 01-Feb-2100 00:00:00 GMT", "/");
    }
  }

// Check SID Cookie - write register hypertext
function printRegister()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("SID=");
  if (pos == -1)
    {
    document.write("<a href=\"/cgi-bin/main/register-fm.pl\" target=\"_top\" class=\"accountmenu\">Register</a>");
    }
  else
    {
    document.write("<a href=\"/cgi-bin/main/profile-fm.pl\" target=\"_top\" class=\"accountmenu\">My Profile</a>");
    }
  }

// Check SID Cookie - write logged-in hypertext
function printLogin()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("SID=");
  if (pos == -1)
    {
    document.write("<a href=\"/cgi-bin/main/login-fm.pl\" target=\"_top\">Login</a>");
    }
  else
    {
    document.write("<a href=\"/cgi-bin/main/logout.pl\" target=\"_top\">Logout</a>");
    }
  }

// Check SID Cookie - write forgot Password or UserID hypertext
function printForgot()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("SID=");
  if (pos == -1)
    {
    document.write("<a href=\"/cgi-bin/main/register-forgot-fm.pl\" target=\"_top\">Forgot Password/ID?</a>");
    }
  else
    {
    document.write("Forgot Password/ID?</span>");
    }
  }

// Write out local date client-side
function printLocalDate()
  {
  var mydate=new Date();
  var year=mydate.getFullYear();
  var day=mydate.getDay();
  var month=mydate.getMonth();
  var daym=mydate.getDate();
  var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
  var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
  if (year<2000) year="19" + year;
  if (daym<10) daym="0" + daym;
  document.write(dayarray[day] + "<BR>" + daym + " " + montharray[month] + " " + year);
  }

// Test Function
function printHelloWorld()
  {
  document.write("Hello World!");
  }

//-->
