// Inserts HTML content substituting the selection or at the cursor point 
function insertHTML(Zeichen)
{ 
	if(navigator.appName == "Microsoft Internet Explorer") { 
		document.editform.fcontent.focus();
		var sel = document.selection.createRange();
		sel.text = Zeichen;
	} else {
		document.editform.fcontent.value =
		document.editform.fcontent.value + Zeichen;
	}
}
	 
function insertTAG(Zeichen)
{ 
	if(navigator.appName == "Microsoft Internet Explorer") { 	
		document.editform.fcontent.focus();
		var sel = document.selection.createRange();
		var str = document.selection.createRange();
		if(str.text!="") sel.text = "["+Zeichen+"]"+str.text+"[/"+Zeichen+"]";
	} else {
		document.editform.fcontent.value =
		document.editform.fcontent.value + '[' + Zeichen + '][/' + Zeichen + ']';		
	}
} 
	
function insertURL()
	{ 
	document.editform.fcontent.focus();
	URL = prompt("URL:","");
	if(URL!="")
		{
		var sel = document.selection.createRange();
		var str = document.selection.createRange();
		if(str.text=="") sel.text = "[url:"+URL+"]" 
		else sel.text = "[url:"+URL+","+str.text+"]"; 		
		}
	}
function insertEMAIL()
	{ 
	document.editform.fcontent.focus();
	EMAIL = prompt("eMail:","");
	if(EMAIL!="")
		{
		var sel = document.selection.createRange();
		var str = document.selection.createRange();
		if(str.text=="") sel.text = "[email:"+EMAIL+"]" 
		else sel.text = "[email:"+EMAIL+","+str.text+"]"; 		
		}
	}
function insertIMG()
	{ 
	document.editform.fcontent.focus();
	IMG = prompt("IMG:","");
	if(IMG!="")
		{
		var sel = document.selection.createRange();
		var str = document.selection.createRange();
		sel.text = "[img:"+IMG+"]";
		}
	}	
function insertIMAGE(Name)
{ 
	if(navigator.appName == "Microsoft Internet Explorer") { 
		document.editform.fcontent.focus();
		var sel = document.selection.createRange();
		sel.text = '[image:'+Name+']';
	} else {
		document.editform.fcontent.value =
		document.editform.fcontent.value + Zeichen;
	}
}

	function flip(rid)
	{
		current=(document.getElementById("eintrag_" + rid).style.display == 'none') ? 'block' : 'none';
		document.getElementById("eintrag_" + rid).style.display = current;
		if (document.getElementById("eintrag_" +rid).style.display != 'none')
		{
			
			document.getElementById("img_" +rid).src = "images/icon_collapse.gif";
		}
		else
		{
			document.getElementById("img_" +rid).src = "images/icon_expand.gif";
		}
	}

	function reply(post_id)
	{
		document.editform.freplyto.value = post_id;
		document.editform.fcontent.focus();
	}

	function setsmile(Zeichen) {
		document.editform.fcontent.value =
		document.editform.fcontent.value + Zeichen;
	}

    
	function clearDefault(el)
	{
		if (el.defaultValue==el.value) el.value = "";
	}    

	function toggle(rid)
	{
		current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
		document.getElementById(rid).style.display = current;
	}

