<!-- Hide from older browsers...

//Have the propmt box turned on by default
var promptOn = true;


//Function to turn on or off the prompt box
function PromptMode(selectMode){
	
	if (selectMode.options[selectMode.selectedIndex].value == 0){
		promptOn = false;
	}
	else{
		promptOn = true;
	}
}


// Function to add the code for bold italic centre and underline, to the note
function AddnoteCode(code, promptText, InsertText) {

	if (code != "") {
		if (promptOn == true){
			insertCode = prompt(promptText + "\n[" + code + "]ข้อความ[/" + code + "]", InsertText);
				if ((insertCode != null) && (insertCode != "")){
					document.webform.note.value += " [" + code + "] " + insertCode + " [/" + code + "] ";
				}
		}
		else{
			document.webform.note.value += " [" + code + "] [/" + code + "] ";
		}
	}
				
	document.webform.note.focus();
}

	
//Function to add the URL, indent, list, and Email code to the note
function AddCode(code) {

	//For the URL code
	if ((code != "") && (code == "URL")) {
		insertText = prompt("ใส่ชื่อของเว็บที่นี่", "");
			
			if ((insertText != null) && (insertText != "") && (code == "URL")){
				insertCode = prompt("โปรดใส่แอดเดรสของเว็บ", "http://");
					
					if ((insertCode != null) && (insertCode != "") && (insertCode != "http://")){					
						document.webform.note.value += "[" + code + "=" + insertCode + "]" + insertText + "[/" + code + "]";
					}
			}
	}
	
	//For the indent
	if ((code != "") && (code == "INDENT")) {
						
			document.webform.note.value += "      ";				
	}
				
	document.webform.note.focus();
}

	//Form Check
	
function checkreply()
{
      var v1 = document.webform.note.value;
      var v2 = document.webform.name.value;
        if ( v1.length==0)
           {
           alert("จะไม่พิมพ์อะไรหน่อยเรอะ!");
           document.webform.note.focus();           
           return false;
           }
        else if (v2.length==0)
           {
           alert("ใส่ชื่อด้วย!");
           document.webform.name.focus();           
		   return false;
           }
        else
           return true;
}

function checkpost()
{
      var v1 = document.webform.note.value;
      var v2 = document.webform.name.value;
	  var v3 = document.webform.topic.value;
        if ( v1.length==0)
           {
           alert("จะไม่พิมพ์อะไรหน่อยเรอะ!");
           document.webform.note.focus();           
           return false;
           }
        else if (v2.length==0)
           {
           alert("ใส่ชื่อด้วย!");
           document.webform.name.focus();           
		   return false;
           }
        else if (v3.length==0)
           {
           alert("หัวข้อด้วยซี่!");
           document.webform.topic.focus();           
		   return false;
           }
        else
        return true;
}

function checkregister()
{
      var v1 = document.webform.name.value;
      var v2 = document.webform.password.value;
	  var v3 = document.webform.email.value;
        if ( v1.length==0)
           {
           alert("ชื่อที่จะใช้ในบอร์ด!");
           document.webform.name.focus();           
           return false;
           }
        else if (v2.length==0)
           {
           alert("อย่าลืมกรอกรหัสผ่าน");
           document.webform.password.focus();           
		   return false;
           }
        else if (v3.length==0)
           {
           alert("ขออีเมลด้วย!");
           document.webform.email.focus();           
		   return false;
           }
        else
        return true;
}

function checkpass()
{
      var v1 = document.webform.passcheck.value;
        if ( v1.length==0)
           {
           alert("พาสเวิร์ด!");
           document.webform.passcheck.focus();           
           return false;
           }
        else
        return true;
}

function setsmile(what)
{
	document.webform.note.value = document.webform.elements.note.value+" "+what;
	document.webform.note.focus();
}
function setqoute(what)
{
	document.webform.note.value = document.webform.elements.note.value+"[ref]"+what+"[/ref] ";
	document.webform.note.focus();
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function Conf(object) {
  if (confirm("ระบบจะลบรายการนี้ออกไปอย่างถาวร") == true)  {
  return true;
  }
  return false;
  }

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

// -->

