<!-- 
 
     // bbCode control by 
 
     // subBlue design 
 
     // www.subBlue.com 
 
    // changed by 
 
    // powah <marcus@valpiiish.se> 
 
     var theSelection = false; 
    
     var clientPC = navigator.userAgent.toLowerCase(); 
     var clientVer = parseInt(navigator.appVersion); 
    
     var is_ie  = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1)); 
     var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1)); 
             
    var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1)); 
     var is_mac =  (clientPC.indexOf("mac")!=-1); 
 
 
             
function addtag(tag, newtag, tagname, form) 
{ 
     var txt = window.document.bb.text; 
    
    if ((clientVer >= 4) && is_ie && is_win) 
    { 
       theSelection = document.selection.createRange().text; 
 
       if (!theSelection) 
       { 
             if(form.value == tag) 
          {  
              txt.value += "["+tag+"]"; 
              eval("window.document.bb."+tagname+".value = newtag;"); 
             } 
          else 
          { 
              txt.value += "[/"+tag+"]"; 
                 eval("window.document.bb."+tagname+".value = tag;");    
          } 
          txt.focus(); 
 
          return; 
       } 
 
       document.selection.createRange().text = "["+tag+"]" + theSelection + "[/"+tag+"]"; 
 
       txt.focus(); 
 
       return; 
 
     } 
    else 
    { 
    
    if((txt.value).substring(txt.selectionStart, txt.selectionEnd) == '') 
    { 
        if(form.value == tag) 
       { 
           txt.value = (txt.value).substring(0, txt.selectionStart) + "["+tag+"]" + 
                      (txt.value).substring(txt.selectionEnd, txt.textLength); 
                   
          eval("window.document.bb."+tagname+".value = newtag;"); 
       } 
       else 
       { 
           txt.value = (txt.value).substring(0, txt.selectionStart) + "[/"+tag+"]" + 
                      (txt.value).substring(txt.selectionEnd, txt.textLength);    
                   
             eval("window.document.bb."+tagname+".value = tag;");       
       } 
    } 
    else 
    { 
         txt.value = (txt.value).substring(0, txt.selectionStart) + "["+tag+"]" + 
                (txt.value).substring(txt.selectionStart, txt.selectionEnd) +  "[/"+tag+"]" + 
                (txt.value).substring(txt.selectionEnd, txt.textLength);          
    } 
     return;    
     }    
} 
     -->