var url = document.URL.substring(document.URL.lastIndexOf('/') + 1, document.URL.lastIndexOf('.'));
var params = url.split(',');

// Nur einbinden, wenn wir im Editiermodus sind
if (params[3] == 2 || params[3] == 4) {
	tinyMCE.init({
		mode : "textareas",
		docs_language : "de",
		theme : "advanced",
		plugins: "save",
		theme_advanced_toolbar_location : "top",
		theme_advanced_buttons1 : "save,separator,undo,redo,separator,bullist,numlist,charmap,separator,formatselect,styleselect,link",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_blockformats : "p,h2",
		theme_advanced_styles : "Link [intern]=intern;Link [extern]=extern;Zitat=cite;",
		entity_encoding : "numeric",
		theme_advanced_path : true,
		theme_advanced_statusbar_location : "bottom",
		language : "de",
		file_browser_callback : "mcFileManager.filebrowserCallBack",
		theme_advanced_resize_horizontal : false,
		theme_advanced_resizing : true,
		apply_source_formatting : true,
		verify_html : true
	});
}

function toggleBar() {
	toggle('bar');
	var elem = document.getElementById('showBar');
	var dir = (elem.alt == 'right.gif');
	elem.src = dir ? '/view/images/left.gif' : '/view/images/right.gif';
	elem.alt = dir ? 'left.gif' : 'right.gif';
	elem.title = dir ? 'Auswahl anzeigen' : 'Auswahl verstecken';
}

function highlight(elem) {
	elem.className = 'docEditHigh';
}

function unHighlight(elem) {
	elem.className = 'docEdit';
}

