/*
var minWidth = 1024; //COLOCAR LARGURA MÍNIMA DO FLASH PARA IE6
var minHeight = 830; // COLOCAR ALTURA MÍNIMA DO FLASH PARA IE6
*/

/* ************************************************************** +document ready ************************************************************* */
$(document).ready(
	function(){
		if(notSupMaxPropert()) { //ie6
			//flashMinMsieProperties();
		}

        $('.navigation a').each(function(){            
            this.href += '#navigation';
        });
		
		links();
	}
);
/* ************************************************************** end document ready ************************************************************ */


/* *************************************************************** +window resize *************************************************************** */
/*
$(window).ready(
	function(){
		if(notSupMaxPropert()) {
			flashMinMsieProperties();
		}
	}
);
*/
/* *************************************************************** end window resize ************************************************************ */


/* *********************************************************** +document ready functions ********************************************************* */
function links() {
	$("a").each(function(){
            var href = $(this).attr('href');

            if($(this).attr('rel')=="external"){
                $(this).click(function(){
                    _gaq.push(['_trackEvent', 'external-link','click',href]);
                });
            }else if($(this).attr('rel')=="print"){
                $(this).click(function(){
                    _gaq.push(['_trackEvent', 'print-link','click',href]);
                    print();
                });
            }else{
                if(href != "" || href!="#"){
                    $(this).click(function(){
                        _gaq.push(['_trackEvent', 'internal-link','click',href]);
                    });
                }
            }
        });

        /*$("a[rel*=external]").attr("target", "_blank");
	$("a[rel*=print]").click( function(){print();});*/
}
/* *********************************************************** end document ready functions ********************************************************* */


/* ******************************************************************* +ie hacks ******************************************************************* */
/*
function flashMinMsieProperties() {
	var window = $(window); 
	
	if(window.width() <= minWidth) { 		
		$('html, body, #wrapper').css("width", minWidth + "px");
	}
	else {
		$('html, body, #wrapper').css("width","100%");
	}
	if(window.height() <= minHeight) { 
		$('html, body, #wrapper').css("height", minHeight + "px");
	}
	else {
		$('html, body, #wrapper').css("height","100%");
	}
}
*/

function notSupMaxPropert() { // não suporta CSS max properties
	if (typeof document.body.style.maxHeight === "undefined") return true;
	else return false;
}
/* ***************************************************************** end ie hacks ****************************************************************** */
function getPageHeight(){var windowHeight;if(self.innerHeight){windowHeight=self.innerHeight}else if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight}else if(document.body){windowHeight=document.body.clientHeight}return windowHeight}

$(document).ready(function(){
	$('#btn-ouvidoria').click(function () {		
		$('#layer #layer-cont').hide();
		$('#layer').fadeIn(1000,
			function() {
				$('#layer #layer-cont').fadeIn(1000);
			});
	});

	$('.close, #overlay').click(function () {		
		$('#layer').fadeOut(1000);
	});
	
	$(window).resize(function() {
		$('body').find('#layer').height(getPageHeight());
	});
	
	var textoH2 = $('body.author #blockContent #content h2:eq(0)').remove().text();
	$('<h2 class="tit"></h2>').insertBefore('img.photo');
	$('.tit').append(textoH2);
	$('body.author #blockContent #content ul li').find('a:first').addClass('bold');
	
});





