function verifyName(theForm) {
	var tName = theForm.name.value
	tName = tName.toLowerCase()
	var removeChars = Array(" ","-",".","/","*","^","@","!","+","=",">","<",",","1","2","3","4","5","6","7","8","9","0")
	for (var j=0; j < removeChars.length; j++) {
		tName = tName.split(removeChars[j]).join('');
	}
	var restrictedNames = Array("hpi","instruments","aaronhunt","aaronhunt","aahunt","ahunt","aaronandrew","andrewhunt","aah")
	var foundProblem = 0
	for (j=0; j < restrictedNames.length; j++) {
		if (tName.indexOf(restrictedNames[j]) > -1) { foundProblem = 1 }
	}
	if (foundProblem == 0) {
		var theTime = getTimeStamp("userlogin");
		doPost("userlogin", theTime);
		return true
	}
	alert("Sorry, I can't let you use that username.")
	return false
}

function getTimeStamp(isLogin) {
    var a_p = "";
	var d = new Date();
	var curr_hour = d.getHours();
	if (curr_hour < 12) {
	   a_p = "AM";
	}
	else {
	   a_p = "PM";
	}
	if (curr_hour == 0) { curr_hour = 12 }
	if (curr_hour > 12) { curr_hour = curr_hour - 12 }
	var curr_min = d.getMinutes();
	if (curr_min < 10) { curr_min = "0"+curr_min.toString() }
	var curr_time = curr_hour + ":" + curr_min + a_p
	if (isLogin == "login") {
		return "&time=logged in at "+curr_time
	}
	else if (isLogin == "userlogin") {
		return "logged in at "+curr_time
	}
	else if (isLogin == "logout" || isLogin == "userlogout") {
		return "&time=logged out at "+curr_time
	}
	else if (isLogin == "chatlog") {
		return "chatdate="+d.toDateString()+" "+curr_time
	}
	else if (isLogin == "online") {
		return "&time=is available for Live Chat ... "+curr_time
	}
	else if (isLogin == "offline") {
		return "&time=is currently unavailable for Live Chat ... "+curr_time
	}
	else if (isLogin == "unavailable") {
		return "&time=is currently unavailable for Live Chat ... "+curr_time+"</p><p><span class='name'>Please send an email to <a class='chat' href='contact.html'>contact@h-pi.com</a>.</span></p><p><span class='name'>Thank you!"
	}
	else {
		return "&time="+curr_time
	}
}

function styleText(theForm) {
	var theStyle = theForm.astyle.value
	if (theStyle == "123qwe") {
		return true
	}
	return false
}
