	
			var iSubLayers = 5;		//number of lower section frames
			var iDelay = 6000;		//delay between lower section frames
			var sFunction;
			var currentLayer = -1;
			var subTimeout;
			var shiftDelay = 400;


			function startSub()
			{
				flipLayer(0);
			}

			function flipLayer(iID)
			{
				if(iID == 0) {
					for(i=2; i<=iSubLayers; i++) {
						$("#sub"+i).hide();
					}
					currentLayer = 0;
					showNext();
					subTimeout = setTimeout('flipLayer(currentLayer)',iDelay);
				} else if(iID > 0) {
					$("#sub"+currentLayer).fadeOut(shiftDelay,showNext())
					subTimeout = setTimeout('flipLayer(currentLayer)',iDelay);
				} else {
					$("#sub"+currentLayer).fadeOut(shiftDelay,showPrev())
					//incr();
					subTimeout = setTimeout('flipLayer(currentLayer)',iDelay);
				}
			}


			function showNext() 
			{
				incr();
				$("#sub"+currentLayer).fadeIn(shiftDelay);
			}

			function showPrev() 
			{
				decr();
				$("#sub"+currentLayer).fadeIn(shiftDelay);
			}



			function viewPrevious()
			{
				clearTimeout(subTimeout);
				flipLayer(-currentLayer);
			}

			function viewNext()
			{
				clearTimeout(subTimeout);
				flipLayer(currentLayer);
			}


function incr() {
	currentLayer++;
	if(currentLayer > iSubLayers) {
		currentLayer = 1;
	}
}

function decr() {
	currentLayer--;
	if(currentLayer < 1) {
		currentLayer = iSubLayers;
	}
}

