function validate_bachelors()
{
	if (document.Entry.Bachelors.options[document.Entry.Bachelors.selectedIndex].value=="NO")
	{
		invalidPop('bachelor');
		document.Entry.Bachelors.focus();
		return false;
	} 
}

function validate_enrolled()
{
	if (document.Entry.SchoolEnrolled.options[document.Entry.SchoolEnrolled.selectedIndex].value=="YES")
	{
		invalidPop('concord_enrolled');
		document.Entry.SchoolEnrolled.focus();
		return false;
	} 
}

function validate_hours()
{
	if (document.Entry.devotehours.options[document.Entry.devotehours.selectedIndex].value=="NO")
	{
		invalidPop('concord_hours');
		document.Entry.devotehours.focus();
		return false;
	} 
}

// unhides extra fields
function display_extras()	{
	if (document.Entry.night_phone_suffix.value.length >= 4) {
		document.getElementById('extra_questions').style.display='block';
		//Effect.Appear('extra_questions');
		//Effect.SlideDown('extra_questions');
	} else {
		document.getElementById('extra_questions').style.display='none';
		//Effect.SlideUp('extra_questions');
	}
}

	function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		
		if (parseInt(navigator.appVersion) >=4) { win.window.focus(); }
	}

//Controls tabbing for phone fields etc.
function TabOut(field,tabtofield,maxlength){
	if(field.value.length==maxlength){
		tabtofield.focus();
		tabtofield.select();
	}
	}
	
function checkForm()
{
	//Program checker			
	if ((document.Entry.program.options[document.Entry.program.selectedIndex].value=="0"))
		{
		alert("\nYou must select a program.");
		document.Entry.program.focus();
		return false;
		} 
		
	//check the basic info
	var state = CheckBasicInfo();
	if(state == false){
		return false;
	}
	
	//Bachelors
	if ((document.Entry.Bachelors.options[document.Entry.Bachelors.selectedIndex].value==""))
		{
		alert("\nYou must indicate whether or not you have at least a Bachelor's degree.");
		document.Entry.Bachelors.focus();
		return false;
		} 
		
	//SchoolEnrolled
	if ((document.Entry.SchoolEnrolled.options[document.Entry.SchoolEnrolled.selectedIndex].value==""))
		{
		alert("\nYou must indicate whether or not you are you currently enrolled in school.");
		document.Entry.SchoolEnrolled.focus();
		return false;
		} 
		
	//AttendedLawSchool
	if ((document.Entry.AttendedLawSchool.options[document.Entry.AttendedLawSchool.selectedIndex].value==""))
		{
		alert("\nYou must indicate whether or not you have attended law school before.");
		document.Entry.AttendedLawSchool.focus();
		return false;
		} 
	
	//20-25 hours a week
	if ((document.Entry.devotehours.options[document.Entry.devotehours.selectedIndex].value==""))
		{
		alert("\nYou must indicate whether you have 20-25 hours a week to devote to obtaining a legal education.");
		document.Entry.devotehours.focus();
		return false;
		}
		
	if (validate_bachelors() == false) return false;
	if (validate_enrolled() == false) return false;
	if (validate_hours() == false) return false;
		
	//Interest maxlength check
	if(eval("document.Entry.Interest.value.length") > 250){
		message="the field Interest can be no longer than 250 characters\nCurrent length equals "+ eval("document.Entry.Interest.value.length");
		alert(message);
		return false;
	}
	
		
	
function e(s) {

	rex=true;

	if (window.RegExp) 
	{st="a";ex=new RegExp(st);
		if (st.match(ex)) {
		r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		r2=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
		b=(!r1.test(s)&&r2.test(s));
		}
		else 
		{rex=false;
		}
	} 
	else
	{	rex=false;
	}
	if(!rex) b=(s.indexOf("@")>0 && s.indexOf(".")>0 && s!="" && s!="enter e-mail");
	return (b);
}

//Call the function to disable the exit pop! from a form post if the form checks out.
setBool();

// Pressnall Dupe Stopper

if ( typeof ( formSubmission ) == "number" )
{
      return false;
}
formSubmission = 1;


}


