// JavaScript Document
<!--

function set_action()
{
 with (document.FF)
 {
  if (action.value=="1") Button.value="Join List";
  else Button.value="Leave List";
 }
}
function validateForm()
{
 var okSoFar=true
 var foundAt = 0
 var foundDOT = 0
 var foundSpace = 0
 var foundDQuote = 0
 var foundSQuote = 0
 with (document.FF)
 {
  if (email_addr.value=="" && okSoFar)
  {
    okSoFar = false
    alert ("Please enter an email address.")
    email_addr.focus()
  }
 if (email_addr.value>"" && okSoFar)
  {
   foundAt = email_addr.value.indexOf("@",0)
   foundDOT = email_addr.value.indexOf(".",0)
   foundSpace = email_addr.value.indexOf(" ",0)
   foundDQuote = email_addr.value.indexOf("\"",0)
   foundSQuote = email_addr.value.indexOf("\'",0)
  }
  if (foundAt < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email_addr.focus()
  }
  if (foundDOT < 1 && okSoFar)
  {
    okSoFar = false
    alert ("Please enter a valid email address.")
    email_addr.focus()
  }
  if (foundSpace > 1 && okSoFar)
  {
    okSoFar = false
    alert ("There is a space within the email address this is not valid, please re-enter.")
    email_addr.focus()
  }
  if (foundDQuote > 1 && okSoFar)
  {
    okSoFar = false
    alert ("There is a double quote within the email address this is not valid, please re-enter.")
    email_addr.focus()
  }
  if (foundSQuote > 1 && okSoFar)
  {
    okSoFar = false
    alert ("There is a single quote within the email address this is not valid, please re-enter.")
    email_addr.focus()
  }
  if (okSoFar==true)
  {
   e2afWin='toolbar=0,directories=0,fullscreen=0,menubar=0,scrollbars=0,resizable=0,width=300,height=170,top=50,left=50';
   var e2afWindow = null;
   if(e2afWindow != null) if(!e2afWindow.closed) e2afWindow.close()
   loading="http://"+self.location.hostname+"/adminfunc/maillist/loading.html";
   e2afWindow=open(loading,'e2afWin', e2afWin);
   e2afWindow.focus();
   submit();
  }
}
}





function checkfields () {

if (document.emailform.a_name.value==""){
		alert("Please check and re-enter your Name.");
		return false;
	} else if (document.emailform.b_email.value==""){
		alert("Please check and re-enter your email address.");
		return false;
	} else if (document.emailform.c_comments.value==""){
		alert("Please check and re-enter your comments.");
		return false;
		}
else return true;
}

/*

    Random Images

                                                                       */
var imagenumber = 3;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "images/header01.jpg"
images[2] = "images/header02.jpg"
images[3] = "images/header03.jpg"

var image1 = images[rand1]

/*

    Nav Text Rollover functions

                                                                       */

function tdover(x)
{
document.all["td" + x].bgColor="#5A5C95";
}

function tdout(x)
{
document.all["td" + x].bgColor="#000000";
}



function openWindow(code,look) 

{

 newWindow = window.open(code, 'newWin', look)

 newWindow.focus()

}

/*

    General dreamweaver functions

                                                                       */

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//-->