	var obja=document.getElementById('a1'); 
	var objb=document.getElementById('a2'); 
	var objc=document.getElementById('a3'); 
	var objd=document.getElementById('a4'); 
	var obje=document.getElementById('a5'); 
	
		
	var count=1;
	var opec=0;
	var ie=0;
	var opec1=100;
	var ie1=100;
	var speed=10;
	var cN=0;
	var order=1;
	
	window.onLoad=fade(0,0);
	
function fade(continues, btn)
{	 
	if(count==1){
	
			if(order==6){order=1}
	
			if(continues==0 && btn==0){
				pos(order);
				checkIndex(order);
				autoRun = setTimeout("fade("+continues+","+btn+")",8000);
				order++;
				}
			if(continues==1 && btn==0){
				continues=0;
				checkIndex(order);
				clearTimeout (autoRun);
				autoRun = setTimeout("fade("+continues+","+btn+")",8000);
				order++;
			}
		
	}else{}	
}

function checkIndex(order){

	for(j=1; j<=5; j++){
		var OBs=document.getElementById("a"+j);
		if(OBs.style.opacity>0){fadeOut(j)}
		if(j==order){ var OBs_o=OBs.style.zIndex=100; fadeIn(order); }
		else{var OBs_o=OBs.style.zIndex=j;}
	}
	
}

function fadeOut(j){

		var OBd=document.getElementById("a"+j);
		var OBd_o=OBd.style.opacity=ie1;
		ie1=opec1/100;
		OBd_o=OBd.style.filter="alpha(opacity="+opec1+")";
	
	if(count<11){
	
		setTimeout("fadeOut("+j+")",40);	
		count++;
		opec1 = opec1-speed;
		
	}else{ count=1;ie1=100; opec1=100;OBd.style.opacity=0;OBd.style.filter="alpha(opacity:0)"; }
}

function fadeIn(order){
	
		var OB=document.getElementById("a"+order);
		var OB_o=OB.style.opacity=ie;
		ie=opec/100;	
		OB_o=OB.style.filter="alpha(opacity="+opec+")";
		
	if(count<11){
		
		setTimeout("fadeIn("+order+")",40);	
		count++;
		opec = opec+speed;
		
	}else{ count=1; ie=0; opec=0; OB.style.opacity=1; OB.style.filter="alpha(opacity:100)"; }	
}


function posP(val){ 

		if (count==1){
			order=val;
			fade(1,0); 
			pos(val); 		
		}
	}
	
function pos(val){	

		for(i=1; i<=5; i++){
			if(val==i){
				document.getElementById("b"+i).className='act1';
			}else{
				document.getElementById("b"+i).className='cl';
			}
		}
	}
