

function reloadWithEventID(evtID){
    var currentUrl = window.location.href;
    currentUrlParts = currentUrl.split('?');

    if(currentUrlParts.length > 1){
        if(currentUrlParts[1].indexOf('?eventID=') != -1){
        // possible to manipulate query string here if need to preserve other GET values...
        }
        var newUrl = currentUrlParts[0] + "?eventID=" + evtID;
    }else{
        var newUrl = currentUrl + "?eventID=" + evtID;
    }

    window.location.href = newUrl;

}


function showServiceForm(id, edit, service){
    var elementID = "serviceForm" + id;
    if($(elementID).visible()){$(elementID).hide();}
    else{
        $(elementID).show();
    }
    if(edit){
        $('serviceOption').selectedIndex = service;
    }

}

function showAppointmentForm(id, edit){
    var elementID = "appointmentForm" + id;
    if($(elementID).visible()){$(elementID).hide();}
    else{
        $(elementID).show();
    }
    //if(edit){
    //    $('serviceOption').selectedIndex = service;
    //}
}

function showAssessmentForm(id){
    var elementID = "assessmentForm" + id;
    if($(elementID).visible()){$(elementID).hide();}
    else{
        $(elementID).show();
    }
}

function showHideBM(id){
    if($(id).visible()){$(id).hide();}
    else{
        $(id).show();
    }

}

function isnumeric(sText){
   var ValidChars = "0123456789.,-";
   var IsNumber=true;
   var Char;
   for (i = 0; i < sText.length && IsNumber == true; i++) {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1) {
         IsNumber = false;
         }
      }
   return IsNumber;
   }