A=1;
B=2;
function opacity(id, opacStart, opacEnd, millisec,inout) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
    //determine the direction for the blending, if start and end are the same nothing happens
    if(inout=="out") {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "','"  + inout +  "')",(timer * speed));
            timer++;
        }
    } 
	else if(inout=="in") {
        for(i = opacStart; i <= opacEnd; i++) {
            setTimeout("changeOpac(" + i + ",'" + id + "','"  + inout +  "')",(timer * speed));
            timer++;
        }
    }
}
//change the opacity for different browsers
function changeOpac(opacity, id,inout) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
	if(inout=="out"){
		if(opacity==0){
			document.getElementById('nsect_' + B).style.display='none';
			document.getElementById('nsect_' + A).style.display='';
			fadeIN(A);
		}
	}
}
function fadeIN(nr){	
	opacity("nsect_" + nr,0,100,1500,"in");
}
function fadeOUT(nr){	
	opacity("nsect_" + nr,100,0,1500,"out");
}
function changeF(){
	C=B;
	B=A;
	A=C;
	fadeOUT(B);
	//alert("A=" + A + "\nB=" + B);
}
setInterval('changeF()',12000);

window.onload=function(){
	fadeIN(A);
}