function Comments_InsertTag(strTag, strBoxID)
{
	var comment = document.getElementById(strBoxID);
	comment.focus();	
	var strText = document.selection.createRange().text; 
	var strTextNew = strTag; 
	document.selection.createRange().text = strTextNew; 
	comment.focus();	
}
function Comments_TagButtonSTD(strTag, strBoxID)
{
	strAttrib = '';
	if (strTag == 'z') {
		strAttrib = '=';
	}
	var comment = document.getElementById(strBoxID);
	comment.focus();	
	var strText = document.selection.createRange().text; 
         
    //if (strText != "") { 
    if (1 == 1) { 
		var strTextNew = "[" + strTag + strAttrib + "]" + strText + "[/" + strTag + "]"; 
		document.selection.createRange().text = strTextNew; 
    } else {
		comment.value = comment.value + "[" + strTag + strAttrib + "] [/" + strTag + "]"; ;
		comment.focus();
    }
	comment.focus();	
	
}
function Comments_TagButtonPicture(str, strBoxID)
{
	strURL = prompt("Adresse des Bildes:\n z.B. http://www.schmeissfliege.de/_pictures/p_95s.jpg");
	Comments_InsertTag("[img]" + strURL + "[/img]", strBoxID);
}
function Comments_TagButtonLink(str, strBoxID)
{
	strURL = prompt("Internetadresse eingeben:\n z.B. http://www.schmeissfliege.de", 'http://');
	strText = prompt("Titel der Webseite:\n z.B. Schmeissfliege", '');
	Comments_InsertTag("[url=" + strURL + "]" + strText + "[/url]", strBoxID);
}
function Comments_Submit(strFormSaveID)
{
	var dNow = new Date();
	dNow = dNow.getDate();
	ele = document.getElementById(strFormSaveID);
	ele.value = Math.round(ele.value) + dNow + 2;
	//alert(ele.value);
	//return false;
}
