$(document).ready(function() {
    
    // Se não for o IE6
    if(!($.browser.msie && $.browser.version=="6.0")) {
        var total = $('#slideshow-slider img').length;
        var rand = Math.floor(Math.random()*total);
        $('#slideshow-slider').nivoSlider({
            effect:'fade',
            startSlide:rand,
            pauseTime: 4000,
            directionNav: false
        });
    }
    
    if($.browser.msie) {
        var zIndexNumber = 1000;
        $('div').each(function() {
            $(this).css('zIndex', zIndexNumber);
            zIndexNumber -= 10;
        });
    }
    
    if($.browser.msie && $.browser.version=="6.0") {
        $('#slideshow img:first').css('display', 'block');
    }
    
    $("#ativa-sao-paulo").click(function(){
        $("#mapa-sao-paulo").css('z-index', '1');
        $("#mapa-baixada-santista").css('z-index', '0');
        $("#ativa-sao-paulo").addClass('active');
        $("#ativa-baixada-santista").removeClass('active');
    });
    
    $("#ativa-baixada-santista").click(function(){
        $("#mapa-baixada-santista").css('z-index', '1');
        $("#mapa-sao-paulo").css('z-index', '0');
        $("#ativa-baixada-santista").addClass('active');
        $("#ativa-sao-paulo").removeClass('active');
    });
    
});


startList = function() {
    if (document.all&&document.getElementById) {
        navRoot = document.getElementById("site-menu");
        for (i=0; i<navRoot.childNodes.length; i++) {
            node = navRoot.childNodes[i];
            if (node.nodeName=="LI") {
                node.onmouseover=function() {
                    this.className+=" over";
                }
                node.onmouseout=function() {
                    this.className=this.className.replace
                    (" over", "");
                }
            }
        }
    }
}
window.onload=startList;
