
		
$(document).ready(function() {
		
	/*	Termos de Uso
		var LayerGrafico = $("#grafimg");
		$("#Termos").click(function() {
		
			window.onresize = function() {centerPopUp("#popUpTermos");};
			openPopUp("#popUpTermos");
			$("#close").css("cursor", "pointer");
			$("#close").click(function() {
				closePopUp("#popUpTermos");
				LayerGrafico.css("visibility", "visible");
			});
		});
		
		
		Politica de Privacidade
		var LayerGrafico = $("#grafimg");
		$("#PoliticaPrivacidade").click(function() {
		
			window.onresize = function() {centerPopUp("#popUpPolitica");};
			openPopUp("#popUpPolitica");
			$("#close3").css("cursor", "pointer");
			$("#close3").click(function() {
				closePopUp("#popUpPolitica");
				LayerGrafico.css("visibility", "visible");
			});
		});
		
		Imprensa
		var LayerGrafico = $("#grafimg");
		$("#Imprensa").click(function() {
		
			window.onresize = function() {centerPopUp("#popUpImprensa");};
			openPopUp("#popUpImprensa");
			$("#close8").css("cursor", "pointer");
			$("#close8").click(function() {
				closePopUp("#popUpImprensa");
				LayerGrafico.css("visibility", "visible");
			});
		});*/



		//Dicas de Segurança
		var LayerGrafico = $("#grafimg");
		$("#DicasSeguranca").click(function() {
		
			window.onresize = function() {centerPopUp("#popUpDicasSeguranca");};
			openPopUp("#popUpDicasSeguranca");
			$("#close6").css("cursor", "pointer");
			$("#close6").click(function() {
				closePopUp("#popUpDicasSeguranca");
				LayerGrafico.css("visibility", "visible");
			});
			$("#close7").css("cursor", "pointer");
			$("#close7").click(function() {
				closePopUp("#popUpDicasSeguranca");
				LayerGrafico.css("visibility", "visible");
			});
		});


		
		//Resultado da Busca
		$("#btnPopUpBusca").click(function() {		
			window.onresize = function() {centerPopUp("#popUpBusca");};
			openPopUp("#popUpBusca");
			$("#close5").css("cursor", "pointer");
			$("#close5").click(function() {
				closePopUp("#popUpBusca");
				LayerGrafico.css("visibility", "visible");
			});
		});
});

		function openPopUp(popUp) {	
			window.scrollTo(0,0);
			var objDiv = document.getElementById("conteudoScroll");
			objDiv.scrollTop = 0;
			var LayerGrafico = $("#grafimg");
			var pop = $(popUp);
			var bg = $("#modal");
			//Tirar o scroll da tela
			$("html").css("overflow", "hidden");
			$("html").css("overflow-y", "auto");
			pop.show();
			bg.show();
			
			//Tamanho do Fundo Preto
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}
			
			bg.css("width", windowWidth);
			bg.css("height", windowHeight);
					
			//Posicionamento
		
			if (parseInt(windowHeight) > 1280)
			{
				pop.css("top", 150);
			} else {
				pop.css("top", parseInt(windowHeight/2) - parseInt(pop.height()/2) -35);
			}
			pop.css("left", parseInt(windowWidth/2) - parseInt(pop.width()/2));
			pop.css("visibility", "visible");
			pop.css("zindex", 0);
			LayerGrafico.css("visibility", "hidden");
			$('embed, object, select').css({ 'visibility' : 'hidden' });			
		}
		
		//Posicionar Dinamicamente o PopUp 
		function centerPopUp(popUp) {
			var pop = $(popUp);
				
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}
			pop.css("top", parseInt(windowHeight/2) - parseInt(pop.height()/2) - 35);
			pop.css("left", parseInt(windowWidth/2) - parseInt(pop.width()/2));
		}
		
		//Fechar o PopUp
		function closePopUp(popUp) {
			$("html").css("overflow", "auto");
			$("html").css("overflow-y", "scroll");
			//var pop = $(popUp);
			//pop.hide();
			$(popUp).hide();
			$("#modal").hide();
			$('embed, object, select').css({ 'visibility' : 'visible' });
			window.onresize = null;
			
		}
		