var Perfil = {
	_init: function(){
		try{
			this._util();
			this._cufon();				
			this._tabs();				
			this._siteMap();				
			this._dropList();				
		}catch(e){
			alert(
				'Arquivo   : ' + e.fileName + ' \n ' +
				'Linha     : ' + e.lineNumber + ' \n ' +
				'Nome      : ' + e.name + ' \n ' +
				'Descrição : ' + e.message + ' \n '
			);
		};
	},
	
	
	_util: function(){
		/* target blank */
		var a = $("a[rel='external-link']");
        if (a.length > 0) {
            for (var x = 0; x < a.length; x++) { a.eq(x).attr('target', '_blank') };
        };
		
		
	},
	
	_cufon: function(){
		Cufon.replace('.gillSans16', { fontWeight: 'normal', fontSize: '16px' });
        Cufon.replace('.gillSans22', { fontWeight: 'normal', fontSize: '22px' });
        Cufon.replace('.gillSans16Light', { fontWeight: 'light', fontSize: '16px' });
	},
		
	_tabs: function() {
        $('.tabs').each(function() {
            var tab = $(this),
				nav = $(this).find('.tabs_nav'),
				nav_li = nav.find('li'),
				content = $(this).find('.tabs_content');

            nav_li.each(function(x) {
                $(this).find('a.linktab').live('click', function() {
                    nav.find('a.linktab').removeClass('selected');
                    nav.find('a.linktab').parent().removeClass('border_bottom_none').removeClass('nodash');
                    $(this).addClass('selected');
                    $(this).parent().addClass('border_bottom_none');

                    if (!$(this).parent().is(".tabs .tabs_nav li:first-child"))
                        $(this).parent().prev().addClass("nodash");
						
                    content.removeClass('show').eq(x).addClass('show');                    
                });
            });
        });
    },
	
	_siteMap: function() {
        $("a.bt_sitemap").toggle(function() {
            $("div.content_sitemap").hide()
				    .parent()
				    .find('a.bt_sitemap')
				    .addClass('mais');

        }, function() {
            $("div.content_sitemap").show()
			    .parent()
			    .find('a.bt_sitemap')
			    .removeClass('mais');

            var b = $('body')[0];
            $(b).scrollTo('100%', 200, { queue: true })

        });
    },
	
	_dropList: function() {
        $(".drop_list ol>li").live('mouseover', function() {
            $(".drop_sub", this).show()
        });

        $(".drop_list ol>li").live('mouseout', function() {
            $(".drop_sub", this).hide()
        });
    }
	
};

$(function(){
	Perfil._init();
});
















