$(function() {
    $('#header').click(function(){
        location = url;
    }).css('cursor','pointer');
    if((cll == 'produtos') || (cll == 'contato')|| (cll == 'multimidia')){
        var wbox4 = $('.box4,.list-contato').height();
        var wbox5 = $('.box5').height();
        wbox4 += 50;
        if(wbox4 < 230){
            wbox4 = 230;
        }
        wbox5 += 50;
        if(wbox5 < 250){
            wbox5 = 250;
        }
        $('.gradient').height(wbox4);
        if( wbox4 > wbox5){
            wbox += 20;
            $('#content').height(wbox4);
        }else{
            $('#content').height(wbox5);
        }
    }
    if((cll == 'index') || (cll == 'contato')){
        $('.tabs,#tabs-contato').tabs({ fx: { opacity: 'toggle' }});
        if(cll == 'index'){
            $('.ibovespa').toggle(
                function(){
                    var ibovespa_d = url + 'media/infomoney/ibovespa_d.png';
                    $(this).attr('src', ibovespa_d);
                },
                function(){
                    var ibovespa_i = url + 'media/infomoney/ibovespa_i.png';
                    $(this).attr('src', ibovespa_i);
                }
            );
            $('.dolar').toggle(
                function(){
                    var dolar_d = url + 'media/infomoney/dolar_d.png';
                    $(this).attr('src', dolar_d);
                },
                function(){
                    var dolar_i = url + 'media/infomoney/dolar_i.png';
                    $(this).attr('src', dolar_i);
                }
            );
        }
    }
    $("#menu li:last-child").css({"margin-left" : 0});
    if(cll == 'multimidia'){
        $(".entry a[rel]").overlay({expose: '#000'});
    }
    if(cll == 'contato'){
        $('.enviar').click(function(){
            $(this).parent().submit();
            return false;
        });
    }
    if(cll == 'quemsomos'){
        $('#linhadotempo').media({
            width:     900,
            height:    370,
            src:       url+ 'media/flash/linha-do-tempo.swf'
        });
    }
});
