//PLEASE FILL OUT THE FOLLOWING CUSTOMIZATION VARIABLES
//------------------------------------------------------------------------------------------

//ENTER THE LOCATION OF YOUR CLIPART DIRECTORY:
//EXAMPLE: var clipart_dir = "http://www.mysite.com/discus/clipart"
//DO -NOT- ADD A SLASH "/" AFTER THE WORD clipart!

var clipart_dir = "http://www.fjrowners.ws/forum/clipart";

//SET THE WIDTH OF YOUR PANEL HERE
//USE EITHER PERCENTAGE OF PAGE WIDTH (95%, 50%, ETC) OR PIXELS (600px, 250px, etc)

var panel_width = "100%";

//SET THE BACKGROUND AND TEXT COLORS FOR YOUR PANEL HERE
//ACCEPTABLE VALUES ARE EITHER HEX CODE (#0080FF, 72EA2F, ETC) OR COMMON COLOR NAMES (BLACK, WHITE, ETC)

//BACKGROUND COLOR FOR WHOLE TABLE CONTAINING ALL SECTIONS OF THE PANEL
//NOTE - IT IS ONLY VISIBLE IN INTERNET EXPLORER
var bgc1 = "white";

//BACKGROUND AND TEXT COLORS FOR THE "PANEL MODE" RADION BUTTON SECTION
var bgc2 = "white";
var fnt2 = "#000099";

//BACKGROUND AND TEXT COLORS FOR THE "SMILEY FACES" SECTION
var bgc3 = "white";
var fnt3 = "#000099";

//BACKGROUND COLOR FOR THE CLICKABLE BUTTONS SECTION 
var bgc4 = "white";

//BACKGROUND COLOR FOR THE DROP-DOWN LIST SECTION 
var bgc5 = "white";

//ENTER THE DEFAULT FONT FACE AND FONT COLOR FOR YOUR BOARD (FOUND IN 'BOARD MANAGER' IN ADMIN)

var d_face = "Verdana";
var d_color = "#000099";

//THIS VARIABLE WILL MAKE THE 'RAINBOW' TEXT LOOK BRIGHTER OR DARKER:
//IF YOUR BOARD BACKGROUND IS DARK, ENTER A VALUE BETWEEN 5 AND 8.
//IF YOUR BOARD BACKGROUND IS LIGHT, ENTER A NUMBER BETWEEN 1 AND 5.

var color_adjust = "3";

//END CUSTOMIZATION SECTION ----------------------------------------------------------------

//Format Panel SECTIONS:

//HEADER:
var f_header = 
         "<table border=0 cellpadding=5 cellspacing=2 width=" + panel_width + " bgcolor="+bgc1+"><tr bgcolor=" + bgc2 + "><td align=center>" + 
         "<font face="+d_face+" size=1 color="+fnt2+"><b>Format Panel Mode:</b>" + 
         
         "<input type='radio' name='mode' value='help' onClick='thelp(1)'>&nbsp;Help&nbsp;&nbsp;" + 
         "<input type='radio' name='mode' value='prompt' checked onClick='thelp(2)'>&nbsp;Full&nbsp;&nbsp;" + 
         "<input type='radio' name='mode' value='basic'  onClick='thelp(0)'>&nbsp;Basic&nbsp;&nbsp;" + 
         "<input type='radio' name='mode' value='nest'  onClick='thelp(4)'>&nbsp;Expert" +
	 "</td></tr>";
      
var smiley_list =
//SMILEY SECTION - ADD DESIRED SMILEY FACES HERE:

"<TR bgcolor=" + bgc3 + "><TD align='center'>" +
"<font face="+d_face+" size=1 color="+fnt3+"><b>Insert Emoticons:</b> <BR>" +

