// Email Validation Javascript
// copyright 23rd March 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function validateEmail(addr) {
if (addr == '') {
   return false;
}
var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
for (i=0; i<invalidChars.length; i++) {
   if (addr.indexOf(invalidChars.charAt(i),0) > -1) {
      return false;
   }
}
for (i=0; i<addr.length; i++) {
   if (addr.charCodeAt(i)>127) {
      return false;
   }
}

var atPos = addr.indexOf('@',0);
if (atPos == -1) {
   return false;
}
if (atPos == 0) {
   return false;
}
if (addr.indexOf('@', atPos + 1) > - 1) {
   return false;
}
if (addr.indexOf('.', atPos) == -1) {
   return false;
}
if (addr.indexOf('@.',0) != -1) {
   return false;
}
if (addr.indexOf('.@',0) != -1){
   return false;
}
if (addr.indexOf('..',0) != -1) {
   return false;
}
var suffix = addr.substring(addr.lastIndexOf('.')+1);
if (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {
   return false;
}
return true;
}


function toggle(toggleId, e)
{
  if (!e) 
  {
    e = window.event;
  }
 
  var body = document.getElementById(toggleId);
  if (!body) 
  {
    return false;
  } 
 
  var im = toggleId + "_toggle";
  if (body.style.display == 'none') 
  {
    body.style.display = 'block';
   } 
   else 
   {
     body.style.display = 'none';
   }
 
   if (e) 
   {
      // Stop the event from propagating, which
      // would cause the regular HREF link to
      // be followed, ruining our hard work.
      e.cancelBubble = true;
      if (e.stopPropagation) 
      {
        e.stopPropagation();
      }
   }
}

function toggleOn(toggleId, showIt)
{ 
   var body = document.getElementById(toggleId);
   if (!body) 
   {
     return false;
   } 
 
   var im = toggleId + "_toggle";
   if (showIt)
   {
     body.style.display = 'block';
   }
   else
   {
     body.style.display = 'none';
   }
   
   e = window.event;
   if (e) 
   {
      // Stop the event from propagating, which
      // would cause the regular HREF link to
      // be followed, ruining our hard work.
      e.cancelBubble = true;
      if (e.stopPropagation) 
      {
        e.stopPropagation();
      }
   }
}