
var flagb = true;
var flagi = true;
var flagu = true;

function emoticon(txt) 
{
var txtarea = window.document.post.message;
 txtarea.value  += txt;
 txtarea.focus();
}

function txtstyle(num)
{
var bb = window.document.post.butb;
var bi = window.document.post.buti;
var bu = window.document.post.butu;
var burl = window.document.post.buturl;
var bmail = window.document.post.butmail;
var turl = window.document.post.urltext;
var tmail = window.document.post.mailtext;
var tagstyle = '';
var txtarea = window.document.post.message;
txtarea.focus();
if(num == 1 && flagb == true)
 {
 tagstyle = '<B>';
 txtarea.value  += tagstyle;
 bb.value = 'B*';
 flagb = false;
 tagstyle = '';
 txtarea.focus();
 }
 else if(num == 1 && flagb == false)
 {
 tagstyle = '</B>';
 txtarea.value  += tagstyle;
 bb.value = 'B';
 flagb = true;
 tagstyle = '';
 txtarea.focus();
 }
if(num == 2 && flagi == true)
 {
 tagstyle = '<I>';
 txtarea.value  += tagstyle;
 bi.value = 'I*';
 flagi = false;
 tagstyle = '';
 txtarea.focus();
 }
 else if(num == 2 && flagi == false)
 {
 tagstyle = '</I>';
 txtarea.value  += tagstyle;
 bi.value = 'I';
 flagi = true;
 tagstyle = '';
 txtarea.focus();
 }
if(num == 3 && flagu == true)
 {
 tagstyle = '<U>';
 txtarea.value  += tagstyle;
 bu.value = 'U*';
 flagu = false;
 tagstyle = '';
 txtarea.focus();
 }
 else if(num == 3 && flagu == false)
 {
 tagstyle = '</U>';
 txtarea.value  += tagstyle;
 bu.value = 'U';
 flagu = true;
 tagstyle = '';
 txtarea.focus();
 }
 if(num == 6)
 {
 tagstyle = '<A class=par target=_blank href=' + turl.value + '>' + turl.value + '</A>';
 txtarea.value  += tagstyle;
 tagstyle = '';
 turl.value = '';
 txtarea.focus();
 }

 if(num == 7)
 {
 tagstyle = '<A class=par href=mailto:' + tmail.value + '>' + tmail.value + '</A>';
 txtarea.value  += tagstyle;
 tagstyle = '';
 tmail.value = '';
 txtarea.focus();
 }
}

function txthelpover(num)
{
var tagstyle = '';
var txthelp = window.document.post.helpbox;
if(num==1)
 {
 tagstyle = ' жирный текст:<B>текст</B> - alt + b';
 txthelp.value  += tagstyle;
 }
if(num==2)
 {
 tagstyle = ' наклонный текст:<I>текст</I> - alt + i';
 txthelp.value  += tagstyle;
 }
if(num==3)
 {
 tagstyle = ' подчеркнутый текст:<U>текст</U> - alt + u';
 txthelp.value  += tagstyle;
 }
 if(num==6)
 {
 tagstyle = ' добавляет к сообщению ссылку::http://www.xxxxx.xx - alt + w';
 txthelp.value  += tagstyle;
 }
 if(num==7)
 {
 tagstyle = ' добавляет к сообщению почтовую ссылку::mailname@mailname - alt + m';
 txthelp.value  += tagstyle;
 }
}

function txthelpout()
{
window.document.post.helpbox.value = 'Подсказка:';
}

function overblock(i)
{
window.document.all['bl' + i].style.borderColor = '#d5840b';
window.document.all['bl' + i].style.borderWidth = '2px';
}

function outblock(i)
{
window.document.all['bl' + i].style.borderColor = '#c0c0c0';
window.document.all['bl' + i].style.borderWidth = '1px';
}