function checkForm()
{
  document.postmodify.username.value=trim(document.postmodify.username.value);
  document.postmodify.email.value=trim(document.postmodify.email.value);
  if(document.postmodify.username.value == "")
  {
    alert("You forgot to fill in the Name field. Please correct it and re-submit.");
    document.postmodify.username.focus();
    return false;
 }
 if(document.postmodify.email.value == "")
 {
   alert("You forgot to fill in the Email field. Please correct it and re-submit.");
   document.postmodify.email.focus();
   return false;
 }
 if(document.postmodify.messagetext.value.length<6 || document.postmodify.messagetext.value.length>1500)
 {
   alert("Your message is either too short or too long. Please correct it and re-submit.");
   document.postmodify.messagetext.focus();
   return false;
 }
 flag=1;
 return true;
}

function storeCaret(text)
{ 
  if (text.createTextRange)
  {
    text.caretPos = document.selection.createRange().duplicate();
  }
}
	
function AddText(text)
{
  if (document.postmodify.messagetext.createTextRange && document.postmodify.messagetext.caretPos)
  {      
    var caretPos = document.postmodify.messagetext.caretPos;      
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
    document.postmodify.messagetext.focus();
  }
  else
  {
    document.postmodify.messagetext.value += text;
    document.postmodify.messagetext.focus(caretPos);
  }
}

function addnbsp() {
	AddText("<sp>");
}
function addred() {
	AddText("<red>My red text</red>");
}
function addgreen() {
	AddText("<green>My green text</green>");
}
function addblue() {
	AddText("<blue>My blue text</blue>");
}
function addlblue() {
	AddText("<lblue>My lblue text</lblue>");
}
function addyellow() {
	AddText("<yellow>My yellow text</yellow>");
}
function addcyan() {
	AddText("<cyan>My cyan text</cyan>");
}
function addpurple() {
	AddText("<purple>My purple text</purple>");
}
function addpink() {
	AddText("<pink>My pink text</pink>");
}
function addorange() {
	AddText("<orange>My orange text</orange>");
}
function addbrown() {
	AddText("<brown>My brown text</brown>");
}
function addcoltext() {
	AddText("[color]#ff0000[ct]My coloured text[/color]");
}
function addstyletext() {
	AddText("[font]face='times new roman' size=5 color=#ff3080[f]Happy valentine's day![/font]");
}
function addmarquee() {
	AddText("[marquee][mfont]Monotype Corsiva[mweight]bold[mcolor]#4264D2[msize]24pt[mtext]Scrolling Text[/marquee]");
}
function addimg() {
	AddText("<img> http://www.xxx.com/mypic.jpg </img>");
}
function addurl() {
	AddText("<url> http://www.xxx.com/yyy.html <text> mylink </>");
}
function addurlimg() {
	AddText("<url> http://www.xxx.com/yyy.html <urlimg> http://www.xxx.com/yyy.jpg </urlimg>");
}
function addemail() {
	AddText("<email> xxx@yyy.com <text> myname </>");
}
function addb() {
	AddText(" <b>my_bold_comment</b>");
}
function addi() {
	AddText(" <i>my_italic_comment</i>");
}
function addu() {
	AddText(" <u>my_underline_comment</u>");
}
function addtt() {
	AddText(" <tt>my_teletyper_comment</tt>");
}
function addli() {
	AddText(" <li>");
}
function adddd() {
	AddText(" <dd>");
}
function smile1() {
	AddText(" :)");
}
function spin() {
	AddText(" :-)");
}
function evilgrin() {
	AddText(" >:-)");
}
function smile2() {
	AddText(" >:)");
}
function scream() {
	AddText(" >:-D");
}
function tong() {
	AddText(" >:D");
}
function biggrin() {
	AddText(" :D");
}

function lol3() {
	AddText(" :-D");
}
function lol1() {
	AddText(" 8D");
}
function biggergrin() {
	AddText(" 8-D");
}
function frown1() {
	AddText(" >:(");
}
function angry() {
	AddText(" >:-(");
}
function shocked() {
	AddText(" :o");
}
function hoo() {
	AddText(" :-o");
}

function wink1() {
	AddText(" ;)");
}
function winky() {
	AddText(" ;-)");
}
function tongue2() {
	AddText(" :p");
}
function grntongue() {
	AddText(" :-p");
}
function sad2() {
	AddText(" :(");
}
function sad3() {
	AddText(" :-(");
}
function sad1() {
	AddText(" ;(");
}

function cry1() {
	AddText(" ;-(");
}
function glasses() {
	AddText(" B-)");
}
function coollook() {
	AddText(" !:8)");
}
function cool() {
	AddText(" :cool:");
}
function shock() {
	AddText(" ?:)");
}
function oog() {
	AddText(" 8)");
}
function a9() {
	AddText(" :X");
}
function tongue1() {
	AddText(" :P");
}

function froh5() {
	AddText(" ;!)");
}
function wrygrin() {
	AddText(" :-/");
}
function neutral() {
	AddText(" :-n");
}
function bignose() {
	AddText(" :o)");
}
function bignosewink() {
	AddText(" ;o)");
}
function winkandbiggrin() {
	AddText(" ;-D");
}
function madtongue() {
	AddText(" >:-P");
}