"<INPUT TYPE='radio' NAME='SF' VALUE='happy' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/happy.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='sad' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/sad.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='wink' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/wink.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='laff' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/laff.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='angry' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/angry.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='crazy' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/crazy.gif'>" +
"&nbsp;&nbsp;<INPUT TYPE='radio' NAME='SF' VALUE='proud' onClick='addsmiley(this.value)'><IMG src='" + clipart_dir + "/proud.gif'>" +
"<BR>" +
"</td></tr>";

var f_panel =
//USE THIS SECTION TO ADD OR DELETE IMAGES AND THEIR FUNCTIONS:
         
         "<TR bgcolor="+bgc4+"><TD align='center'>" +
         "<a href='javascript:center()' onMouseOver=\"window.status='Centered Text'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/center.gif' height=22 alt='Centered' border=0></a>" + 

         "<a href='javascript:bold()' onMouseOver=\"window.status='Bold Text'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/bold.gif' height=22 alt='Bold' border=0></a>" + 

         "<a href='javascript:italics()' onMouseOver=\"window.status='Italicized Text'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/italicize.gif' height=22 alt='Italics' border='0'></a>" + 

         "<a href='javascript:underline()' onMouseOver=\"window.status='Underlined Text'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/underline.gif' height=22 alt='Underline' border=0></a>" +

         "<a href='javascript:rgb()' onMouseOver=\"window.status='Color Text with RGB Value'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/rgb.gif' height=22 alt='Formats font by RGB values' border=0></a>" + 

         "<a href='javascript:mail()' onMouseOver=\"window.status='Insert Email Link'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/email.gif' height=22 alt='Insert Email' border=0></a>" + 

         "<a href='javascript:link()' onMouseOver=\"window.status='Insert Hyperlink'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/url.gif' height=22 alt='Insert Hyperlink' border=0></a>" + 

         "<a href='javascript:list()' onMouseOver=\"window.status='Insert List'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/list.gif' height='22' alt='Insert List' border=0></a>" +

         "<a href='javascript:table()' onMouseOver=\"window.status='Insert Table'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/table.gif' height=22 alt='Insert Table' border=0></a>" +

         "<a href='javascript:image()' onMouseOver=\"window.status='Insert an Image File'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/image.gif' height=22 alt='Insert Image' border=0></a>" +

         "<a href='javascript:attach()' onMouseOver=\"window.status='Attach a File'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/attach.gif' height=22 alt='Insert Attachment' border='0' ></a>" +

         "<a href='javascript:quote()' onMouseOver=\"window.status='Insert a Quote'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/quote.gif' height=22 alt='Insert Quote' border=0 ></a>" +

         "<a href='javascript:rainbow()' onMouseOver=\"window.status='Color Unformatted Posts with Random Colors'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/rainbow.gif' height=22 alt='Rainbow Effect' border=0 ></a>" +

         "<a href='javascript:bracket()' onMouseOver=\"window.status='Insert Closing Bracket'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/bracket.gif' height=22 alt='Insert closing bracket' border='0'></a>" +

      "<BR>" +
         "<img src='" + clipart_dir + "/buttons/panel_left.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
   
         "<a href='javascript:fp_info()' onMouseOver=\"window.status='Get info on the Format Panel'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/info.gif' alt='Get Format Panel Info' border=0 height=22></a>" +

         "<a href='javascript:codecount()' onMouseOver=\"window.status='Check your formatting codes'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/codecheck.gif' height=22 alt='Check Formatting' border=0></a>" +

         "<a href='javascript:undo()' onMouseOver=\"window.status='Undo Last Action'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/undo.gif' height=22 alt='Undo Last' border=0 ></a>" +

         "<a href='javascript:redo()' onMouseOver=\"window.status='Redo the Undone Action'; return true\" onMouseOut=\"window.status=''; return true\"><img src='" + clipart_dir + "/buttons/redo.gif' height=22 alt='Redo' border=0 ></a>" +
     
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel.gif'>" +
         "<img src='" + clipart_dir + "/buttons/panel_right.gif'>" +
         "<br>" +   
    
