function validate(formT){
if (document.getElementById && !document.all) 
  {brType = "n6";}
else if (document.layers) 
  {brType = "n4";}
else if (document.all) 
  {brType = "ie";}
var ValidChars = "0123456789()-."; 
alertMsg = '';
     if (formT == 'a') {
        if (document.appt.DATE1.value.length == 0 || document.appt.TIME1.value.length == 0 ||
            document.appt.DATE2.value.length == 0 || document.appt.TIME2.value.length == 0) {
            alertMsg = '     - Fill in all dates and times.\n';
                             } 
                             }
     if (document.appt.LNAME.value.length == 0 || document.appt.FNAME.value.length == 0) { 
         alertMsg = alertMsg + '     - Enter both first and last name.\n';
                             }
     if (formT == 'a') {                    
        if (document.appt.HPHONE.value.length == 0 && document.appt.WPHONE.value.length == 0) {
            alertMsg = alertMsg + '     - Enter a home or a work telephone number, including area code.\n';
                             } 
        if (document.appt.HPHONE.value.length > 0 && document.appt.HPHONE.value.length < 10 ||
            document.appt.WPHONE.value.length > 0 && document.appt.WPHONE.value.length < 10) {
            alertMsg = alertMsg + '     - The phone number should be 10 digits (including area code).\n';
                             }                             
        if (document.appt.HPHONE.value.length > 0 && ValidChars.indexOf(document.appt.HPHONE.value.charAt(1)) == -1 || 
            ValidChars.indexOf(document.appt.HPHONE.value.charAt(2)) == -1 || ValidChars.indexOf(document.appt.HPHONE.value.charAt(3)) == -1 ||
            ValidChars.indexOf(document.appt.HPHONE.value.charAt(4)) == -1)  {
            alertMsg = alertMsg + '     - Invalid home phone number.\n';
                             }
        if (document.appt.WPHONE.value.length > 0 && inValidChars.indexOf(document.appt.WPHONE.value.charAt(1)) != -1) {
            alertMsg = alertMsg + '     - Invalid work phone number.\n';
                             }
                             }
     if (document.appt.EMAIL.value.length == 0) {
         alertMsg = alertMsg + '     - Enter a valid e-mail address where we can contact you.\n';
                             } 
     if (formT == 'c') {
        if (document.appt.EMAIL.value != document.appt.EMAIL2.value) {
            alertMsg = alertMsg + '     - E-mail address does not match verification field; Please re-enter.\n';
                             }
        if (document.appt.QUESTION.value.length == 0) {
            alertMsg = alertMsg + '     - Enter your question in the scrollable text box.\n';
                             } 
                             }                                 
     if (alertMsg != '') {
         alert('We detected the following issue(s) in the form;\n\n' + alertMsg + '\n Please correct and re-submit the form.\n\n'); 
         if (brType == "ie") {
             event.returnValue = false;}
         else {return false;}   
                             }      
         
                             }  
function linkcol(){

  var urlPath = window.location.pathname;
  var thisPage = urlPath.substring(urlPath.lastIndexOf('/') + 1);
  var pageName = thisPage.split('.',1);

  document.getElementById(pageName[0]).style.color="#ffcc00";

}