<!-------------------------------- MAIN NAV ROLLOVERS  ------------------------------------->

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;
}
// Pre-load main nav rollover state images
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];}
}
///////////////////////////////////////////////////////////////////////////////////////////////

<!------------------------------------STICKY NAV---------------------------------------------->

function stickyNav() {
	
    pageTitle = document.body.id;
	//alert("pageTitle = " + pageTitle);
	
	// hilite main nav if in subsection
	if (pageTitle == "home") {
		pageTitle = "home";
		}
		else if ((pageTitle == "about_us") || (pageTitle == "people") || (pageTitle == "board_meeting_schedule")) {
			pageTitle = "about_us";
		}
		else if ((pageTitle == "news") || (pageTitle == "news_archive") || (pageTitle == "newsletters") || (pageTitle == "search_results") || (pageTitle == "article")) {
			pageTitle = "news";
		}
		else if (pageTitle == "contact_us") {
			pageTitle = "contact_us";
		}
		else {
			pageTitle = "programs";
		}
		//alert("pageTitle = " + pageTitle);
	
    var buttonID = "btn_" + pageTitle;  //  sets value of buttonID to 'btn_' plus the value of the body id. 
	//alert("buttonID = " + buttonID);
	
    var imagePath = document.images[buttonID].src;  //  gets the file path of the image who's id is 'btn_xxxxx' 
	//alert("imagePath = " + imagePath);
	
    var startChar = imagePath.lastIndexOf("/") + 1;   //  gets character position at beginning of graphic's filename 
	//alert("startChar = " + startChar);
	
    var endChar = imagePath.lastIndexOf("_o") - startChar;  //  gets character position of _on or _off suffix
	//alert("endChar = " + endChar);
	
    imagePath = imagePath.substr(startChar, endChar);  // parses the value for 'imagePath' by subracting
													   // the first character position from the last
	//alert("imagePath = " + imagePath);
	
	var stickyButton = imagePath + "_on.gif"; // tacks on the _on suffix for rollover image
	
	stickyButton = "/images/" + stickyButton;
	//alert("stickyButton = " + stickyButton);
	
    document.images[buttonID].src=stickyButton;   // this command actually switches the image to the rollover image
    }
	
///////////////////////////////////////////////////////////////////////////////////////////////



<!------------------------------------FORM VALIDATION:  APPLY ONLINE  ---------------------------------------------->


<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan -->
function FrontPage_Form1_Validator(theForm)
{

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
  var checkStr = theForm.txtState.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter characters in the \"txtState\" field.");
    theForm.txtState.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.txtZip.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"txtZip\" field.");
    theForm.txtZip.focus();
    return (false);
  }
  return (true);
}
//--><!--webbot BOT="GeneratedScript" endspan -->

///////////////////////////////////////////////////////////////////////////////////////////////



<!------------------------------------FORM VALIDATION:  PAY ONLINE  ---------------------------------------------->

function validate_form() {
    myform = window.document.payment_form;
    if ( myform.firstname.value == "" ) { window.alert("Please enter First Name"); myform.firstname.focus(); return false; }
    if ( myform.lastname.value == "" ) { window.alert("Please enter Last Name"); myform.lastname.focus(); return false; }
    if ( myform.address.value == "" ) { window.alert("Please enter Address"); myform.address.focus(); return false; }
    if ( myform.city.value == "" ) { window.alert("Please enter City"); myform.city.focus(); return false; }
    if ( myform.state.value == "" ) { window.alert("Please enter State"); myform.state.focus(); return false; }
    if ( myform.zip.value == "" ) { window.alert("Please enter Zip Code"); myform.zip.focus(); return false; }
    if ( myform.billing_address.value == "" ) { window.alert("Please enter Billing Address"); myform.billing_address.focus(); return false; }
    if ( myform.billing_city.value == "" ) { window.alert("Please enter Billing City"); myform.billing_city.focus(); return false; }
    if ( myform.billing_state.value == "" ) { window.alert("Please enter Billing State"); myform.billing_state.focus(); return false; }
    if ( myform.billing_zip.value == "" ) { window.alert("Please enter Billing Zip Code"); myform.billing_zip.focus(); return false; }
    if ( myform.phone.value == "" ) { window.alert("Please enter Phone"); myform.phone.focus(); return false; }
    if ( myform.email.value == "" ) { window.alert("Please enter Email Address"); myform.email.focus(); return false; }
    if ( myform.payment_amount.value == "" ) { window.alert("Please enter a Payment Amount"); myform.payment_amount.focus(); return false; }
    if ( !isValidEmail(myform.email.value)) {window.alert("Please enter a valid Email Address"); myform.email.focus(); return false; }
    if ( myform.ccnumber.value == "" ) { window.alert("Please enter Credit Card Number"); myform.ccnumber.focus(); return false; }
    if ( !cardval(myform.ccnumber.value)) { window.alert("The Credit Card Number you entered does not appear to be valid"); myform.ccnumber.focus(); return false; }
    if ( myform.cardcode.value == "" ) { window.alert("Please enter Credit Card Security Code"); myform.cardcode.focus(); return false; }
    return true;
}
    
