// JavaScript Document
    function getURLParam(strParamName){
      var strReturn = "";
      var strHref = window.location.href;
      if ( strHref.indexOf("?") > -1 ){
        var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
        var aQueryString = strQueryString.split("&");
        for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
          if (
    aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
            var aParam = aQueryString[iParam].split("=");
            strReturn = aParam[1];
            break;
          }
        }
      }
      return strReturn;
    } 
function checkparameters()
{
	var x = document.getElementById("form1");
	x.Fname.value = getURLParam('firstname');
    x.Lname.value = getURLParam('lastname');
	x.Email.value = getURLParam('email');
	x.Nav.value = getURLParam('nav');

	var prog = parseInt(getURLParam('programs'));
	if (prog==0) 
	{
		x.ProgramOfInterest.selectedIndex = 1;
	}
	else
	{
		x.ProgramOfInterest.selectedIndex = 0;
	}
}

function displayFullName()
{
	//alert();
	var x = document.getElementById("fullname");
	//var y = document.getElementById("lname");
	
	//y.innerHTML="PPO";
	var str = "<strong>Thank you</strong>,<span class='capLetter'> ";
	str  += getURLParam('fisrtname');
	str += "&nbsp;" ;
	str += getURLParam('lastname');
	str +=" </span> for your interest in Concord Law School.<br />We would like to congratulate you for taking the  first step toward accomplishing your educational goals.";

	//document.write("Hello World!")
//	x.Fname.value = getURLParam('firstname');
 //   x.Lname.value = getURLParam('lastname');	
	 x.innerHTML= str;
}

function displayFullName1()
{
	
	var x = document.getElementById("fullname");
	var str = "<strong>Thank you</strong>, <span class='capLetter'>";
	str  += getURLParam('fisrtname');
	str += "&nbsp;" ;
	str += getURLParam('lastname');
	str +="</span> for submitting your request to Concord Law School.<br />Your Student Information Form indicates that you do not meet the admissions requirements for acceptance into Concord Law School.";
	 x.innerHTML= str;
}

function validate_form()
{
	var x = document.getElementById("form1");
	var y = document.getElementById("error");
	var missing;
	var fname = x.Fname.value;
	var lname = x.Lname.value;
	var email = x.Email.value;
	var add1 = x.Address.value;
	var city = x.City.value;
	var zip = x.Zip.value;
	var hphone = x.HPhone.value;
	var wphone = x.WPhone.value;
	var interest = x.Interest.value;
	var bachelor = x.Bachelors;
	var education =x.anotherProgram;
	var lawschool = x.AttendedLawSchool;
	var state = x.State.selectedIndex;
	var errorStr;
	
	errorStr= "<ol>  " ;
	
	if ((fname =="") || (fname.length == 0))
	{
		errorStr +="<li>Fisrt Name is required";
		missing = true;	
	}
	
	if ((lname=="") || (lname.length == 0))
	{
		errorStr +="<li>Last Name is required";
		missing = true;	
	}
	
	// email
	if ((email=="") || (email.length == 0))
	{
		errorStr +="<li>Email Address is required";
		missing = true;	
	}
	
	apos=email.indexOf("@")
	dotpos=email.lastIndexOf(".")
	if (apos<1 || dotpos-apos<2) 
	{
		errorStr +="<li>Email is in the wrong format ";
		missing = true;	
		
	}
			
	
	if ((add1=="") || (add1.length == 0))
	{
		errorStr +="<li>Address is required";
		missing = true;	
	}
	
	if ((city=="") || (city.length == 0))
	{
		errorStr +="<li>City is required";
		missing = true;	
	}
	
	if (state == 0)
	{
		errorStr +="<li>State is required";
		missing = true;	
	}
	
	if ((zip=="") || (zip.length == 0))
	{
		errorStr +="<li>Zip Code is required";
		missing = true;	
	}
	
	if ((hphone=="") || (hphone.length == 0))
	{
		errorStr +="<li>Home Phone is required";
		missing = true;	
	}
	
	if ((wphone=="") || (wphone.length == 0))
	{
		errorStr +="<li>Work Phone is required";
		missing = true;	
	}
	
	// bachelor
	var myoption1= -1;
	for ( i=bachelor.length-1; i> -1; i--)
	{
		if (bachelor[i].checked)
		{
			myoption1 = 1;
		}
	}
	
	if (myoption1 == -1 )
	{
		errorStr +="<li>Bachelor's Degree information is required";
		missing = true;	
	}
	
	//education
	var myoption2= -1;
	for ( i=education.length-1; i> -1; i--)
	{
		if (education[i].checked)
		{
			myoption2 = 1;
		}
	}
	
	if (myoption2 == -1 )
	{
		errorStr +="<li>Education information is required";
		missing = true;	
	}
	
	
	//lawschool
	var myoption3= -1;
	for ( i=lawschool.length-1; i> -1; i--)
	{
		if (lawschool[i].checked)
		{
			myoption3 = 1;
		}
	}
	
	if (myoption3 == -1 )
	{
		errorStr +="<li>Lawschool information is required";
		missing = true;	
	}
	
	

	if ( interest.length > 200)
	{
		errorStr +="<li>Interest information is limited to 200 characters";
		missing = true;	
	}
	
	
	errorStr +="</ol> " ;	
	//	alert ("misong: " + missing);
//	return true;
		
		if (missing)
		{
			y.innerHTML = errorStr;	
			return false;
		}
		else
		{
			//alert("good");
			return true;
		}
	/*	if (validate_required(Fname,"Email must be filled out!")==false)
  		{		return false}*/
	
}





