D=document,S=[],T=[],C=alert,B=unescape;

onload=function() {
    F=D.getElementById('message');
    Subj=D.getElementById('sub');
}


function validate_form()
{
var answer = confirm("Newsletter wirklich abschicken?")
if (answer)	{return true;} else { return false;}

}


function bbcode(x,z) {
    (z=s())?A('['+x+']'+z+'[/'+x+']'):R(x)
}

function on1(el) {
    el.className='bbcodeover';
}

function of1(el) {
    el.className='bbcode';
}

function resize() {
    ile = F.rows;
    
    if (ile>10) F.rows = ile-14;
}

function resize_a() {
	 
    ile = F.rows;
    
    if (ile<50) F.rows = ile+14;
}

function czysc()
{
F.value = '';
Subj.value = '';
}


function A(x) {
    D.selection?(F.focus(),D.selection.createRange().text=x):(F.selectionStart||F.selectionStart=='0')?F.value=F.value.substring(0,F.selectionStart)+x+F.value.substring(F.selectionEnd,F.value.length):F.value+=x
}

function s() {
    return D.selection?D.selection.createRange().text:F.value.substring(F.selectionEnd||0,F.selectionStart||0)
}

function R(x) {
    T[x]?'':T[x]=0;T[x]?CT(x):(S.push(x),T[x]=1,A('['+x+']'),St(x,'*'))
}

function St(i,x) {
}
Z='%52%4b';

function emot(x) {
    A(x)
}

function CT(x,a) {
    T[a=S.pop()]=0;A('[/'+a+']');St(a,'');a!=x?CT(x):''
}

function CA(e) {
    while(S[0]) {
        A('[/'+(e=S.pop())+']');T[e]=0;St(e,'')
    }
}


function List(x,li) {
    x='[list]\n';do {
        li=prompt('Type an item of this list (if you would like to stop, just add empty item or click \'Cancel\'','');x+=li?'[*]'+li+'[/*]\n':''
    }
    while(li);A(x+'[/list]')
}

function List2(x,li) {
    x='[list=2]\n';do {
        li=prompt('Type an item of this list (if you would like to stop, just add empty item or click \'Cancel\'','');x+=li?'[*]'+li+'[/*]\n':''
    }
    while(li);A(x+'[/list=2]')
}

function Url(u,d,z) {
    A("[url="+(u=prompt("Link to website or file","http://"))+"]"+(s()?s():((d=prompt("Description",""))?d:u))+"[/url]")
}

function mail(u,d,z) {
    A("[email="+(u=prompt("E-mail address",""))+"]"+(s()?s():((d=prompt("Description",""))?d:u))+"[/email]")
}

function Img(z) {
    A("[img]"+((z=s())?z:prompt("Path of picture","http://"))+"[/img]")
}

function sfc(l,t) {
    A("["+t+"="+l.value+"]"+s()+"[/"+t+"]")
}

function Quote(t) {
    A("[quote"+((t=prompt('Name of quoting person'))?"="+t:"")+"]"+s()+"[/quote]")
}