
function gotoPage(page) { window.location.href = page; }

//match HH:MM:SS
function isTime(sTime) { var timePat = "^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$"; if (!sTime.match(timePat)) { return false; } else { return true; } }

// match YYYY-MM-DD
function isDate(sDate) { var datePat = "^[0-9]{4}-(((0[13578]|(10|12))-(0[1-9]|[1-2][0-9]|3[0-1]))|(02-(0[1-9]|[1-2][0-9]))|((0[469]|11)-(0[1-9]|[1-2][0-9]|30)))$"; if (!sDate.match(datePat)) { return false; } else { return true; } }

// check for alphanumeric and underscore
function isAlphanum(str) { var alphaExp = "^[0-9a-zA-Z]+$"; if(str.match(alphaExp)){ return true; } else { return false; } }

