var goHome = '<a href="../index2.html"><span class="arrowup">^</span></a>';
var goIndex = '<a href="index.html"><span class="arrowup">^</span></a>';

var subjects = new Array()
var i = 1;
subjects[i++] = 'Urindiagnostik|theory|Lernen Sie die Grundlagen zur Urindiagnostik';
subjects[i++] = 'Klinische Fallbeispiele|cases|Erlernen Sie anhand von klinischen Fallbeispielen den Einsatz der Urindiagnostik';
subjects[i++] = 'Urinsediment-Bilder|images_db|Lernen Sie durch Vergleichen die Elemente des Urinsediments erkennen.Suchen Sie nach Bildern. &Uuml;berpr&uuml;fen Sie Ihr Wissen mit einem Quiz.';
subjects[i++] = 'Hilfe*help*Hier erhalten Sie Auskunft &uuml;ber den Bildschirmaufbau und die Funktion der verschiedenen Bildschirmelemente.';

var whichFileName = splitStringForLastItem(document.location.href,'/');
var serieName = whichChapter = extractChapter(whichFileName);

var error_tell = 'Fehler melden';
var error_info = 'Melden Sie Fehler, die Sie entdeckt haben, an die Autoren weiter.';
var error_btn = '<span class="interactivity-div"><a href="javascript:openWindow(\'error\',1,\'800\',\'600\',2)" onmouseover="this.T_WIDTH=180; return escape(error_info)">' + error_tell + '</a></span> ';
var error_btn0 = '<span class="interactivity-div"><a href="javascript:openWindow(\'error\',0,\'800\',\'600\',2)" onmouseover="this.T_WIDTH=180; return escape(error_info)">' + error_tell + '</a></span>';


function write_level2_titles(){
	theFontSize = '<span class="subsubjects">'
	theText = theFontSize;
	var thePath = document.location.href;
	for(i = 1;i <= level2_titles.length-1;i++){
		if(level2_titles[i].indexOf('|') != -1){
			var titlesArray = level2_titles[i].split('|');
			var pathArray = thePath.split('/');
			if(theText != theFontSize){ theText += ' - ' }//  not first round
			if(thePath.indexOf(titlesArray[1]) != -1){
				theText += '<a href="' + titlesArray[1] + '.html" class="alt_link">' + titlesArray[0] + '</a>' + theFontSize;
			}
			else if(pathArray[pathArray.length-2] == sectionName){
				theText += '<a href="' + titlesArray[1] + '/' + titlesArray[1] + '.html">' + titlesArray[0] + '</a>';
			}
			else{
				theText += '<a href="../' + titlesArray[1] + '/' + titlesArray[1] + '.html">' + titlesArray[0] + '</a>';
			}
		}
		else{
			if(theText != theFontSize){ theText += ' - ' } // not the first round
			theText += level2_titles[i];
		}
	}
	theText += '</span>'
	return theText;
}

function write_sidebar_titles(){
	var theFontSize = '<span class="chapters">';
	var theText = '<table border="0" cellpadding="2" cellspacing="0">';
	var thePath = document.location.href;
	for(i = 1;i <= sidebar_titles.length-1;i++){
		var titlesArray = sidebar_titles[i].split('|');
		if(thePath.indexOf(titlesArray[1]) != -1){
			theText += '<tr><td align="right" valign="top">' + theFontSize + i + '.</span></td><td align="left">' + '<span class="chaptersred">' + titlesArray[0] + '</span></td></tr><tr><td colspan=2>' + write_page_elements() + '</td></tr>';
		}
		else{
			theText += '<tr><td align="right" valign="top">' + theFontSize + i + '.</span></td><td align="left">' + theFontSize + '<a href="' + titlesArray[1] + '1.html">' + titlesArray[0] + '</a></span></td></tr>';
		}
	}
	theText += '</table><BR><img src="../../gifs/expander.gif" alt="" height="700" width="1" border="0">'
	return theText ;
}

function write_page_elements(){
	if(page_elements.length>0){
		var theFontSize = '<span class="subchapters">'
		var theText = '<table border="0" cellpadding="2" cellspacing="0">';
		var theDocName = splitStringForLastItem(document.location.href,'/');
		var theShortDocName = theDocName.split('.')
		for(j = 1;j <= page_elements.length-1;j++){
			var theTitle = page_elements[j].split('$');
			if(theShortDocName[0] == (serieName + j)){
				theText += '<tr><td align="right" valign="top">' + theFontSize + j + '.</span></td><td align="left">' + theFontSize + theFontColor1 + theTitle[0] + '</span></td></tr>';
		}
		else{
			theText += '<tr><td align="right" valign="top">' + theFontSize + j + '.</span></td><td align="left">' + theFontSize + '<a href="' + serieName + j + '.html">' + theTitle[0] + '</a></span></td></tr>';
			}
		}
		theText += '</table>';
	}
	else{
		theText = ''
	}
	return theText;
}

