var Quote=0;var Bold=0;var Italic=0;var Underline=0;var Code=0;var text_enter_url="Введите полный адрес для ссылки.";var text_enter_url_name="Заголовок страницы.";var text_enter_image="Введите адрес картинки.";var text_enter_email="Введите e-mail.";var text_enter_flash="Введите адрес флэшки.";var text_flash_width="Введите размер в пикселях. Максимальная ширина = ";var text_flash_height="Введите размер в пикселях. Максимальная высота = ";var text_code="Использование: [CODE] Ваш текст.. [/CODE]";var text_quote="Использование: [QUOTE] Ваша цитата.. [/QUOTE]";var error_no_url="Введите URL.";var error_no_title="Введите описание.";var error_no_email="Введите e-mail.";var error_no_width="Введите ширину флешки.";var error_no_height="Введите высоту флешки.";function PostWrite(NewCode)
{document.bb_form.text.value+=NewCode;document.bb_form.text.focus();return;}
function ef_url()
{var FoundErrors='';var enterURL=prompt(text_enter_url,"http://");var enterTITLE=prompt(text_enter_url_name,"Описание страницы");if(!enterURL)
FoundErrors+="\n"+error_no_url;if(!enterTITLE)
FoundErrors+="\n"+error_no_title;if(FoundErrors)
alert("Ошибка!"+FoundErrors);else
PostWrite("[URL="+enterURL+"]"+enterTITLE+"[/URL]");}
function ef_image()
{var FoundErrors='';var enterURL=prompt(text_enter_image,"http://");if(!enterURL)
FoundErrors+="\n"+error_no_url;if(FoundErrors)
alert("Ошибка!"+FoundErrors);else
PostWrite("[IMG]"+enterURL+"[/IMG]");}
function ef_email()
{var emailAddress=prompt(text_enter_email,"");if(!emailAddress)
alert(error_no_email);else
PostWrite("[EMAIL]"+emailAddress+"[/EMAIL]");}
function ef_flash(maxWidth,maxHeight)
{var FoundErrors='';var FlashURL=prompt(text_enter_flash,"http://");var FlashWidth=prompt(text_flash_width+" "+maxWidth,"");var FlashHeight=prompt(text_flash_height+" "+maxHeight,"");if(!FlashURL){FoundErrors+="\n"+error_no_url;}
if(!FlashWidth){FoundErrors+="\n"+error_no_width;}
if(!FlashHeight){FoundErrors+="\n"+error_no_height;}
if(FoundErrors)
alert("Ошибка!"+FoundErrors);else
PostWrite("[FLASH="+FlashWidth+","+FlashHeight+"]"+FlashURL+"[/FLASH]");}
function ef_code()
{if(Code==0)
{ToAdd="[CODE]";document.bb_form.code.value="Код*";Code=1;}
else
{ToAdd="[/CODE]";document.bb_form.code.value="Код";Code=0;}
PostWrite(ToAdd);}
function ef_quote()
{if(Quote==0)
{ToAdd="[QUOTE]";document.bb_form.quote.value="Цитата*";Quote=1;}
else
{ToAdd="[/QUOTE]";document.bb_form.quote.value="Цитата";Quote=0;}
PostWrite(ToAdd);}
function ef_bold()
{if(Bold==0)
{ToAdd="[B]";document.bb_form.bold.value="B*";Bold=1;}
else
{ToAdd="[/B]";document.bb_form.bold.value="B";Bold=0;}
PostWrite(ToAdd);}
function ef_italic()
{if(Italic==0)
{ToAdd="[I]";document.bb_form.italic.value="I*";Italic=1;}
else
{ToAdd="[/I]";document.bb_form.italic.value="I";Italic=0;}
PostWrite(ToAdd);}
function ef_under()
{if(Underline==0)
{ToAdd="[U]";document.bb_form.under.value="U*";Underline=1;}
else
{ToAdd="[/U]";document.bb_form.under.value="U";Underline=0;}
PostWrite(ToAdd);}
