/* <![CDATA[ */
var al=100;
counter = 100;
chapterfade = "";
if(pslide){
slider = window.setInterval("slideshow()", 100);
}
var fadeinhalt = "";
actualnum = 1;
var tofade = "";
var toshow = document.getElementById("nmd1");
function alfade(){
tofade.style.opacity =  al/100 ;
tofade.style.filter = 'alpha(opacity='+al+')';
al--;
if(al<0){
window.clearInterval(fadeinhalt);
tofade.style.display = "none";	
slider = window.setInterval("slideshow()", 100);
}
}

function slideshow(){
	if(counter < 1){
		counter = 100;
		if(document.getElementById("nmd"+(parseFloat(actualnum)+1)) == null || !document.getElementById("nmd"+(parseFloat(actualnum)+1))){
			showNM('1');
		}else{
			showNM((parseFloat(actualnum)+1));
		}
		window.clearInterval(slider);	
	}else{
		counter--;
	}
	
}

function showNM(which){
	window.clearInterval(fadeinhalt);
	if(tofade){
		tofade.style.display = "none";
	}
	counter = 100;
	window.clearInterval(slider);
	tofade = document.getElementById("nmd"+actualnum);
	toshow = document.getElementById("nmd"+which);
	tofade.style.zIndex = 100;
	toshow.style.zIndex = 99;
	tofade.style.display = "block";
	toshow.style.display = "block";
	al=100;
	toshow.style.opacity =  1 ;
	toshow.style.filter = 'alpha(opacity=' + 100 + ')';
	document.getElementById("nb"+actualnum).innerHTML = '<a title="Zeige die '+actualnum+'. Newsmeldung" href="javascript:onclick=showNM(\''+actualnum+'\');" onfocus="this.blur();">'+actualnum+'</a>';
	document.getElementById("nb"+which).innerHTML = '<p>'+which+'</p>';
	actualnum = which;
	fadeinhalt = window.setInterval("alfade()", 10);
}
var cpic = "";
var cdimm = 0;

function cfade(){
cpic.style.opacity =  cdimm/100 ;
cpic.style.filter = 'alpha(opacity='+cdimm+')';
cdimm += 10;
if(cdimm>100){
window.clearInterval(chapterfade);
}
}

function showChapter(chapter){
	//alert(chapter);
	chapter= chapter.split("main").join("cpic");
	chapter= chapter.split("sub").join("spic_");
	//document.getElementById("debugger").innerHTML = chapter;
	if(document.getElementById(chapter) != null && document.getElementById(chapter).width>500){
	document.getElementById("chapterpics").style.zIndex = "200";
	document.getElementById("kbox_rc").style.display = "block";
	cpic = document.getElementById(chapter);
	cpic.style.display = "block";
	cdimm = 0;
	cpic.style.opacity =  0 ;
	cpic.style.filter = 'alpha(opacity=' + 0 + ')';
	chapterfade = window.setInterval("cfade()", 20);
	}
}
function hideChapter(chapter){
	if(chapterfade){
	document.getElementById("chapterpics").style.zIndex = "1";
	window.clearInterval(chapterfade);
	if(document.getElementById(chapter) != null){
	document.getElementById(chapter).style.display = "none";
	}
	document.getElementById("kbox_rc").style.display = "none";
	}
}
/* ]]> */