
function isValidEmail(strEmail)
{
  var blnHasAt     = strEmail.indexOf("@");
  var blnHasPeriod = strEmail.indexOf(".");

  if (strEmail.length < 5) return false;

  if (blnHasAt > 0 && blnHasPeriod > 0)
    return true;
  else
    return false;
}

function isTelNum(sobj){
  var strOK = "0123456789 ";
  var strInput = sobj.toUpperCase();
  for (var n = 0 ; n < strInput.length ; n ++ )
  {
    nCode = strInput.charAt(n);
    if (strOK.indexOf(nCode)== "-1")
    {
      return false;
    }
  }
  return true;
}


function changeto(highlightcolor)
{
  source=event.srcElement
  if (source.tagName=="TR")
    return

  while(source.tagName!="TR")
  source=source.parentElement
  if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
    source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor)
{
  if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
    return

  if (event.toElement!=source)
    source.style.backgroundColor=originalcolor
}

// Numeric Input check for Club Handicap's
function checkIt(evt) {
   evt = (evt) ? evt : window.event;
   var charCode = (evt.charCode) ? evt.charCode :
      ((evt.which) ? evt.which : evt.keyCode);
   if (charCode != 43 && charCode!= 45 && charCode != 46) {
     if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        window.status = "This field accepts numbers only.";
        return false;
     }
   }
   status = "";
   return true;
}