function mOver(id)
{
	identity=document.getElementById(id);
	identity.className="Nav_on";
	
}

function mOut(id)
{
	identity=document.getElementById(id);
	identity.className="Nav_off";
	window.status='';
}

function msOver(id)
{
	identity=document.getElementById(id);
	identity.className="Nav_sub2";
	
}

function msOut(id)
{
	identity=document.getElementById(id);
	identity.className="Nav_sub";
	window.status='';
}



function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}

function changeImages() {
  if (document.images && (preloadFlag == true)) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

var preloadFlag = false;
function preloadImages() {
  if (document.images) {
    nav_continue_education_over = newImage("images/nav_continue-education-over.gif");
    nav_law_degree_over = newImage("images/nav_law-degree-over.gif");
    nav_using_education_over = newImage("images/nav_using-education-over.gif");
    nav_admissions_over = newImage("images/nav_admissions-over.gif");
    nav_about_concord_over = newImage("images/nav_about-concord-over.gif");
    nav_benefits_over = newImage("images/nav_benefits-over.gif");
    nav_why_concord_over = newImage("images/nav_why-concord-over.gif");
    preloadFlag = true;
  }
}


function validateForm(f) {
//	if (f.programs.selectedIndex==0) {
//		alert("Please select a program!");
//		f.programs.focus();
//		return false;
//	}
	if (f.firstname.value == "")  {
		alert("Please enter your first name.");
		f.firstname.focus();
		return false;
	}
	if (f.lastname.value == "") {
		alert("Please enter your last name.");
		f.lastname.focus();
		return false;
	}
	if (f.email.value=="") {
		alert("Please include your E-mail Address!");
		f.email.focus();
		return false;
	} else {
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(f.email.value))){
		alert("Invalid E-mail Address.  Please re-enter.");
		f.email.focus();
		return false;
		}
	}
	
//	f.submit();
	document.location="request-info.asp?programs="+ f.programs.selectedIndex + "&firstname="+ f.firstname.value + "&lastname="+f.lastname.value + "&email=" + f.email.value + "&nav=bodynav";
//	return true;
}

function validateForm2(f) {
//	if (f.programs.selectedIndex==0) {
//		alert("Please select a program!");
//		f.programs.focus();
//		return false;
//	}
	if (f.firstname.value == "")  {
		alert("Please enter your first name.");
		f.firstname.focus();
		return false;
	}
	if (f.lastname.value == "") {
		alert("Please enter your last name.");
		f.lastname.focus();
		return false;
	}
	if (f.email.value=="") {
		alert("Please include your E-mail Address!");
		f.email.focus();
		return false;
	} else {
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(f.email.value))){
		alert("Invalid E-mail Address.  Please re-enter.");
		f.email.focus();
		return false;
		}
	}
	
//	f.submit();
	document.location="requestinfo.asp?programs="+ f.programs.selectedIndex + "&firstname="+ f.firstname.value + "&lastname="+f.lastname.value + "&email=" + f.email.value + "&nav=bodynav";
//	return true;
}

/****************************************
** copied from live site [25JUN07]     **
*****************************************/
function openwin(url) {
	window.open(url, '', 'width=900,height=550,scrollbars=1,resizable=1');
}