startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("menublock");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="DIV") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}

window.onload=startList;


function mess() // Scramble email address
{
  var a,b,c,d,e
 
  a='<a hr'
  a+='ef=\"mai'
  b='w'
  b+='e'
  b+='bs'       
  b+='ite'
  c='\">'
  a+='lto:'
  b+='@'
  e='</' + 'a>'
  d='webs'
  d+='ite@tuto'
  d+='rhunt.c'
  d+='om'
  b+='drivinfpeople.com'

  document.write(a+b+c+d+e)
}

function addto()
{
  if ((navigator.appVersion.indexOf("MSIE") > 0) && (parseInt(navigator.appVersion) >= 4)) 
    window.external.AddFavorite("http://www.drivingpeople.com", "driving people");
  else
  {
    var msg = "Sorry we could not bookmark driving people automatically.";
    if(navigator.appName == "Netscape") msg += " [Please press CTRL+D]";
    javascript:alert(msg);
  }
} 


function validatesearch(signupform)
{
   var error_list = false
   var errors = ""
   if (signupform.subject.value == "none")
   {
     error_list = true
     errors = errors + "-> Please select a subject\n"
   }

   if (signupform.type.value == "none")
   {
     error_list = true
     errors = errors + "-> Please select a learner or instructor\n"
   }

   if (signupform.level.value == "none")
   {
     error_list = true
     errors = errors + "-> Please select a level\n"
   }

   if (signupform.postcode.value == "" || signupform.postcode.value == "Type Postcode")
   {
     error_list = true
     errors = errors + "-> Please select a postcode\n"
   }

   if (error_list == false)
     signupform.submit();
   else
     alert("Sorry there was a problem with the form data, the following error(s) occured;\n\n" + errors)
}


function IsNumeric(strString)
//  check for valid numeric strings
{
          var strValidChars = "£0123456789. ";
          var strChar;
          var blnResult = true;

          if (strString.length == 0) return false;

            for (i = 0; i < strString.length && blnResult == true; i++)
            {
              strChar = strString.charAt(i);
              if (strValidChars.indexOf(strChar) == -1)
              {
                blnResult = false;
              }
            }
            return blnResult;
}
