// Identify browser - not all browsers handle email the same.
var browser=navigator.appName + " " + navigator.appVersion;

// Add a message to the body for Netscape 4.0
var message="";
if(browser.substring(0, 12)=="Netscape 4.0")
   message="&body=This is for demonstration only... \n\n\n      DO NOT SEND THIS MESSAGE!";

// Used to display and load email address
var address="";
// Called by onChange in select tag
function setAddress()
   {
   // Sets myindex to index of selected menu item
   var myindex=document.email.address.selectedIndex;

   // If an item other than 0 has been chosen
   if (myindex>=1)
      {
      address=document.email.address.options[myindex].value;
	  subjectem=document.email.address.options[myindex].label;
      document.email.display.value=address;
      return true;
      }

   // If no item has been chosen
   else
      {
      document.email.display.value="Choose an address from the menu...";
      return false;
      }   
   }

// Called by View Mail Window button
function doMail()
   {
   // Checks if an address has been selected
   if(setAddress())
      window.location="mailto:"+address+"?subject="+subjectem+message;
   else
      {
      alert("\nYou must select an address from the menu first.");
      return false;
      }
   }

// Called by Reset The Form button - impelmented for Netscape 2
function resetForm()
   {
   document.email.address.options[0].selected = true;
   }

// Called by About Netscape 2 button
function aboutNet2()
   {
   alert("\nThe onChange used to display the address does not work right with Netscape 2.\n\nWith this browser, make a selection and then click within the frame to see the address.");
   }

// Called by View Source button - displays text file of source.
function viewSource()
   {
   alert("\nA text file with source will be loaded to the full window.\n\nUse your browser BACK button to return to the examples.");
   top.window.location.href="js-mail1.txt";
   }
