function fade_clear(clear_beginn_number)
{
	for(var i=clear_beginn_number; i<=10; i++)
	{
		document_id = 'image' + i;
		
		document.getElementById(document_id).style.opacity = 0;
        	document.getElementById(document_id).style.filter = "alpha(opacity=" + 0 + ")"; 
	}
}
      	
function fade(step) 
{
	document_id = 'image' + counter;
	
        step = step || 0;
	
        document.getElementById(document_id).style.opacity = step/100;
        document.getElementById(document_id).style.filter = "alpha(opacity=" + step + ")"; 

	step = step + 2;
	
        if (step <= 100) {
        	window.setTimeout(function () { fade(step); }, 1);
        } else {
		
			if (counter % 2 == 0){
				window.setTimeout(next, 7500);
			} else {
				window.setTimeout(next, 3000);
			}
		}
		
}
		
		
function next() 
{		
	var imgs = document.getElementById("meinFader").getElementsByTagName("img");
        if (typeof(counter) != "number") 
        	counter = 0;
       
       	if(counter == 10)
		counter=0;
		
        counter++;
		 
        if (counter <= imgs.length) 
	{		
		fade_clear(counter + 1);
		fade();
        } 	
}
