function reset()
{
	document.toolbox.auswahlbox.options[0].selected=true;
	document.toolbox.auswahlbox2.options[0].selected=true;
	document.toolbox.auswahlbox3.options[0].selected=true;

}

function ubb_mail(textfeld)
{

	email = window.prompt("Gib die eMail Adresse ein.\n","");
	text1 = prompt("Gib den Text an, der angezeigt werden soll\n(optional)","");
	if ((email!=null) && (email!=""))
	{
		var aTag = "";
		if ((text1!=null)  && (text1!=""))
			aTag = "[EMAIL=" + email + "]" + text1;
		else
				aTag = "[EMAIL]" + email1;
		aTag = aTag + "[/EMAIL]";
		insertAtCursor2(textfeld,aTag);
	}
}
function ubb_url(textfeld)
{

	email = prompt("Gib die URL ein.\n","http://");
	text1 = prompt("Gib den Text an, der angezeigt werden soll\n(optional)","");
	if ((email!=null) && (email!=""))
	{
		var aTag = "";
		if ((text1!=null)  && (text1!=""))
			aTag = "[URL=" + email + "]" + text1;
		else
				aTag = "[URL]" + email;
		aTag = aTag +  "[/URL]";
		insertAtCursor2(textfeld,aTag);
	}
}
function ubb(aTag,endTag,myQuery)
{


	var theText = prompt("Gib deinen Text ein.\n"+aTag+"Text"+endTag, "");
	if ((!theText) || (theText==""))
		theText = "";
	else
		theText = aTag + theText + endTag;
	insertAtCursor2(myQuery,theText);
	reset();
}
function insertAtCursor2(textfeld,chaineAj)
{

	var myQuery = textfeld;
	//IE support
  if (document.selection)
  {
      myQuery.focus();
      sel = document.selection.createRange();
      sel.text = chaineAj;
      //document.inhalt.insert.focus();
  }
 // MOZILLA/NETSCAPE support
   else if (textfeld.selectionStart || textfeld.selectionStart == "0")
  {
      var startPos = textfeld.selectionStart;
      var endPos = textfeld.selectionEnd;
      var chaineSql = textfeld.value;
      myQuery.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length);
  }
  else
      textfeld += chaineAj;
  myQuery.focus();
}
function smile(abkuerzung,textfeld)
{

	var smile = abkuerzung.split(",");
	insertAtCursor2(textfeld,smile[0]);
}