
	var text_name = 'message';
	var load_draft = false;
	var upload = false;

	// Define the bbCode tags
	var bbcode = new Array();
	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]');
	var imageTag = false;

	// Helpline messages
	var help_line = {
		b: 'Bold text: [b]text[/b]',
		i: 'Italic text: [i]text[/i]',
		u: 'Underline text: [u]text[/u]',
		q: 'Quote text: [quote]text[/quote]',
		c: 'Code display: [code]code[/code]',
		l: 'List: [list]text[/list]',
		o: 'Ordered list: [list=]text[/list]',
		p: 'Insert image: [img]http://image_url[/img]',
		w: 'Insert URL: [url]http://url[/url] or [url=http://url]URL text[/url]',
		a: 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]',
		s: 'Font color: [color=red]text[/color]  Tip: you can also use color=#FF0000',
		f: 'Font size: [size=x-small]small text[/size]',
		e: 'List: Add list element',
		d: 'Flash: [flash=width,height]http://url[/flash]'
			}

	var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
	var show_panel = 'options-panel';

var mC=[];
mC[0]=mC[1]=mC[2]=mC[3]=mC[4]=mC[5]=mC[6]=mC[7]=mC[8]=mC[9]=mC[10]='hidden';
function switch_color(SC,ci)
{
	switch (mC[ci])
	{
		// hide
		case 'shown':
			mC[ci] = 'hidden';
			showPage('../color2.php?SHOW=1',SC);
			document.getElementById(SC).style.display='none';
		break;

		// show
		case 'hidden':
			mC[ci] = 'shown';
			showPage('../color2.php?SHOW=2',SC);
			document.getElementById(SC).style.display='block';
		break;
	}
}
var mS=[];
mS[0]=mS[1]=mS[2]=mS[3]=mS[4]=mS[5]=mS[6]=mS[7]=mS[8]=mS[9]=mS[10]=0;
function switch_smile(MOL,SM,ci){var ML='MOL'+ci;
	if(mS[ci]==0){showPage('../xSMILIE.php',SM);mS[ci]=1;if(MOL==1){document.getElementById(ML).innerHTML='Less!';}}
	else{document.getElementById(SM).innerHTML='';mS[ci]=0;if(MOL==1){document.getElementById(ML).innerHTML='More!';}}}
function switch_reply(OB,F,X){if(F==1){document.getElementById(OB).style.display='block';if(X!=1){$('#M'+OB).focus();}}else{
	if(document.getElementById(OB).style.display=='none'){document.getElementById(OB).style.display='block';if(X!=1){$('#M'+OB).focus();}}
	else{document.getElementById(OB).style.display='none';}}}
function celltest(FN){
	form_name = FN;
	document[form_name].SB1.style.visibility='visible';
}