//USE THIS SECTION TO ADD OR REMOVE FONT FACE OPTIONS:
	 "<TR bgcolor=" + bgc5 + "><TD align='center'>" +
         "<select name='font' onChange='fontface(this.options[this.selectedIndex].value)'>" + 
         "<option value='" + d_face + "' selected>Default Font</option>" + 
         "<option value='Andale Mono'>Andale Mono</option>" + 
         "<option value='Arial'>Arial</option>" + 
         "<option value='Arial Black'>Arial Black</option>" + 
         "<option value='Book Antiqua'>Book Antiqua</option>" + 
         "<option value='Century Gothic'>Century Gothic</option>" + 
         "<option value='Comic Sans MS'>Comic Sans MS</option>" + 
         "<option value='Courier New'>Courier New</option>" + 
         "<option value='Georgia'>Georgia</option>" + 
         "<option value='Impact'>Impact</option>" + 
         "<option value='Tahoma'>Tahoma</option>" + 
         "<option value='Times New Roman'>Times New Roman</option>" + 
         "<option value='Trebuchet MS'>Trebuchet MS</option>" + 
         "<option value='Script MT Bold'>Script MT Bold</option>" + 
         "<option value='Stencil'>Stencil</option>" + 
         "<option value='Verdana'>Verdana</option>" + 
         "<option value='Lucida Console'>Lucida Console</option></select>&nbsp;&nbsp;&nbsp;" + 
//USE THIS SECTION TO ADD OR REMOVE FONT SIZE OPTIONS:
         "<select name='size' onChange='fontsize(this.options[this.selectedIndex].value)'>" + 
         "<option value='0' selected>Default Size</option>" +
         "<option value='-2'>-2 (Smallest)</option>" + 
         "<option value='-1'>-1 (Smaller)</option>" + 
         "<option value='0'>0 (Normal)</option>" + 
         "<option value='1'>1 (Bigger)</option>" + 
         "<option value='2'>2 (Biggest)</option></select>&nbsp;&nbsp;&nbsp;" + 
//USE THIS SECTION TO ADD OR REMOVE FONT COLOR OPTIONS:
         "<select name='color' onChange='fontcolor(this.options[this.selectedIndex].value)'>" + 
         "<option value='default' selected>Default Color</option>" + 
         "<option value='black'>Black</option>" + 
         "<option value='red'>Red</option>" + 
         "<option value='yellow'>Yellow</option>" +
         "<option value='green'>Green</option>" + 
         "<option value='orange'>Orange</option>" + 
         "<option value='purple'>Purple</option>" + 
         "<option value='blue'>Blue</option>" +
         "<option value='cyan'>Cyan</option>" + 
         "<option value='white'>White</option>" + 
         "<option value='gray'>Gray</option>" +
	   "</select>" + 
         "<br>" + 
         "</TD></TR></table>";
      
//END FORMAT PANEL HTML OUTPUT SECTION.

//COMBINE HEADER, SMILEYS, AND BODY FOR OUTPUT:

var wholepanel = f_header + smiley_list + f_panel;

//SCRIPT FUNCTIONS ::  DO NOT EDIT UNLESS YOU KNOW WHAT YOU ARE DOING!!
//IF YOU MESS THESE UP YOUR PANEL WILL NOT WORK!
//--------------------------------------------------------------------------------------

function fp_info() { 
if (helpstat) {
      alert("View Panel Info\nOpens a new window with a brief tutorial\non how to use the Format Panel functions.");
   } else {
var infowindir = clipart_dir+"/buttons/panel_info.html";
var InfoWin = window.open(infowindir,"Info_win","toolbar=no,location=no,menubar=no,scrollbars=yes,width=500,height=400,left=100,top=5,resizeable=no,status=no");
}
}

