function submitproc() {
        if (window.submitted) return false;
        window.submitted = true;
        return true;
}

function storeCaret(text) {
        if (text.createTextRange) text.caretPos = document.selection.createRange().duplicate();
}

function AddSelText(bbopen, bbclose) {
  if (document.postmodify.message.caretPos) {
    document.postmodify.message.caretPos.text = bbopen + document.postmodify.message.caretPos.text + bbclose;
    document.postmodify.message.caretPos.select();
  }
  else if (document.postmodify.message.setSelectionRange) {
    var selectionStart = document.postmodify.message.selectionStart;
    var selectionEnd = document.postmodify.message.selectionEnd;
    var replaceString = bbopen + document.postmodify.message.value.substring(selectionStart, selectionEnd) + bbclose;
    document.postmodify.message.value = document.postmodify.message.value.substring(0, selectionStart) + replaceString + document.postmodify.message.value.substring(selectionEnd);
    document.postmodify.message.setSelectionRange(selectionStart + bbopen.length, selectionEnd + bbopen.length);
  }
  else document.postmodify.message.value += bbopen + bbclose;
  document.postmodify.message.focus()
}

function AddText(text) {
  AddSelText(text, '');
}

function hr() {
        AddText("[hr]");
}

function size() {
        AddSelText("[size=2]","[/size]");
}

function font() {
        AddSelText("[font=Verdana]","[/font]");
}

function teletype() {
        AddSelText("[tt]","[/tt]");
}

function right() {
        AddSelText("[right]","[/right]");
}

function left() {
        AddSelText("[left]","[/left]");
}

function Offtop() {
        AddSelText("[offtop]","[/offtop]");
}

function superscript() {
        AddSelText("[sup]","[/sup]");
}

function subscript() {
        AddSelText("[sub]","[/sub]");
}

function image() {
        AddSelText("[img]","[/img]");
}

function ftp() {
        AddSelText("[ftp]","[/ftp]");
}

function move() {
        AddSelText("[move]","[/move]");
}

function shadow() {
        AddSelText("[shadow=red,left,300]","[/shadow]");
}

function glow() {
        AddSelText("[glow=red,2,300]","[/glow]");
}

function flash() {
        AddSelText("[flash=200,200]","[/flash]");
}

function pre() {
        AddSelText("[pre]","[/pre]");
}

function tcol() {
        AddSelText("[td]","[/td]");
}

function trow() {
        AddSelText("[tr]","[/tr]");
}

function table() {
        AddSelText("[table][tr][td]", "[/td][/tr][/table]");
}

function strike() {
        AddSelText("[s]","[/s]");
}

function underline() {
        AddSelText("[u]","[/u]");
}

function emai1() {
        AddSelText("[email]","[/email]");
}

function bold() {
        AddSelText("[b]","[/b]");
}

function italicize() {
        AddSelText("[i]","[/i]");
}

function quote() {
        AddSelText("[quote]","[/quote]");
}

function center() {
        AddSelText("[center]","[/center]");
}

function hyperlink() {
        AddSelText("[url]","[/url]");
}

function showcode() {
        AddSelText("[code]","[/code]");
}

function list() {
        AddSelText("[list][*]", "\n[/list]");
}

function showcolor(color) {
        AddSelText("[color="+color+"]","[/color]");
}

function attach() {
        AddText("[attach]");
}

function smiley() {
        AddText(" :)");
}

function wink() {
        AddText(" ;)");
}

function cheesy() {
        AddText(" :D");
}

function grin() {
        AddText(" ;D");
}

function angry() {
        AddText(" >:(");
}

function sad() {
        AddText(" :(");
}

function shocked() {
        AddText(" :o");
}

function cool() {
        AddText(" 8)");
}

function huh() {
        AddText(" ???");
}

function rolleyes() {
        AddText(" ::)");
}

function tongue() {
        AddText(" :P");
}

function lipsrsealed() {
        AddText(" :-X");
}

function embarassed() {
        AddText(" :-[");
}

function undecided() {
        AddText(" :-/");
}

function kiss() {
        AddText(" :-*");
}

function cry() {
        AddText(" :'(");
}

