	var timoutid;				
	var still=4;  		//time in seconds when picture still between fades
	var fade=3;  		//time in seconds for fade in and out 
	var overlappc=100;  //percent of fade when both old and new simultaneously 
	var cntx=0;
	function applyFilter(carousel,picone){
		document.getElementById(carousel).style.filter='progid:DXImageTransform.Microsoft.Fade()';
		//trans.filters[0].duration=fade;
		if(document.getElementById(carousel).filters) sw=true; else sw=false;
		if(sw){
			document.getElementById(carousel).filters[0].overlap=overlappc/100;
			document.getElementById(carousel).filters[0].Apply();
		}
		for(i=1;!(i==cntx+1);i++){
			if(document.getElementById(picone + "." + i).style.visibility=="visible"){
				if(i==cntx) j=1; else j=i+1;
				break;
			}
		}
		document.getElementById(picone + "." + j).style.visibility="visible";
		document.getElementById(picone + "." + i).style.visibility="hidden";
		if(sw) document.getElementById(carousel).filters[0].Play(duration=fade);
		callstr="applyFilter('" + carousel + "','" + picone + "')";
		timeoutid=setTimeout(callstr,(still+fade)*1000);
		//alert(callstr +sw);
	}
	function startup(carousel,picone){
		if(cntx>0) document.getElementById(picone +".1").style.visibility="visible";
		if(cntx>1){
			callstr="applyFilter('" + carousel + "','" + picone + "')";
			timeoutid=setTimeout(callstr,(still)*1000);
		}
	}
	
//startList = function() {
function startList() {
	navRoot = document.getElementsByTagName("LI");
	for (i=0; i < navRoot.length; i++) {
		node = navRoot[i];
		node.onmouseover=function() {	this.className+=" over";	}
		node.onmouseout=function()  {	this.className=this.className.replace(" over", "");	}
	}
//	initsizeit();
}
function rotate(x){
	startList();
	rotateone(x,norotatey,'y')
	rotateone(x,norotaten,'n')
}
//--------------------------------------------------------------------------------------------------
var basis=0
function rotateone(x,norotate,custsw){
	if(norotate==0) return
	dte= new Date()
	msec=dte.getTime()
	y= Math.floor(msec / (1000 *  5 ))  // milliseconds rotate eg 1000 * 60 * 5 = 5mins
	if(basis==0) basis=1; 
	istart=y % norotate; // istart=remainder
	istart1=istart+basis;
	
	topgap=0
	
	basepos=document.getElementById('block_' + custsw + '_1').offsetTop
	
 	for(i=0; !(i>=(norotate)) ; i++){
		ip=i+istart1
		if(ip>=(basis+norotate)){
			ip=ip-(basis+norotate)+1
		}
		el=document.getElementById('block_' + custsw + '_' +  ip);
//--
		topadjust=basepos+topgap-el.offsetTop;
		thisgap=parseInt(el.offsetHeight);
		topgap=topgap+thisgap;
//--
		el.style.top=topadjust+'px'
		el.style.visibility='visible';
	}
}
//----------------------------------------------------------------------------------------------
function rotateone_XXXXXXXXXXXXXXXXXXXXXXXXX(x,norotate,custsw){
	if(norotate==0) return
	dte= new Date()
	msec=dte.getTime()
	y= Math.floor(msec / (1000 *  5 ))  // milliseconds rotate eg 1000 * 60 * 5 = 5mins
	if(basis==0) basis=1; 
	istart=y % norotate; // istart=remainder
	istart1=istart+basis;

	
	topgap=0
 	botgap=0
 	if(istart>0){
	 	for(i=basis; !(i >= istart1) ; i++){
			topgap=topgap+document.getElementById('block_' + custsw + '_' +  i).offsetHeight;
	 	}
	 	//alert('topgap='+topgap)
	 	for(i=istart1; !(i>(norotate+basis-1)) ; i++){
			botgap=botgap+document.getElementById('block_' + custsw + '_' + i).offsetHeight;
	 	}
	 	//alert('botgap'+botgap)
	}
	
	for (i=0; !(i>=norotate); i++){
		j= (i+ istart) % norotate + basis
		//alert('basis='+basis+',i='+i+',j='+j)
		if(j >= istart1){
			gap='-' + topgap + 'px';
		}else{	
			gap=botgap+'px';
		}
		
		if(istart>0){
			document.getElementById('block_' + custsw + '_' + j ).style.top=gap;
		}	
		document.getElementById('block_'  + custsw + '_'  + j).style.visibility='visible'
	}
}

