// automatic promo switch
//-----------------------
var stat = 0;

function switchHeadline(hnr, nrl){
		
	if(hnr == 1){
		for(i=nrl; i>nrl-4; i--){
			document.getElementById('nr'+i).style.display = 'none'; 
		}
		for(i=hnr; i<=hnr+3; i++){
			if(i<=nrl){
				document.getElementById('nr'+i).style.display = 'block'; 
			}
		}
	}
    else if(hnr%4 == 1){
		for(i=hnr-1; i>=hnr-4; i--){
			document.getElementById('nr'+i).style.display = 'none'; 
		}
		for(i=hnr; i<=hnr+3; i++){
			if(i<=nrl){
				document.getElementById('nr'+i).style.display = 'block'; 
			}
		}
	} 
	for (i = 1 ; i <= nrl ; i++) {
        
		document.getElementById('he'+i).style.display = 'none'; 
		document.getElementById('nr'+i).className = '';

		if (hnr == i) {
			document.getElementById('he'+hnr).style.display = 'block'; 
			document.getElementById('nr'+hnr).className = 'current';
              
        }
        
    }
        
	
    
	if (stat != 1) {	
		setTimeout("switchHeadlines("+nrl+", "+hnr+")", 5000);
	}
	
}


function switchHeadlines(nr, starth) {
		
		if (starth == nr) {
			nexth = 1;
		}
			else {
				nexth = starth+1;
			}
		
		if (stat != 1) {
			switchHeadline(nexth, nr);
		}
}
