
//Define global variables
               var totalLayersInLoop=3;
        var layerNumShowing=1;

        function init(){
        if (navigator.appName == "Netscape") {
                                layerStyleRef="layer.";
                                layerRef="document.layers";
                                styleSwitch="";
        }else{
                                layerStyleRef="layer.style.";
                                layerRef="document.all";
                                styleSwitch=".style";
                }
        }

        function showLayerNumber(number){
                var layerNumToShow=number;
                hideLayer(eval('"layer' + layerNumShowing+'"'));
                showLayer(eval('"layer' + layerNumToShow+'"'));
                layerNumShowing=layerNumToShow;
        }

        function showPreviousLayer(){
                var layerNumToShow=layerNumShowing-1;
                if (layerNumToShow < 1){layerNumToShow=totalLayersInLoop;}
                hideLayer(eval('"layer' + layerNumShowing+'"'));
                showLayer(eval('"layer' + layerNumToShow+'"'));
                layerNumShowing=layerNumToShow;
        }
        function showNextLayer(){
                var layerNumToShow=layerNumShowing+1;
                if (layerNumToShow > totalLayersInLoop){layerNumToShow=1;}
                hideLayer(eval('"layer' + layerNumShowing+'"'));
                showLayer(eval('"layer' + layerNumToShow+'"'));
                layerNumShowing=layerNumToShow;
        }

        function showLayer(layerName){
                eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
        }

        function hideLayer(layerName){
                eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
        }
