<!--
	var isQselected = false;
	function storeQcaret(textEl) {
		if (textEl.createTextRange) {
			textEl.caretPos = document.selection.createRange().duplicate();
			isQselected = true;
		}
	}

	function Qicon(myQcode) {
		var txtQobj = document.quickForm.qarea;
		if (txtQobj.createTextRange && txtQobj.caretPos) {
			var caretPos = txtQobj.caretPos;
			if (caretPos.text.charAt(caretPos.text.length - 1) == ' ') {
				caretPos.text = myQcode + ' ';
			} else {
				caretPos.text = myQcode;
			}
			if (txtQobj.caretPos.text=='') {
				txtQobj.focus();
			}
		} else {
			txtQobj.value += myQcode;
			txtQobj.focus();
		}
	}
	function insertmyQcode (myQsymbol) {
		var caretPos = document.quickForm.qarea.caretPos;
		switch (myQsymbol) {
			case 'url' :
				var thisQurl = prompt("ป้อน URL ตรงนี้", "http://");
				if (!thisQurl | thisQurl == "http://"){return;}
				if (isQselected && !caretPos.text == '') {
					myQtext = ' ' + "[:URL=" + thisQurl + ":]" + caretPos.text + "[:/URL:]" + ' ';
					isQselected = false;
				} else if (document.quickForm.qarea.selectionEnd && (document.quickForm.qarea.selectionStart | document.quickForm.qarea.selectionStart == 0)) {
					mozInsert(document.quickForm.qarea, "[:URL=" + thisQurl + ":]", "[:/URL:]");
					return;
				} else {
					var thisTitle = prompt("ทีนี้ก็ป้อนชื่อลิงค์ลงไป", thisQurl);
					if (!thisTitle){return;}
					myQtext = ' ' + "[:URL=" + thisQurl + ":]" + thisTitle + "[:/URL:]" + ' ';
				}
				doQinsert(myQtext);
				break;
			case 'bold' :
				if (isQselected && !caretPos.text == '') {
					isQselected = false;
					myQtext = "[:b:]" + caretPos.text + "[:/b:]";
				} else if (document.quickForm.qarea.selectionEnd && (document.quickForm.qarea.selectionStart | document.quickForm.qarea.selectionStart == 0)) {
					mozInsert(document.quickForm.qarea, "[:b:]", "[:/b:]");
					return;
				} else {
					var thisBold = prompt("ป้อนข้อความที่ต้องการให้เป็นตัวหนา", "ตัวหนา");
					if(!thisBold) {return;}
					myQtext = "[:b:]" + thisBold + "[:/b:]";
				}
				doQinsert(myQtext);
				break;
			default : 
				if (isQselected && !caretPos.text == '') {
					myQtext = ' ' + myQsymbol + ' ' + caretPos.text;
					isQselected = false;
				} else {
					myQtext = ' ' + myQsymbol + ' ';
				}
				doQinsert(myQtext);
		}
	}

	function doQinsert(myQcode) {
		var txtQobj = document.quickForm.qarea;
		if (txtQobj.createTextRange && txtQobj.caretPos) {
			var caretPos = txtQobj.caretPos;
			if (caretPos.text.charAt(caretPos.text.length - 1) == ' ') {
				caretPos.text = myQcode + ' ';
			} else {
				caretPos.text = myQcode;
			}
			if (txtQobj.caretPos.text=='') {
				isQselected = false;
				txtQobj.focus();
			}
		} else if (txtQobj.selectionEnd && (txtQobj.selectionStart | txtQobj.selectionStart == 0)) {
			mozInsert(txtQobj, myQcode, "");
			return;
		} else {
			txtQobj.value += myQcode;
			txtQobj.focus();
		}
	}


	function checkQInput() {
		if(document.quickForm.qarea.value=="") {
			document.quickForm.qarea.focus()
			return false
		}
	}
// -->