//the following functions verify that input exists in search box before submitting search box contents.

function validateFormOnSubmit1(theForm) {
var reason = "";

  reason += validateEmpty(theForm.last);
  
  //The dialog below can contain individual reports of errors in the form by placing '+ reason' in the alert dialog text, outside of the quotes.
      
  if (reason != "") {
    alert("Please Enter a Doctor's Last Name.\n");
    return false;
  }

  return true;
}


//the following function validates the presence of input in required fields

function validateEmpty(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        error = "Search Field is Blank.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}


//verify that at least one drop down has been selected
function getIndex(){

	var x=document.getElementById("specialty1");

	if (x.selectedIndex == 0) {
	alert ("Please Select At Least One Search Criteria.\n");
	return false;
	}
	else {
	return true;
	}
}

function getIndex1(){

	var x=document.getElementById("specialty2");
	var p=document.getElementById("gender1");
	var z=document.getElementById("language1");
	var q=document.getElementById("city1");

	if ((x.selectedIndex)+(p.selectedIndex)+(z.selectedIndex)+(q.selectedIndex) == 0) {
	alert ("Please Select At Least One Search Criteria.\n");
	return false;
	}
	else {
	return true;
	}
}