function surprised() {
	AddText(" [:-o");
}
function tonguewink() {
	AddText(" ;-P");
}
function smirk() {
	AddText(" :8)");
}
function happyglasses() {
	AddText(" :8-)");
}
function sleeping() {
	AddText(" [-I");
}
function blyawn() {
	AddText(" /-I");
}
function drooling1() {
	AddText(" /-o");
}

function uhoh3() {
	AddText(" /-(");
}
function bigsmirk() {
	AddText(" :8D");
}
function summer() {
	AddText(" :8-D");
}
function lookaway() {
	AddText(" :8[");
}
function pinkcool() {
	AddText(" :8-[");
}
function confused() {
	AddText(" ?:-S");
}
function confused1() {
	AddText(" ?:-p");
}
function confused2() {
	AddText(" ?:-P");
}

function confused3() {
	AddText(" ?:-(");
}
function idea() {
	AddText(" !:)");
}
function flower() {
	AddText(" (f)");
}
function flower2() {
	AddText(" (F)");
}
function piratsmile() {
	AddText(" P-)");
}
function pirate() {
	AddText(" P-[");
}
function piratmad() {
	AddText(" P-(");
}

function confused4() {
	AddText(" s:(");
}
function artist() {
	AddText(" :artist:");
}
function bowl() {
	AddText(" :bowling:");
}
function gossip() {
	AddText(" :gossip:");
}
function duel() {
	AddText(" :duel:");
}
function xyxwave() {
	AddText(" :wave2:");
}
function wave() {
	AddText(" :wave:");
}
function jerk() {
	AddText(" :jerk:");
}
function nono1() {
	AddText(" :ohno:");
}

function nono() {
	AddText(" :nono:");
}
function mad1() {
	AddText(" :mad:");
}
function sick1() {
	AddText(" :sick:");
}
function mecry() {
	AddText(" :cry:");
}
function uhh() {
	AddText(" :uhh:");
}
function pinkwacko() {
	AddText(" :wacko:");
}
function yinyang() {
	AddText(" :yinyang:");
}

function frog() {
	AddText(" :frog:");
}
function dizzy() {
	AddText(" :dizzy:");
}
function zahn() {
	AddText(" :brush:");
}
function biggrinparty() {
	AddText(" :party:");
}
function biggrinsanta() {
	AddText(" :santa:");
}
function up() {
	AddText(" :up:");
}
function down() {
	AddText(" :down:");
}

function nuts() {
	AddText(" :nuts:");
}
function frusty() {
	AddText(" :frusty:");
}
function shinner() {
	AddText(" :fight:");
}

function barf() {
	AddText(" :barf:");
}
function barf1() {
	AddText(" :barf2:");
}
function burnout() {
	AddText(" :burnout:");
}
function frech() {
	AddText(" :beh:");
}
function sado() {
	AddText(" :sado:");
}

function sperm() {
	AddText(" :sperm:");
}
function argue() {
	AddText(" :argue:");
}
function cheers() {
	AddText(" :cheers:");
}
function smlove2() {
	AddText(" :love:");
}
function sex() {
	AddText(" :sex:");
}

function band() {
	AddText(" :band:");
}
function birthday() {
	AddText(" :birthday:");
}
function olympic1() {
	AddText(" :olympic:");
}

function lickout() {
	AddText(" :lickout:");
}
function crazy() {
	AddText(" :crazy:");
}
function freaks() {
	AddText(" :freaks:");
}
function hapfac() {
	AddText(" :hapfac:");
}
function jump() {
	AddText(" :jump:");
}
function throwup() {
	AddText(" :throwup:");
}
function handball() {
	AddText(" :handball:");
}
function fart() {
	AddText(" :fart:");
}
function rockband() {
	AddText(" :rockband:");
}
function smiliecolors() {
	AddText(" :smiliecolors:");
}
function smilejap() {
	AddText(" :jap:");
}
function remykiss() {
	AddText(" :kiss:");
}
function lovestory() {
	AddText(" :lovestory:");
}
function blowjob() {
	AddText(" :blowjob:");
}
function breaklamp() {
	AddText(" :breaklamp:");
}
function pacman() {
	AddText(" :pacman:");
}
function chicken() {
	AddText(" :chicken:");
}
function grjump() {
	AddText(" :grjump:");
}
function cry2() {
	AddText(" :cry2:");
}

function bascket() {
	AddText(" :bascket:");
}
function yoyo() {
	AddText(" :yoyo:");
}
function drink() {
	AddText(" :drink:");
}
function repuke() {
	AddText(" :repuke:");
}
function burger() {
	AddText(" :burger:");
}
function hour() {
	AddText(" :hour:");
}
function slow() {
	AddText(" :slow:");
}
function smoker() {
	AddText(" :smoker:");
}
function flower3() {
	AddText(" :flower3:");
}
function snowman() {
	AddText(" :snowman:");
}
function frosty() {
	AddText(" :frosty:");
}
function rain() {
	AddText(" :rain:");
}
function smilieswitch() {
	AddText(" :switch:");
}
