
function procuraAvancadaContaArtigos ( again ) {
	var totalArticles = 0;
	setTimeout( function ( ) { 
		$('#seekContent > p').each ( function ( ) { 
			if ( $(this)[0].style.display != "none" ) {
				totalArticles++; 
				$('#resultsFound > span').html ( totalArticles );
			}
		} );
		if ( !again ) procuraAvancadaContaArtigos ( 1 );
	}, 1300);
}

$(document).ready(function(){
	var fonte = 1;
	var line = 1.4;
		$('#aumenta_fonte').click(function(){
			if (fonte<2){
			fonte = fonte+0.1;
			line = line+0.02;
			$('#content').css({'font-size' : fonte+'em','line-height' : line+'em'});
			$('#content2').css({'font-size' : fonte+'em','line-height' : line+'em'});
			}
		});
		$('#reduz_fonte').click(function(){
			if (fonte>1){
				fonte = fonte-0.1;
				line = line-0.02;
				$('#content').css({'font-size' : fonte+'em','line-height' : line+'em'});
				$('#content2').css({'font-size' : fonte+'em','line-height' : line+'em'});
			}
		});
		$('#Procura').click (function (){
			$(this)[0].value = "";
		});
		
		if ( $('#termo').autoSearch )
			$('#termo').autoSearch('.article');
		
		$('#termo').keydown ( procuraAvancadaContaArtigos );
		
		if ( NAME_TO_ANCHOR && NAME_TO_ANCHOR.replace ( /\#$/i, "" ) &&  $('#pane1')[0].scrollTo )
			$('#pane1')[0].scrollTo(NAME_TO_ANCHOR);
		else
			$("a[id=^descritor]").each ( function ( ) { 
				if ( $(this).text ( ) == WORD_TO_ANCHOR  &&  $('#pane1')[0].scrollTo ) {
					$('#pane1')[0].scrollTo( $(this).attr ( "rel" ) );
				}
			} );
		if ( HIGHLIGHT_WORD ) $('#content').highlight( HIGHLIGHT_WORD );

});
