function AddText(NewCode) {
	document.follow.answer.value += NewCode
	document.follow.answer.focus();
}

function underline() {
	AddTxt="[u][/u]";
	AddText(AddTxt);
}

function email() {
	AddTxt="[email][/email]";
	AddText(AddTxt);
}

function bold() {
	AddTxt="[b][/b]";
	AddText(AddTxt);
}

function italicize() {
	AddTxt="[i][/i]";
	AddText(AddTxt);
}

function quote() {
	AddTxt="[quote][/quote]";
	AddText(AddTxt);
}

function center() {
	AddTxt="[center][/center]";
	AddText(AddTxt);
}

function hyperlink() {
	AddTxt="[url][/url]";
	AddText(AddTxt);
}

function showcode() {
	AddTxt="[code][/code]";
	AddText(AddTxt);
}

function list() {
	AddTxt="[list][*][*][*][/list]";
	AddText(AddTxt);
}

function showcolor(color) {
	AddTxt="[color="+color+"][/color]";
	AddText(AddTxt);
}

function smiley() {
	AddTxt=":b1:";
	AddText(AddTxt);
}

function love() {
	AddTxt=":b2:";
	AddText(AddTxt);
}

function wink() {
	AddTxt=":b3:";
	AddText(AddTxt);
}

function rotfl() {
	AddTxt=":b4:";
	AddText(AddTxt);
}

function cheesy() {
	AddTxt=":b5:";
	AddText(AddTxt);
}

function razz() {
	AddTxt=":b6:";
	AddText(AddTxt);
}

function grin() {
	AddTxt=":b7:";
	AddText(AddTxt);
}

function lol() {
	AddTxt=":b8:";
	AddText(AddTxt);
}

function angry() {
	AddTxt=":b9:";
	AddText(AddTxt);
}

function donot() {
	AddTxt=":b10:";
	AddText(AddTxt);
}

function sad() {
	AddTxt=":b11:";
	AddText(AddTxt);
}

function cry() {
	AddTxt=":b12:";
	AddText(AddTxt);
}

function frown() {
	AddTxt=":b13:";
	AddText(AddTxt);
}

function shocked() {
	AddTxt=":b14:";
	AddText(AddTxt);
}

function vomit() {
	AddTxt=":b15:";
	AddText(AddTxt);
}

function cool() {
	AddTxt=":b16:";
	AddText(AddTxt);
}

function cool2() {
	AddTxt=":b17:";
	AddText(AddTxt);
}

function huh() {
	AddTxt=":b18:";
	AddText(AddTxt);
}

function confused() {
	AddTxt=":b19:";
	AddText(AddTxt);
}

function blush() {
	AddTxt=":b20:";
	AddText(AddTxt);
}

function idea() {
	AddTxt=":b21:";
	AddText(AddTxt);
}

function help() {
	AddTxt=":b22:";
	AddText(AddTxt);
}

function bye() {
	AddTxt=":b23:";
	AddText(AddTxt);
}
function drop() {
	AddTxt=":b24:";
	AddText(AddTxt);
}
function ValidateForm() {
	var MessageMax  = "2000";

	MessageLength  = document.follow.answer.value.length;
    NameLength  = document.follow.name.value.length; 
    CaptchaLength  = document.follow.inputCaptcha.value.length; 
	errors = "";

	if (MessageLength < 2) {
		errors = "คุณต้องระบุข้อความที่จะส่งก่อนกดส่งข้อความ";
        alert(errors);
        document.follow.answer.focus(); 
            return false;
	}
	if (MessageMax !=0) {
		if (MessageLength > MessageMax) {
			errors = "ไม่สามารถส่งได้ครับ:\n จำนวนตัวอักษรที่อนุญาติให้ส่งได้สูงสุดคือ " + MessageMax + " ตัวอักษร\n ตัวอักษรที่คุณกรอกมาจำนวน: " + MessageLength;
            alert(errors);
             document.follow.answer.focus();
            return false;
		}
	}
    if (NameLength < 3 ) {
        errors = "กรุณากรอกชื่อด้วยนะค่ะ.";
        alert(errors);
        document.follow.name.focus(); 
        return false;
    }
    if (CaptchaLength != 5 ) {
        errors = "กรุณากรอกโค้ดด้วยนะค่ะ.";
        alert(errors);
        document.follow.inputCaptcha.focus(); 
        return false;
    }
	if (errors != "") {
		alert(errors);
		return false;
	} else {
	document.follow.Submit.disabled = true;
	return true;
	}
}