 //--------------------------------	
		//This set of functions is for the rotation on a Daily Switch
		//--------------------------------
	 
	
         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 AutoRotate() {


			day = new Date().getDate();
			dayIndex = (day % numDocElements);
			
			if (dayIndex==0) {
				
				dayIndex++;
				
			}
		
			randDocWindow(dayIndex);
		

		}
        
        
		function randDocWindow(dayIndex) {
        
        var randEleName =  'timedRotateId' + dayIndex;  
        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");
        		
				}//end if
				
        		else { 
				
				setClassSafely(children[x], "hidden-item"); 
				
				}//end else
     
       		}//end for
            
        
        }//end function randDocWindow