function moveNN(e) {if (parseInt(navigator.appVersion)>= 5){
if (document.getElementById('hint').style.visibility == "visible")
{hor = window.pageXOffset + window.innerWidth - document.getElementById('hint').offsetWidth - 20; ver = window.pageYOffset + window.innerHeight - document.getElementById('hint').offsetHeight - 20; posHor = window.pageXOffset + e.clientX + 10; posVer = window.pageYOffset + e.clientY + 10; posHor2 = window.pageXOffset + e.clientX - document.getElementById('hint').offsetWidth - 5; posVer2 = window.pageYOffset + e.clientY - document.getElementById('hint').offsetHeight - 5;
if (posVer<ver)
document.getElementById('hint').style.top = posVer+"px"
else
document.getElementById('hint').style.top = posVer2+"px";
if (posHor<hor)
document.getElementById('hint').style.left = posHor+"px"
else
document.getElementById('hint').style.left = posHor2+"px";
}}
else
{

if (document.getElementById('hint').visibility == "show")
{hor = window.pageXOffset + window.innerWidth - 20; ver = window.pageYOffset + window.innerHeight - document.getElementById('hint').document.height - 20; posHor = e.pageX + 10; posVer = e.pageY + 10; posHor2 = e.pageX - sizeNN - 5; posVer2 = e.pageY - document.getElementById('hint').document.height - 5; if (posVer<ver)
document.getElementById('hint').top = posVer+"px"
else
document.getElementById('hint').top = posVer2+"px"
if (posHor<hor)
document.getElementById('hint').left = posHor+"px"
else
document.getElementById('hint').left = posHor2+"px";
}}
}

function showhint(y,v)
{
if (navigator.appName == "Netscape"){
//document.captureEvents(Event.MOUSEMOVE);
document.addEventListener("MouseMove", moveNN, false);
document.onmousemove = moveNN;
}

x="<table border=0 cellspacing=0 cellpadding=1 id=hintborder width=500><tr><td><table border=0 cellspacing=0 cellpadding=3 id=hintbg width=100%><tr><td><font class=hint>" + y + "</font></td></tr></table></td></tr></table>";
document.getElementById('hint').innerHTML=x;
if(v==1)document.getElementById('hint').style.visibility="visible";else document.getElementById('hint').style.visibility="hidden";

}
function movehint()
{
if (navigator.appName != "Netscape"){
var e = window.event;
w=document.body.scrollWidth-document.getElementById('hint').offsetWidth;
h=document.body.scrollHeight-document.getElementById('hint').offsetHeight;
x=e.clientX+12 + document.documentElement.scrollLeft;
y=e.clientY+8 + document.documentElement.scrollTop;
xx=document.body.scrollLeft + event.clientX-document.getElementById('hint').offsetWidth-5;
yy=document.body.scrollTop + event.clientY-document.getElementById('hint').offsetHeight-5;
if(x<w)document.getElementById('hint').style.left=x;else document.getElementById('hint').style.left=x;
if(y<h)document.getElementById('hint').style.top=y;else document.getElementById('hint').style.top=y;
}
}

function hideIt(ob){
var obs=ob.childNodes[0];
if(obs.tagName=="FONT"){obs=obs.childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0];}
else obs=ob.childNodes[1].childNodes[0].childNodes[0].childNodes[0].childNodes[0];
if(obs.style.display=="none"){obs.style.display="block";}
else {obs.style.display="none";}}
function copyname(x){
AddText("[b]2[color=Red]"+x+"[/color]:[/b] ");}
var x='';
function createText(){
if (document.selection){
x=document.selection.createRange().text;}
else if (window.getSelection){
x = window.getSelection();}
else if (document.getSelection){
x = document.getSelection();}}
function copytext(date,id){
//a=;
//a='num=1111';
//if (b=a.match(/num=(\d*)/i)){};
//document.getElementById('n'+id).href.match(/'(.*)'/i)[1]
//if(x!=""){AddText(" [quote]"+x+document.getElementById('n'+id).href.match(/'(.*)'/i)[1]+" [/quote]");}}
//document.getElementById('n'+id).href.match(/'.*'/i);
//window.location.href.match(/num=\d*/i)
//window.location.href.match(/board=.*?;/i)
if(x!=""){AddText(" [quote author="+decodeURI(document.getElementById('n'+id).href.match(/'(.*)'/i)[1])+
" link="+window.location.href.match(/board=.*?;/i)+
window.location.href.match(/num=\d*/i)+
";start="+id+"#"+id+" date="+date+"]"+x+" [/quote]");}}
