function checkForm(emailaddress)
{
   if (! isValidEmailAddress(emailaddress.value) )
   {
      alert("Email address is invalid");
      emailaddress.focus();
      emailaddress.select();
      return false;
   }
   return true;
}

/*
   This function returns true if the email address entered
   has the correct format x@y.z.... else it returns false.
   It's not perfect but it covers many cases.  
*/
function isValidEmailAddress(emailAddress)
{

   /* Check for empty address or invalid characters */

   if (emailAddress == "" || hasInvalidChar(emailAddress))
   {
      return false;
   }

   /* check for presence of the @ character */

   var atPos = emailAddress.indexOf("@", 1)
   if (atPos == -1)
   {
      return false;
   }
   
   /* Check that there are no more @ characters */

   if (emailAddress.indexOf("@", atPos + 1) > -1)
   {
      return false;
   }

   /* Check for the presence of a dot somewhere after @ */

   var dotPos = emailAddress.indexOf(".", atPos + 1);
   if (dotPos == -1)
   {
      return false;
   }

   /* Check for presence of two or more characters after last dot */

   var lastDotPos = emailAddress.lastIndexOf(".");
   if (lastDotPos + 3 >  emailAddress.length)
   {
      return false;
   }
   return true;
}

/*
   Return true if the given email address has an invalid character
   in it, else return false.
*/
function hasInvalidChar(emailAddress)
{
   var invalidChars = "/;:,"; // this list is not complete

   for (var k = 0; k < invalidChars.length; k++)
   {
      var ch = invalidChars.charAt(k);
      if (emailAddress.indexOf(ch) > -1)
      {
         return true;
      }
   }
   return false;
}








function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}













function popUpGuestBook(URL) 
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=0,width=738,height=680,left = 5.5,top = 5');");
}



function popUpCAL(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=800,height=680,left = 15.5,top = 15');");
}



function popUpTV(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1, location=0,statusbar=0,menubar=0,resizable=0,width=780,height=650,left = 15.5,top = 15');");
}





function popUpGame(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=415,left = 50.5,top = 50');");
}




function popUpSubscription(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=279,height=365,left = 50.5,top = 50');");
}





function popUpBrochure(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=290,height=540,left = 50.5,top = 50');");
}






function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);