/**
* Inicializa as funções assim que os elementos (DOM) são carregados
@author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
*/
jQuery(function() {
    Cyan._init();
});

var Cyan = {
    /**
    * Função de chamada das outras funções que inicializam o site
    * @author Douglas Rodrigues <douglas.rodrigues@gommo.com.br>
    * @modified 
    */
    _init: function() {
        try {
            Cyan._pngFix();
            Cyan._acessibilidade();
            Cyan._startCarrossel();
            Cyan._startScroll();
            Cyan._openComentario();
            //     Cyan._addOpenLocalModalEffect();
        } catch (e) {
            //  console.log('Error: ' + e.description);
        }
    },

    _pngFix: function() {
        //Apenas IE 6, se apenas um elemento MSIE for encontrado e conter o valor 6
        if (!/msie [^6]\.0/i.test(navigator.userAgent) && /msie 6\.0/i.test(navigator.userAgent)) {
            DD_belatedPNG.fix('img, .pngfix');
        };
    },

    _acessibilidade: function() {
        /*var area = $('#content'),
        target = 'h1, h2, h3,p a, p',
        list = $('#tamanho-letra'),
        sizes = new Array(16, 12, 9);

       list.find('li').each(function(x) {
        $(this).find('a').click(function() {
        $(area).find(target).each(function() {
        $(this).css('font-size', sizes[x]);
        });
        $(this).parent().parent().find('a').removeClass('ativo');
        $(this).addClass('ativo');
        return false;
        })
        });*/



        var fonte = 12;

        $('#diminuir').click(function() {
            if (fonte < 16) {
                fontefonte = fonte + 2;
                $('h1, h2, h3,p a, p, span,p em,p strong').css({ 'font-size': fontefonte + 'px' });
                fonte = fontefonte;

            }
        });
        $('#aumentar').click(function() {
            if (fonte > 12) {
                fontefonte = fonte - 2;
                $('h1, h2, h3,p a, p, span,p em,p strong').css({ 'font-size': fontefonte + 'px' });
                fonte = fontefonte;
            }            
        });


    },

    _startCarrossel: function() {
        $(document).ready(function() {            
            $('#mycarousel').jcarousel({
                scroll: 5
            });
        });
    },

    _openComentario: function() {
        $b(document).ready(function() {
            $b("a.btComentario").click(function() {
                $b(".baixo").show();
            })
        })
    }
    /*
    _addOpenLocalModalEffect: function($a) {

    }*/

};


function TrocaCssUFonte() {
    $('#medio').removeClass('medio').addClass('medio-producao-consciente');
    $('#grande').removeClass('grande').addClass('grande-producao-consciente');
}