




function InsertCommentTag(strTag)
{
	//alert('Tag: ' + strTag);
	ele = document.getElementById('comment');
	ele.value = ele.value + strTag;
	ele.focus();
}




function BlogTagButtonSTD(strTag)
{
	strAttrib = '';
	if (strTag == 'z') {
		strAttrib = '=';
	}
	var comment = document.getElementById("comment");
	comment.focus();	
	var strText = document.selection.createRange().text; 
         
    if (strText != "") { 
		var strTextNew = "[" + strTag + strAttrib + "]" + strText + "[/" + strTag + "]"; 
		document.selection.createRange().text = strTextNew; 
    } else {
		comment.value = comment.value + "[" + strTag + strAttrib + "] [/" + strTag + "]"; ;
		comment.focus();
    }
	comment.focus();	
	
}
function BlogTagButtonPicture(str)
{
	strURL = prompt("Adresse des Bildes:\n z.B. http://www.schmeissfliege.de/_pictures/p_95s.jpg");
	InsertCommentTag("[img]" + strURL + "[/img]");
	
}
function BlogTagButtonLink(str)
{
	strURL = prompt("Internetadresse eingeben:\n z.B. http://www.schmeissfliege.de", 'http://');
	strText = prompt("Titel der Webseite:\n z.B. Schmeissfliege", '');
	InsertCommentTag("[url=" + strURL + "]" + strText + "[/url]");
}

function BlogToggleSmilieBox()
{
	ele = document.getElementById('BlogSmilieBox');
	if (ele.style.display == 'none') {
		ele.style.display = 'inline';
		document.getElementById('BlogSmilieBoxToggle').innerHTML = 'Smilies verstecken';
	} else {
		ele.style.display = 'none';
		document.getElementById('BlogSmilieBoxToggle').innerHTML = 'Smilies anzeigen';
	}
}
function BlogSubmit()
{
	var dNow = new Date();
	dNow = dNow.getDate();
	ele = document.getElementById('BS');
	ele.value = dNow;
	//alert(ele.value);
	//return false;
}

/*
 [url=http://bingo.de]bingo[/url] 
 [img]http://bingo.de[/img] 
 [quote] [/quote] 

[quote]asdlkfj[/quote]

http://www.schmeissfliege.de/_pictures/p_95s.jpg

*/

/*
sfcomment
foreach ($aKeywords as $strKeyword):
		#$strOnClick = "alert('$strKeyword')";
		#$nTRID = $nTableID . count($aKeywords) . str_pad($nC,4, '0');
		$nTRID = $nTableID . "-" . $nC;
		$strOnClick = "";
		#$strOnClick.= " alert(document.getElementById('$nTRID').style.backgroundColor);";
		#$strOnClick.= " if (document.getElementById('$nTRID').style.backgroundColor == '$strTRNormal') {";
		if ($cClickType == 'replace'):
		$strOnClick.= "ele = document.getElementById('$strElementName'); ele.value = '" . addslashes($strKeyword) . "';";
		else:
		#$strOnClick.= "ele = document.getElementById('$strElementName'); ele.value = ele.value + '\n' + '" . addslashes($strKeyword) . "';";
		$strOnClick.= "ele = document.getElementById('$strElementName');";
		$strOnClick.= "last = ele.value.match(/.*\n$/);"; //Wenn letztes Zeichen kein Zeilenumbruch, zuerst einen einfügen (ansonsten stehen evtl. 2 Wörter in 1 Spalte). martin 3.1.2008
		$strOnClick.= "if (ele.value && last == null) { ele.value = ele.value + '\n'; }"; 
		$strOnClick.= "ele.value = ele.value + '" . addslashes($strKeyword) . "' + '\n';";
		
		endif;
		#$strOnClick.= "; document.getElementById('$nTRID').style.backgroundColor = '$strTRActive';";
		#$strOnClick.= "; document.getElementById('$nTRID').style.color = '#ff0000';";
		$strOnClick.= "; document.getElementById('$nTRID').style.fontWeight = 'bold';";
		if (1):
		//Formatierung des vorigen TDs wieder herstellen?
		endif;
		#$strOnClick.= ';return false;';
		$strOnClick = "onClick="" . $strOnClick . """;

*/