function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) 
		{thisfield.value = "";
		}
}

function checkWholeForm(captchaForm) {
    var why = "";
    why += checkYourname(captchaForm.yourname.value);
    why += checkClient(captchaForm.client.value);
    why += checkReason(captchaForm.reason.value);
    why += checkEmail(captchaForm.email.value);
    if (why != "") {
       alert(why);
       return false;
    }
return true;
}

// check your name
function checkYourname (strng) {
var error = "";
if (strng == "") {
   error = "Please enter your full name.\n";
}

return error;    
}    

// check client
function checkClient (strng) {
var error = "";
if (strng == "") {
   error = "Please enter client's name.\n";
}

return error;    
}    

//check reason
function checkReason (strng) {
var error = "";
if (strng == "") {
   error = "Please enter the reason for referral.\n";
}

return error;    
}    

/*
// phone number - strip out delimiters and check for 10 digits
function checkPhone (strng) {

var stripped = strng.replace(/[\(\)\.\-\ ]/g, ''); //strip out acceptable non-numeric characters
    if (isNaN(parseInt(stripped))) {
       error = "The phone number contains illegal characters.";
  
    }
    if (!(stripped.length == 10)) {
	error = "The phone number is the wrong length. Make sure you included an area code.\n";
    } 
return error;
}
*/

// check email
function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "Please enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) { 
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;    
}

// for navmenu2
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;