function resizeHeading(headingId, height) {
		var heading = document.getElementById('heading' + headingId);	
		heading.style.height = height + 'px';	
}

var lastHeadingId = 0;
var headingLinks = new Array();

function getNextHeadingId(url) {
	headingLinks.push(url);
	return ++lastHeadingId;
}

function hover(headingId, over) {
	thisMovie('headingSWF' + headingId).underline(over);

	var textDecoration = 'none';
	if ( over ) {
		textDecoration = 'underline';
	}

	var description = document.getElementById('description' + headingId);	
	var spans = description.getElementsByTagName('span');

	for ( var i = 0; i < spans.length; i++ ) {
		if ( spans[i].className == 'underline' ) {
			spans[i].style.textDecoration = textDecoration;
		}
	}
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf('Microsoft') != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}

function openNaviItem(name, isRight, url) {
	var headingId = getNextHeadingId(url);

	if ( DetectFlashVer(8, 0, 0) ) {
		document.write('<div onmouseover="hover(' + headingId + ', true)" onmouseout="hover(' + headingId + ', false)">');						
	
		document.write('<div class="heading" id="heading' + headingId + '">');
		GD_EmbedFlash('version', '8', 'width', '100%', 'height', '100%', 'movie', 'res/heading', 'wmode', 'transparent', 'auto-install', false, 'name', 'headingSWF' + headingId, 'id', 'headingSWF' + headingId, 'allowScriptAccess', 'always', 'flashvars', 'headingId=' + headingId + '&' + (isRight?'headingRight=true&':'') + 'isLink=true&text=' + encodeURI(name));
		document.write('</div>');
	}
	else {
		document.write('<div>');
		name = name.replace(/\r/g, '');	
		name = name.escapeHTML();
		name = name.replace(/\n/g, '<br />');
		document.write('<h2><a href="javascript:goTo(' + headingId + ');">' + name + '</a></h2>');
	}
	
	document.write('<div onclick="goTo(' + headingId + ')" class="inactivePageDescription" id="description' + headingId + '">');
}

function closeNaviItem() {
	document.write('</div>');
	document.write('</div>');
}

function heading(name, isRight) {
	var headingId = getNextHeadingId(null);	
	
	if ( DetectFlashVer(8, 0, 0) ) {
		document.write('<div class="heading" id="heading' + headingId + '">');
//		document.write('<div class="heading" id="openHeading">');
		GD_EmbedFlash('version', '8', 'width', '100%', 'height', '100%', 'movie', 'res/heading', 'wmode', 'transparent', 'auto-install', false, 'name', 'headingSWF' + headingId, 'id', 'headingSWF' + headingId, 'allowScriptAccess', 'always', 'flashvars', 'headingId=' + headingId + '&' + (isRight?'headingRight=true&':'') + 'text=' + encodeURI(name));
		document.write('</div>');
	}
	else {
		name = name.replace(/\r/g, '');	
		name = name.escapeHTML();
		name = name.replace(/\n/g, '<br />');		
		document.write('<h2>' + name + '</h2>');
	}	
}

function goTo(headingId) {
	window.location.href = headingLinks[headingId - 1];
}



function resizeTextarea(ref, minHeight) {
	try {	
		ref.style.height = '0px';
		
		if ( ref.scrollHeight > minHeight ) {
			ref.style.height = ref.scrollHeight + 'px';
		}
		else {
			ref.style.height = minHeight + 'px';
		}
	}
	catch(e) {
	}
}

function deletePrompt() {
	return confirm('Seite entfernen?', 'Ja, Nein');
}

function mse() {
	var s = '';
	
	for (var i = 0; i < mse.arguments.length; ++i) {
    	s += String.fromCharCode(mse.arguments[i] - (i%25));
	}
	
	document.write(s);
}