function cardval(s) {
    // remove non-numerics
    var v = "0123456789";
    var w = "";
    for (i=0; i < s.length; i++) {
        x = s.charAt(i);
        if (v.indexOf(x,0) != -1)
        w += x;
    }
    // validate number
    j = w.length / 2;
    if (j < 6.5 || j > 8 || j == 7) return false;
    k = Math.floor(j);
    m = Math.ceil(j) - k;
    c = 0;
    for (i=0; i<k; i++) {
        a = w.charAt(i*2+m) * 2;
        c += a > 9 ? Math.floor(a/10 + a%10) : a;
    }
    for (i=0; i<k+m; i++) c += w.charAt(i*2+1-m) * 1;
    return (c%10 == 0);
}

function setToday() {
var myDate = new Date();
var myMonth = myDate.getMonth();
myMonth = myMonth + 1;
var endMonth;
if (myMonth == 12) {
	endMonth = 1;
	}
else endMonth = myMonth + 1;
if (myMonth < 10) {
	myMonth = "0" + myMonth;
	}
if (endMonth < 10) {
	endMonth = "0" + endMonth;
	}
var myDay = myDate.getDate();
var endDay
if (myDay > 28) {
	endDay = 28;
	}
else endDay = myDay;
if (myDay < 10) {
	myDay = "0" + myDay;
	}
if (endDay < 10) {
	endDay = "0" + endDay;
	}
var myYear = myDate.getFullYear();
var endYear;
if (endMonth == 1) {
	endYear = myYear + 6;
	}
else endYear = myYear+5;
var myHours = myDate.getHours();
var myMinutes = myDate.getMinutes();
var mySeconds = myDate.getSeconds();

var accDate = myMonth + "/" + myDay + "/" + myYear;
var endDate = endMonth + "/" + endDay + "/" + endYear;

document.form1.publishDate.value=accDate;
// alert ("form field value is " + document.form1.publishDate.value);

}

function setPublishDate() {
var myDate = new Date();
var myMonth = myDate.getMonth();
myMonth = myMonth + 1;
var endMonth;
if (myMonth == 12) {
	endMonth = 1;
	}
else endMonth = myMonth + 1;
if (myMonth < 10) {
	myMonth = "0" + myMonth;
	}
if (endMonth < 10) {
	endMonth = "0" + endMonth;
	}
var myDay = myDate.getDate();
var endDay
if (myDay > 28) {
	endDay = 28;
	}
else endDay = myDay;
if (myDay < 10) {
	myDay = "0" + myDay;
	}
if (endDay < 10) {
	endDay = "0" + endDay;
	}
var myYear = myDate.getFullYear();
var endYear;
if (endMonth == 1) {
	endYear = myYear + 6;
	}
else endYear = myYear+5;
var myHours = myDate.getHours();
var myMinutes = myDate.getMinutes();
var mySeconds = myDate.getSeconds();

var accDate = myMonth + "/" + myDay + "/" + myYear;
var endDate = endMonth + "/" + endDay + "/" + endYear;
//document.form1.lastmodDate.value=accDate;
document.form1.publishDate.value=accDate;
// document.form1.endDate.value=endDate;

}




function isValidEmail(emailAddress) {
   var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    return re.test(emailAddress);
}
