<!--
function tagSelected (objControl, strOpen, strClose){
   objControl.focus();
   document.selection.createRange().text = strOpen + document.selection.createRange().text +  strClose;
   event.returnValue=false;
}
function validateDelete() {
	if (!confirm("Are you sure you wish to delete this message!")) {
      event.returnValue=false;
      }
  }
  
function validateDeleteThread() {
	if (!confirm("Are you sure you wish to delete this entire thread?!")) {
      event.returnValue=false;
      }
  }

function validate(){
   if (document.post.title.value == ""){
      alert("Please enter a title in the title field");
      return false;
   }
   if (document.post.message.value == ""){
      alert("Please enter a message in the message field");
      return false;
   }
   return true;
}

function smilie(thesmilie) {
	document.post.message.value += " "+thesmilie+" ";
	document.post.message.focus();
}

function format_sel(v) {
  var str = document.selection.createRange().text;
  document.post.message.focus();
  var sel = document.selection.createRange();
  sel.text = "<" + v + ">" + str + "</" + v + ">";
  return;
}

function format_quote() {
  var str = document.selection.createRange().text;

 
    str = str.replace(/\r\n/g, '<BR>');
    strs = str.replace(/\n/g, '<BR>');
    str = str.replace(/\r/g, '<BR>');
 <!--  str = str.replace(/\r\n/g, '\r' + "<BR><BR>");

  str = "[quote]" + str + "[/quote]" + '\r\r';

  editor_insertHTML('message', str)
  		  
  return;	
}

function insert_link() {
  var str = document.selection.createRange().text;
  document.post.message.focus();
  var my_link = prompt("Enter URL:","http://");
  if (my_link != null) {
    var sel = document.selection.createRange();
	if (str){
	sel.text = "<a class=\"content\" href=\"" + my_link + "\">" + str + "</a>";
	}else{
	sel.text = "<a class=\"content\" href=\"" + my_link + "\">link</a>";
	}
  }
  return;
}
//-->
