﻿function fnc_preview_pdf( p_arquivo ){
  win = window.open( '' ,'_visualizar_pdf','toolbar=0, location=0,directories=0,menuBar=0,status=0');
  
  if (!win){
    alert("Bloqueador de pop-ups detectado! Por favor adicione perrmiss�o que as popups dejam abertas para esse site.!");
    return; 
  }
  
  win.window.moveTo(0,0);
  
  if( document.all ) {
    win.window.resizeTo( screen.availWidth, screen.availHeight );
  } else if ( document.layers||document.getElementById ) {
	if ( win.window.outerHeight < screen.availHeight || win.window.outerWidth < screen.availWidth )
    {
		win.window.outerHeight = screen.availHeight;
		win.window.outerWidth = screen.availWidth;
     }
  }

 if( win.location.href.length == 11 )
   tempo =  setInterval( function() { clearInterval( tempo );  win.location.href = p_arquivo; } , 1000 );
}

$(document).ready(function(){

  if(window.fontResizer) 
  	 fontResizer('10px','11px','12px');
 
  $("#menu_principal img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	// Navigation rollovers
	$("#menu_principal a").mouseover(function(){
		if(typeof $(this).children("img").attr("src") != 'undefined'){ 
			imgsrc  = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		}
	});
	$("#menu_principal a").mouseout(function(){
		imgsrc   = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
		selected = $(this).children("img").attr("selected");
		
		if(typeof selected=='undefined'){
			$(this).children("img").attr("src", imgsrc);
		}
	});  
   
   if(typeof document.getElementById('paginacao')!= undefined){
   	
	  $("#paginacao img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	// Navigation rollovers
	$("#paginacao a").mouseover(function(){
		if(typeof $(this).children("img").attr("src") != 'undefined'){ 
			imgsrc  = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		}
	});
	$("#paginacao a").mouseout(function(){
		imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
		$(this).children("img").attr("src", imgsrc);
	})
   }
   
   // IMPRENSA 
   if(typeof document.getElementById('botao_entrevista')!= undefined){
   	
	  $("#botao_entrevista img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	// Navigation rollovers
	$("#botao_entrevista a").mouseover(function(){
		if(typeof $(this).children("img").attr("src") != 'undefined'){ 
			imgsrc  = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		}
	});
	$("#botao_entrevista a").mouseout(function(){
		imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
		$(this).children("img").attr("src", imgsrc);
	})
   }
   if(typeof document.getElementById('botao_noticia')!= undefined){
   	
	  $("#botao_noticia img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	// Navigation rollovers
	$("#botao_noticia a").mouseover(function(){
		if(typeof $(this).children("img").attr("src") != 'undefined'){ 
			imgsrc  = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		}
	});
	$("#botao_noticia a").mouseout(function(){
		imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
		$(this).children("img").attr("src", imgsrc);
	})
   }
   if(typeof document.getElementById('botao_jornalista')!= undefined){
   	
	  $("#botao_jornalista img").each(function() {
		// Set the original src
		rollsrc = $(this).attr("src");
		rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
		$("<img>").attr("src", rollON);
	});
	// Navigation rollovers
	$("#botao_jornalista a").mouseover(function(){
		if(typeof $(this).children("img").attr("src") != 'undefined'){ 
			imgsrc  = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);
			
			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}
		}
	});
	$("#botao_jornalista a").mouseout(function(){
		imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
		$(this).children("img").attr("src", imgsrc);
	})
   }
   
   // GALERIAS 
   
      if(typeof document.getElementById('botao_foto')!= undefined){
   	
		  $("#botao_foto img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		  });
		// Navigation rollovers
		$("#botao_foto a").mouseover(function(){
			if(typeof $(this).children("img").attr("src") != 'undefined'){ 
				imgsrc  = $(this).children("img").attr("src");
				matches = imgsrc.match(/_over/);
				
				// don't do the rollover if state is already ON
				if (!matches) {
				imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
				$(this).children("img").attr("src", imgsrcON);
				}
			}
		});
		$("#botao_foto a").mouseout(function(){
			imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
			$(this).children("img").attr("src", imgsrc);
		})
  	 }
   
      if(typeof document.getElementById('botao_video')!= undefined){
   	
		  $("#botao_video img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		  });
		// Navigation rollovers
		$("#botao_video a").mouseover(function(){
			if(typeof $(this).children("img").attr("src") != 'undefined'){ 
				imgsrc  = $(this).children("img").attr("src");
				matches = imgsrc.match(/_over/);
				
				// don't do the rollover if state is already ON
				if (!matches) {
				imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
				$(this).children("img").attr("src", imgsrcON);
				}
			}
		});
		$("#botao_video a").mouseout(function(){
			imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
			$(this).children("img").attr("src", imgsrc);
		})
  	 }
	 
      if(typeof document.getElementById('botao_audio')!= undefined){
   	
		  $("#botao_audio img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		  });
		// Navigation rollovers
		$("#botao_audio a").mouseover(function(){
			if(typeof $(this).children("img").attr("src") != 'undefined'){ 
				imgsrc  = $(this).children("img").attr("src");
				matches = imgsrc.match(/_over/);
				
				// don't do the rollover if state is already ON
				if (!matches) {
				imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
				$(this).children("img").attr("src", imgsrcON);
				}
			}
		});
		$("#botao_audio a").mouseout(function(){
			imgsrc  = $(this).children("img").attr("src").replace(/_over.gif$/ig,".gif");
			$(this).children("img").attr("src", imgsrc);
		})
  	 }
	 
});