 //--------------------------------	
		//This set of functions is for the rotation on a TIMER
		//--------------------------------
		
		
	var Randomize = "no";
	var currentDoc = 0;
	 
	 
	 function DoXrandRange(lowVal,highVal) {
        if(!Math.floor || !Math.random ) return -1;
        return Math.floor(Math.random()*(highVal-lowVal+1))+lowVal;
        }
     
        
        
        
        function setClassSafely(element, value) {
        
        var theClass = element.getAttribute("className");
        
        if (theClass) {
        element.setAttribute("className", value); 
        
        }
        
        
        else { 
        element.setAttribute("class", value); 
        
        }
        }
        
        //This function is here so the Random Rotation Doc javascript plays nice with other Random Img doc types
        
        function RandDOCaddLoadEvent(func) {
        var oldonload = window.onload;
        if (typeof window.onload != 'function') {
        window.onload = func;
        } else {
        window.onload = function() {
        if (oldonload) {
        oldonload();
        }
        func();
        }
        }
        }
		
		function seqRange() {
			
			
	
			if (currentDoc == numDocElements) {
			currentDoc = 1;
			
			}
			
			else { 	currentDoc++; }
			
			
		}
        
        
      
     
      
        function timedCount()
        {
        var t;
        var x;
        t=setTimeout("timedCount()",speed);
		
		if (Randomize == "yes") {
			
			var randIndex = DoXrandRange(1, numDocElements);
			
		}
		
		else {
			
			seqRange();
		var randIndex = currentDoc;
		
		}
		
		
      
		
		//speed variable determinded the xsl sheet that references this file
		
	
        randDocWindow(randIndex);
		
		
        }
        
        function randDocWindow(randIndex) {
        
        var randEleName =  'timedRotateId' + randIndex;  
       
        var ele = document.getElementById(randEleName);  
        var children = document.getElementById(parentDiv).childNodes;
	
        for (x=0; x < children.length; x++) {
        if (children[x] == ele) {
           setClassSafely(ele, "shown-item");
        }
        else { setClassSafely(children[x], "hidden-item"); }
     
       }
       
        
        
        }
		
	