var helpstat = false;
var stprompt = true;
var basic = false;
var nest = false;
function thelp(swtch){
        if (swtch == 1){
                basic = false;
                stprompt = false;
                helpstat = true;
                nest = false;
        } else if (swtch == 0) {
                helpstat = false;
                stprompt = false;
                basic = true;
                nest = false;
        } else if (swtch == 2) {
                helpstat = false;
                basic = false;
                stprompt = true;
                nest = false;
        } else if (swtch == 4) {
                helpstat = false;
                basic = false;
                stprompt = false;
                nest = true;
        } else {
                helpstat = false;
                basic = false;
                stprompt = false;
                nest = false;
        }
}


function addcode(NewCode) {
	if (document.userpass) formid=document.userpass.message;
	else if (document.MF) formid=document.MF.message;
	else formid=document.forms[0].message;
mssg = formid.value;
formid.value+=NewCode;
formid.focus();
}

function addsmiley(sfname) {
    if (helpstat) {
      alert("Smiley Faces tag\nInserts code for desired smiley face.\nUSE: \\clipart{Name of Smiley}");
   } else {
      AddTxt="\\clipart{"+sfname+"}";
      addcode(AddTxt);
   }
}
function center() {
    if (helpstat) {
      alert("Centered tag\nCenters the enclosed text.\nUSE: \\c{This text is centered}");
   } else if (basic) {
      AddTxt="\\c{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\c{";
      addcode(AddTxt);
   } else {  
      txt=prompt("Text to be centered","Text");     
      if (txt!=null) {          
         AddTxt="\\c{"+txt+"}";
         addcode(AddTxt);
      }          
   }
}
function bold() {
   if (helpstat) {
      alert("Bold Tag\nMakes the enlosed text bold.\nUSE: \\b{This is some bold text}");
   } else if (basic) {
      AddTxt="\\b{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\b{";
      addcode(AddTxt);
   } else {  
      txt=prompt("Text to be made BOLD.","Text");     
      if (txt!=null) {           
         AddTxt="\\b{"+txt+"}";
         addcode(AddTxt);
      }       
   }
}
function italics() {
   if (helpstat) {
      alert("Italicize Tag\nMakes the enlosed text italicized.\nUSE: \\i{This is some italicized text}");
   } else if (basic) {
      AddTxt="\\i{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\i{";
      addcode(AddTxt);
   } else {   
      txt=prompt("Text to be italicized","Text");     
      if (txt!=null) {           
         AddTxt="\\i{"+txt+"}";
         addcode(AddTxt);
      }           
   }
}
function underline() {
     if (helpstat) {
      alert("Underline Tag\nUnderlines the enclosed text.\nUSE: \\u{This text is underlined}");
   } else if (basic) {
      AddTxt="\\u{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\u{";
      addcode(AddTxt);
   } else {  
      txt=prompt("Text to be Underlined.","Text");     
      if (txt!=null) {           
         AddTxt="\\u{"+txt+"}";
         addcode(AddTxt);
      }           
   }
}
function bracket() {
   if (helpstat) {
      alert("Bracket Tag\nUsed with the Nesting function.\nCloses brackets when tags inserted into each other \nUSE: \\CODE{TEXT\\MORECODE{Brackets will follow->}}");
   } else if (basic) {
      AddTxt="}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="}";
      addcode(AddTxt);
   } else {   
      AddTxt="}";
      addcode(AddTxt);
   }
}
function quote() {
   if (helpstat){
      alert("Quote tag\nQuotes the enclosed text to reference something specific that someone has posted.\nUSE: \\quote{This is a quote}");
   } else if (basic) {
      AddTxt="\\quote{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\quote{";
      addcode(AddTxt);
   } else {   
      txt=prompt("Text to be quoted","Text");     
      if(txt!=null) {          
         AddTxt="\\quote{"+txt+"}";
         addcode(AddTxt);
      }           
   }
}
function rgb() {
   if (helpstat) {
      alert("RGB Tag\nCodes to make text any color.\nUSE: \\rgb{CODE HERE, Text}");
   } else if (basic) {
      AddTxt="\\rgb{,}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\rgb{,";
      addcode(AddTxt);
   } else { 
      txt2=prompt("Text to be colored using rgb scale.\nLeave blank if you want to fill out the text later.",""); 
      if (txt2!=null) {
         txt=prompt("RGB Value for font.","");      
         if (txt!=null) {
            if (txt2=="") {
               AddTxt="\\rgb{"+txt+",}";
               addcode(AddTxt);
            } else {
               AddTxt="\\rgb{"+txt+","+txt2+"}";
               addcode(AddTxt);
            }         
         } 
      }
   }
}
function link() {
   if (helpstat) {
      alert("Hyperlink Tag\nTurns an url into a hyperlink.\nUSE: \\newurl{http://www.anywhere.com, descripton}");
   } else if (basic) {
      AddTxt="\\newurl{,}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\newurl{,";
      addcode(AddTxt);
   } else { 
      txt2=prompt("Text to be shown for the link.\nLeave blank if you want the url to be shown for the link.",""); 
      if (txt2!=null) {
         txt=prompt("URL for the link.","http://");      
         if (txt!=null) {
            if (txt2=="") {
               AddTxt="\\newurl{"+txt+","+txt+"}";
               addcode(AddTxt);
            } else {
               AddTxt="\\newurl{"+txt+","+txt2+"}";
               addcode(AddTxt);
            }         
         } 
      }
   }
}
function mail() {
   if (helpstat) {
      alert("Email Tag\nTurns an email address into a mailto hyperlink.\nUSE: \\mail{someone@anywhere.com, description}");
   } else if (basic) {
      AddTxt="\\mail{,}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\mail{,";
      addcode(AddTxt);
   } else { 
      txt2=prompt("Text to be shown for the link.\nLeave blank if you want the email address to be shown for the link.",""); 
      if (txt2!=null) {
         txt=prompt("Email address.","name@domain.com");      
         if (txt!=null) {
            if (txt2=="") {
               AddTxt="\\mail{"+txt+","+txt+"}";
            } else {
               AddTxt="\\mail{"+txt+","+txt2+"}";
            } 
            addcode(AddTxt);           
         }
      }
   }
}
function image() {
   if (helpstat){
      alert("Image Tag\nInserts an image into the post.\nUSE: \\image{Image description}");
   } else if (basic) {
      AddTxt="\\image{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\image{";
      addcode(AddTxt);
   } else {  
      txt=prompt("Image description","-My Image-");    
      if(txt!=null) {            
         AddTxt="\\image{"+txt+"}";
         addcode(AddTxt);
      }   
   }
}
function attach() {
   if (helpstat){
      alert("Attach Tag\nInserts an attachment into the post.\nUSE: \\attach{Attachment description}");
   } else if (basic) {
      AddTxt="\\attach{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\attach{";
      addcode(AddTxt);
   } else {  
      txt=prompt("Attachment description","-My Attachment-");    
      if(txt!=null) {            
         AddTxt="\\attach{"+txt+"}";
         addcode(AddTxt);
      }   
   }
}

