
<!--
var imageFilenames = ["http://clippercontrols.com/product_images/uploaded_images/index_13.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_pb.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_en.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_ww.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_fb.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_se.jpg", "http://clippercontrols.com/product_images/uploaded_images/index_13_ge.jpg"];
            var images = [];
            var currentIndex = 0;
            
            function loadImages(){
                for (var i = 0; i < imageFilenames.length; i++){
                    images[i] = new Image();
                    images[i].src = imageFilenames[i];
                }
            }
            
            function showCurrentImage(){
                document.getElementById("rotatingImage").src = images[currentIndex].src;
            }
            
            function rotateLeft(){
                currentIndex--;
                
                if (currentIndex == -1) {
                    currentIndex = images.length - 1;
                }
                
                showCurrentImage();
            }
            
            function rotateRight(){
                currentIndex++;
                
                if (currentIndex == images.length) {
                    currentIndex = 0;
                }
                
                showCurrentImage();
            }
            
            function onButtonLeft(){
                // Cancel the timer, if there is one
                clearTimeout(timerID);
                
                rotateRight();
            }
            
            function onButtonRight(){
                // Cancel the timer, if there is one
                clearTimeout(timerID);
                
                rotateLeft();
            }
            
            function onTimeout(){
                rotateRight();
                
                // Restart the timer
                timerID = setTimeout(onTimeout, 3000);
            }
            
            // Preload all the images
            loadImages();
            
            // Start the timer
            timerID = setTimeout(onTimeout, 3000);

//-->
// JavaScript Document
