Cufon.replace('#menu li, #destaqueBaixo li, .data, h2, h3, #listagemPortfolio li h4, button');

Cufon('#imagens li a', {
    hover: {
        color: '#cc7b7b'
    }
});

Cufon('h2 a', {
    hover: {
        color: '#4c4c4c'
    }
});

Cufon('#destaqueBaixo li a', {
    hover: {
        color: '#4c4c4c'
    }
});

(function($){

     function slide_produto(){

        var current = 0;

        var imgs = $("#imagem .reel a");
        var tot = imgs.size();

        if(tot < 1){
            return;
        }

        var reel = $("#imagem .reel");

        reel.css({
            'width' : tot * 680
        });

        var rotate = function(c){
            if(c == -tot || c > 0){
                c = 0;
                current = 0;
            }

            reel.animate({
                left: c * 680
            }, 700 );

            $('#imagens li a.on')[0].className = '';
            $('#imagens li a:eq(' + (current * -1) + ')').className = 'on';

            Cufon("#imagens li a", { color: '#818285' });
            Cufon("#imagens li a.on", { color: '#CC7B7B' });
        };

        function next(){
            rotate(--current);
            return false;
        }

        function preview(){
            rotate(++current);
            return false;
        }

        function set(c){
            rotate(current = c * -1);
        }

        var ul = $('#imagens');
        if(tot > 1){
            for(var i = tot; i--;){
                var li = document.createElement('li');
                var a = document.createElement('a');
                a.innerHTML  = i + 1;
                a.title = i;
                if(!i){
                    a.className = 'on';
                }
                a.onclick = function(){
                    set(this.title);
                }
                li.appendChild(a);
                ul.append(li);
            }
        }

        setTimeout(function(){
            next();
        }, 5000)
    }

    function showBox(){
        $("div.msg").fadeIn("slow");
    }

    function hideBox(){
        $("div.msg").fadeOut("slow");
    }

    $(document).ready(function(){

        slide_produto();

        $("ul li.solicitacoes a").mouseover(showBox).mouseout(hideBox);

    });

})(jQuery);