function fontface(font) {
    if (helpstat){
      alert("Font Tag\nSets the font face for the enclosed text.\nUSE: \\font{The font of this text is "+font+"}");
   } else if (basic) {
      AddTxt="\\font{"+font+",}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\font{"+font+",";
      addcode(AddTxt);
   } else {                  
      txt=prompt("Text to be in "+font,"Text");
      if (txt!=null) {             
         AddTxt="\\font{"+font+","+txt+"}";
         addcode(AddTxt);
      }        
   }  
}
function fontsize(size) {
   if (helpstat) {
      alert("Size Tag\nSets the text size.\nPossible values are -2 to 2.\n -2 being the smallest and 2 the largest.\nUSE: \\"+size+"{This is size "+size+" text}");
   } else if (basic) {
      AddTxt="\\"+size+"{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\"+size+"{";
      addcode(AddTxt);
   } else {                       
      txt=prompt("Text to be size "+size,"Text"); 
      if (txt!=null) {             
         AddTxt="\\"+size+"{"+txt+"}";
         addcode(AddTxt);
      }        
   }
}
function fontcolor(color) {
   if (helpstat) {
      alert("Color Tag\nSets the text color.  Any listed color can be used.\nUSE: \\"+color+"{This is some "+color+" text}");
   } else if (basic) {
      if (color == "default") {
          AddTxt="\\rgb{"+d_color+",}";
          addcode(AddTxt);
          } else {
      AddTxt="\\"+color+"{}";
      addcode(AddTxt);
          }
   } else if (nest) {
      if (color == "default") {
          AddTxt="\\rgb{"+d_color+",";
          addcode(AddTxt);
          } else {
      AddTxt="\\"+color+"{";
      addcode(AddTxt);
          }
   } else {  
        txt=prompt("Text to be "+color,"Text");
      if(txt!=null) {
            if (color == "default") {
            AddTxt="\\rgb{"+d_color+","+txt+"}";
            addcode(AddTxt);
            } else {
         AddTxt="\\"+color+"{"+txt+"}";
         addcode(AddTxt);
            }       
      } 
   }
}
function table() {
   if (helpstat) {
      alert("Insert Table\nBegins the code for inserting a table.\nUse commas to separate Columns.\nPress Return/Enter to create Rows.\nUSE: \\table{This is a column, Another Column, etc.}");
   } else if (basic) {
      AddTxt="\\table{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\table{";
      addcode(AddTxt);
   } else {   
      alert("Insert Table cannot be accessed in this mode.\nUse Basic or Expert mode to insert a table into your post.");
      } 
   }
function list() {
   if (helpstat) {
      alert("Insert List\nBegins the code for inserting a list..\nPress Return/Enter to create new list entries.\nUSE: \\list{text of list}");
   } else if (basic) {
      AddTxt="\\list{}";
      addcode(AddTxt);
   } else if (nest) {
      AddTxt="\\list{";
      addcode(AddTxt);
   } else {   
      alert("Insert List cannot be accessed in this mode.\nUse Basic or Expert modes to insert a table into your post.");
      } 
   }

var undone = "";
var mssg = "";

function undo() {

	if (document.userpass) formid=document.userpass.message;
	if (document.MF) formid=document.MF.message;
	else formid=document.forms[0].message;

   if (helpstat){
      alert("Undo Last\nRemoves last fomatting tag inserted with the Format Panel\nAND all text which follows it.");
   } else  {
   undone = formid.value;
      formid.value = mssg;          
   }
}
function redo() {

	if (document.userpass) formid=document.userpass.message;
	if (document.MF) formid=document.MF.message;
	else formid=document.forms[0].message;

   if (helpstat){
      alert("Redo Last\nReplaces last fomatting tag inserted with the Format Panel and following text\nwhich was removed with the Undo function.");
   } else  {
      formid.value = undone;          
   }
}

function rainbow() {

	if (document.userpass) formid=document.userpass.message;
	if (document.MF) formid=document.MF.message;
	else formid=document.forms[0].message;

if (helpstat) {
      alert("Rainbow Text\nColors each word in your text a different, random color. \nCannot be used with other formatting codes.");
   } else {
rainfuller = formid.value;
rainbroke = rainfuller.indexOf("\\");
if (rainbroke != -1) {
alert("RAINBOW can only be used with unformatted text. \nYour post contains formatting. \nRAINBOW has been aborted. \nIf you wish to use RAINBOW, remove the formatting \nfrom your post and try again.");
}
else {
mssg = formid.value;
parts = mssg.split(" ");
verbose = parts.length;
restoredpost = "";
pass = 0;
n = 0;
ca = color_adjust;
while (pass != verbose) {
  R = Math.floor(Math.random() * 15) + ca;
      if (R == 10) R = "a";
      if (R == 11) R = "b";
      if (R == 12) R = "c";
      if (R == 13) R = "d";
      if (R == 14) R = "e";
      if (R == 15) R = "f";
  r = Math.floor(Math.random() * 15) + 1;
      if (r == 10) r = "a";
      if (r == 11) r = "b";
      if (r == 12) r = "c";
      if (r == 13) r = "d";
      if (r == 14) r = "e";
      if (r == 15) r = "f";
  G = Math.floor(Math.random() * 15) + ca;
      if (G == 10) G = "a";
      if (G == 11) G = "b";
      if (G == 12) G = "c";
      if (G == 13) G = "d";
      if (G == 14) G = "e";
      if (G == 15) G = "f";
  g = Math.floor(Math.random() * 15) + 1;
      if (g == 10) g = "a";
      if (g == 11) g = "b";
      if (g == 12) g = "c";
      if (g == 13) g = "d";
      if (g == 14) g = "e";
      if (g == 15) g = "f";
  B = Math.floor(Math.random() * 15) + ca;
      if (B == 10) B = "a";
      if (B == 11) B = "b";
      if (B == 12) B = "c";
      if (B == 13) B = "d";
      if (B == 14) B = "e";
      if (B == 15) B = "f";
  b = Math.floor(Math.random() * 15) + 1;
      if (b == 10) b = "a";
      if (b == 11) b = "b";
      if (b == 12) b = "c";
      if (b == 13) b = "d";
      if (b == 14) b = "e";
      if (b == 15) b = "f";
  color = "\\rgb{" + R + r + G + g + B + b + ",";
  restoredpost+= color + parts[n] + "} ";
  n++;
  pass++;
  }
formid.value = restoredpost;
  }
}
}
function codecount() {

	if (document.userpass) formid=document.userpass.message;
	if (document.MF) formid=document.MF.message;
	else formid=document.forms[0].message;

if (helpstat) {
      alert("Code Check\nScans your post for formatting elements, \nthen counts and lists them. \nUse as a quick check of your formatting.");
   } else {

   fuller = formid.value;
   flong = fuller.length;
   lastslash = fuller.lastIndexOf("\\");
   lastopen = fuller.lastIndexOf("{");
   lastclose = fuller.lastIndexOf("}");
   var stotal = 0;
   var ototal = 0;
   var ctotal = 0;
   var broke = -1;
   endln = "\n";
   spacer = "... ";
   stomper = 0;
   listing = "";
   count = 0;
   slash = 0;
   nm = 0;
   
   while (broke != lastslash) {
      broke = fuller.indexOf("\\",(broke + 1));
      stotal++;
      }
   broke = -1;
   while (broke != lastopen) {
      broke = fuller.indexOf("{",(broke + 1));
      ototal++;
      }
   broke = -1;
   while (broke != lastclose) {
      broke = fuller.indexOf("}",(broke + 1));
      ctotal++;
      }
   broke = -1;
   while (broke != lastslash) {
      broke = fuller.indexOf("\\",(broke + 1));
      stomper = broke + 10;
      if (stomper >= flong) {
         stomper = flong;
         }
	nm++;
	nn = nm + ".";
      code1 = fuller.substring(broke,stomper);
	code2 = nn + code1;
      code = code2 + "... ";
      count++;
      listing+=code;
   }
   if (count == 0) {
      listing = "NO CODES FOUND";
   }   
   alert("In your post:\nThere are " + stotal + " opening slashes '\\'.\nThere are " + ototal + " opening brackets '{'.\nThere are " + ctotal + " closing brackets '}'.\nThe following is a list of all format codes in your post:\n" + listing);
}
}


