<!--
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];}
}
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 mmLoadMenus() {
  if (window.mm_menu_0009124521_0) return;
  window.mm_menu_0009124521_0 = new Menu("root",121,23,"Verdana, Arial, Helvetica, sans-serif",11,"#ffffff","#171746","#171746","#ffffff","left","middle",4,0,100,0,0,true,true,true,6,true,true);
  mm_menu_0009124521_0.addMenuItem("Overview","location='academy.asp'");
  mm_menu_0009124521_0.addMenuItem("Our Team","location='team.asp'");
  mm_menu_0009124521_0.addMenuItem("Contact&nbsp;Us","location='contact.asp'");
   mm_menu_0009124521_0.hideOnMouseOut=true;
   mm_menu_0009124521_0.menuBorder=1;
   mm_menu_0009124521_0.menuItemBorder=1;
   mm_menu_0009124521_0.menuLiteBgColor='#ffffff';
   mm_menu_0009124521_0.menuBorderBgColor='#171746';
   mm_menu_0009124521_0.bgColor='#ffffff';
  window.mm_menu_0009125643_1 = new Menu("root",118,23,"Verdana, Arial, Helvetica, sans-serif",11,"#ffffff","#171746","#171746","#ffffff","left","middle",4,0,100,0,0,true,true,true,6,false,true);
  mm_menu_0009125643_1.addMenuItem("Overview","location='programs.asp'");
  mm_menu_0009125643_1.addMenuItem("For&nbsp;Children","location='programs_children.asp'");
  mm_menu_0009125643_1.addMenuItem("For&nbsp;Adults","location='programs_adults.asp'");
   mm_menu_0009125643_1.hideOnMouseOut=true;
   mm_menu_0009125643_1.menuBorder=1;
   mm_menu_0009125643_1.menuItemBorder=1;
   mm_menu_0009125643_1.menuLiteBgColor='#ffffff';
   mm_menu_0009125643_1.menuBorderBgColor='#171746';
   mm_menu_0009125643_1.bgColor='#ffffff';

  mm_menu_0009125643_1.writeMenus();
} // mmLoadMenus()

function funcPopShowcase(strURL,strName,intWidth,intHeight,strScroll)
	{
		window.open(strURL,strName, "resizable=no,scrollbars=" + strScroll + ",width="+intWidth+",height="+intHeight);
	}

function popSubscribe2() 
{
	openwin = open("thankyou.asp?EMAIL=" + document.forms.form1.EMAIL.value ,"dir","height=250,width=550,resizable=1,toolbar=0,status=1,menubar=0,scrollbars=1,screenX=100,left=100,screenY=100,top=100");
	openwin.focus();
}

function popEmailLink(name) 
{
	openwin = open(name,"dir","height=450,width=600,resizable=1,toolbar=0,status=1,menubar=0,scrollbars=1,screenX=100,left=100,screenY=100,top=100");
	openwin.focus();
}


function echeck(str) {

	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail Address")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail Address")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	    alert("Invalid E-mail Address")
	    return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	    alert("Invalid E-mail Address")
	    return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
	    alert("Invalid E-mail Address")
	    return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	    alert("Invalid E-mail Address")
	    return false
	 }

	 if (str.indexOf(" ")!=-1){
	    alert("Invalid E-mail Address")
	    return false
	 }

	 return true					
}


// ===== ALL FORM VALIDATION CODE BELOW =============================================



//-----------------------------------------------------------
//returns form select value
//-----------------------------------------------------------
function getSelectVal(str)
{
	var index1 = document.getElementById(str).selectedIndex;
	var out = 0;
	if (index1 >= 0)
	{
		out = document.getElementById(str).options[index1].value;
	}
	return out;
}

//-----------------------------------------------------------
//returns form element value
//-----------------------------------------------------------
function getVal(str)
{
	var val="";
	if (document.getElementById(str) != null)
	{
		var s = Trim(document.getElementById(str).value);
		val = (s.length > 0) ? s : "";
	}
	return val;
}

//-----------------------------------------------------------
// validates string as a valid EMAIL address
//-----------------------------------------------------------
function ValidateEmail(src)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	return filter.test(src);
}

//-----------------------------------------------------------

//trims any string of white spaces
//-----------------------------------------------------------
function Trim(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}



//-----------------------------------------------------------
// Validate the Subscription Email
//-----------------------------------------------------------
function ValidateForm(o)
{	
	var err = "";

	//check for anything in the email field
	if (getVal("subscribe_email").length == 0 )
	{
		err += ("subscribe_email|Email~");
	}
	else
	{
		//check for valid email
		if (!ValidateEmail(getVal("subscribe_email")))	err += ("email|Invalid Email Address~");
	}


	//if there are any errors, show them in an Alert
	if (err.length > 0 )
	{
		FetchErrors(err);
		return false;
	}
	else {
		return true;
	}
 }



//-----------------------------------------------------------
// this validates the form fields that are required
// the way to add fields is to add a new line with the Form Field ID:
//	if (getVal("schoolname").length == 0)		err += ("schoolname|School Name~");
//                    |                                               |           |
//                 field ID 					  field ID    Alert Message Name

//-----------------------------------------------------------
function fnVerify(o)
{
	var err = "";

	if (getVal("name").length == 0)		err += ("name|Name~");

	//check for anything in the email field
	if (getVal("email").length == 0 )
	{
		err += ("email|Email~");
	}
	else
	{
		//check for valid email
		if (!ValidateEmail(getVal("email")))	err += ("email|Invalid Email Address~");
	}


	//-----------------------------------------------------------
	//Board of Directors is the FIRST textarea on the page, so it's '0'
	// to check for a maximum length, test in this way:
	//-----------------------------------------------------------
//	var BOD = document.getElementsByTagName('textarea')[0].innerHTML;
//	if (BOD.length > 2000) {
//			err += ("null|Board of Directors should be 2000 characters or less.~");
//			//        |
//			//     field ID is 'null' because you can't set FOCUS on a textarea, but we still want a message for the error
//	}



	//if there are any errors, show them in an Alert
	if (err.length > 0 )
	{
		FetchErrors(err);
		return false;
	}
	else {
		return true;
	}
}


//-----------------------------------------------------------
// check for errors and display message, and focus on proper field
//-----------------------------------------------------------
function FetchErrors(err)
{
	var  focusItem="schoolname", msg = ""
	errGroup = err.split('~');
	for (var i=0; i<=errGroup.length; i++)
	{
		if (errGroup[i] != null)
			errMsg = errGroup[i].split('|');

		for (var j = 0; j < errMsg.length -1; j++)
		{
			if (i==0 && errMsg[0].length > 0)
				{focusItem = errMsg[0];}
			if (errMsg[1] != null && errMsg[1].length > 0)
				{ msg += errMsg[1]+"\n" ;}
		}
	}
	alert("Please fix the following items:\n\n" + msg);
	if (focusItem != "null" && document.getElementById(focusItem) != null)
	{
		if (focusItem.indexOf('dd') == -1)
		document.getElementById(focusItem).select();
		document.getElementById(focusItem).focus();
	}
	return false;
}

// ===== END FORM VALIDATION CODE BELOW =============================================


// stop hiding -->