
function code(BBCode) {
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + BBCode;
document.gb.text.focus();
}

function std(Code) {
var text = window.prompt("Text eingeben ...","mein Text");
if(text != "" && text != null && text != "mein Text"){
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + "[" + Code + "]" + text + "[/" + Code + "]" + " ";
document.gb.text.focus();
}}

function setbild() {
var uri = window.prompt("Adresse des Bildes:","http://");
if(uri != "" && uri != null && uri != "http://"){
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + "[img]" + uri + "[/img] ";
document.gb.text.focus();
}}

function setsmilie() {
var uri = window.prompt("URI des Smiliebilds:","http://");
if(uri != null && uri != "" && uri != "http://"){
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + "[smilie]" + uri + "[/smilie] ";
document.gb.text.focus();
}}

function seturl() {
var uri = window.prompt("Adresse:","http://");
var text = window.prompt("Linktext:","visit my page!");
if(text != null && uri != null && uri != "" && uri != "http://" && text != "" && text != "visit my page!"){
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + "[url=" + uri + "]" + text + "[/url] ";
document.gb.text.focus();
}}

function setmail() {
var uri = window.prompt("E-Mail-Adresse:","@");
var text = window.prompt("Linktext:","mail me!");
if(uri != null && text != null && uri != "" && uri != "@" && text != "" && text != "mail me!"){
document.gb.text.focus();
document.gb.text.value = document.gb.text.value + "[email=" + uri + "]" + text + "[/email] ";
document.gb.text.focus();
}}

function formularcheck()
{
 if(document.gb.user.value.length < 2)  {
   alert("Gib bitte deinen Namen ein!");
   document.gb.user.focus();
   return false;
  }

 if(document.gb.user.value == "Webmaster")  {
   alert("Dieser Name darf nicht verwendet werden!");
   document.gb.user.focus();
   return false;
  }

 if(document.gb.user.value == "Admin")  {
   alert("Dieser Name darf nicht verwendet werden!");
   document.gb.user.focus();
   return false;
  }

 if(document.gb.user.value == "Chef")  {
   alert("Dieser Name darf nicht verwendet werden!");
   document.gb.user.focus();
   return false;
  }

 if(document.gb.user.value == "Boss")  {
   alert("Dieser Name darf nicht verwendet werden!");
   document.gb.user.focus();
   return false;
  }
 if(document.gb.text.value.length < 1)  {
   alert("Öhm, einen Text solltest du vielleicht auch noch eingeben ...");
   document.gb.text.focus();
   return false;
  }
}

function vorschau() {
document.gb.action = "gbuch.php?seite=vorschau";
document.gb.target = "_blank";
document.gb.submit();
}

function submit() {
document.gb.action = "eintrag.php";
document.gb.target = "_self";
document.gb.submit();
}
