text_tag_prompt = "Zu formatierenden Text eingeben:";
img_tag_prompt = "URL zur Bilddatei eingeben";
img_size_prompt = "Größe der Bilddatei eingeben";
urltext_tag_prompt = "Beschreibung des Links:";
urllink_tag_prompt = "Link-Adresse:";

function bbcode(theform,bbcode,prompttext) {
inserttext = prompt(text_tag_prompt+"\n["+bbcode+"]xxx[/"+bbcode+"]",prompttext);
if ((inserttext != null) && (inserttext != ""))
 theform.value += "["+bbcode+"]"+inserttext+"[/"+bbcode+"] ";
theform.focus();
}

function imgcode(theform,prompttext) {
insertimage = prompt(img_tag_prompt,prompttext);
if ((insertimage != null) && (insertimage != ""))
 theform.value += "[IMG]"+insertimage+"[/IMG] ";
theform.focus();
}

function imgsizecode(theform,prompttext) {
insertimage = prompt(img_tag_prompt,prompttext);
imagesize = prompt(img_size_prompt,"50%");
if ((insertimage != null) && (insertimage != "") && (imagesize != null) && (imagesize != ""))
 theform.value += "[IMGSIZE="+imagesize+"]"+insertimage+"[/IMGSIZE] ";
theform.focus();
}

function urlcode(theform,prompttext) {
urltext = prompt(urltext_tag_prompt,prompttext);
urllink = prompt(urllink_tag_prompt,"http://");
if ((urllink != null) && (urllink != "")) {
 if ((urltext != null) && (urltext != "")) {
  theform.value += "[URL="+urllink+"]"+urltext+"[/URL] "; }
 else {
  theform.value += "[URL]"+urllink+"[/URL] "; } 
 }
theform.focus();
}

