<!--

////////////////////////////// AJAX /////////////////////////////////
function openAjax()
{ 
	var Ajax; 
	try
	{
		Ajax = new XMLHttpRequest(); // XMLHttpRequest para browsers mais populares, como: Firefox, Safari, dentre outros. 
	}
	catch(ee) 
	{ 
		try
		{
			Ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS 
		}
		catch(e)
		{ 
			try
			{
				Ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS 
			}
			catch(e)
			{
				Ajax = false; 
			} 
		} 
	} 
	return Ajax; 
} 

function carregaAjax(id, pagina, metodo)
{ 
	if(document.getElementById)  // Para os browsers complacentes com o DOM W3C.
	{ 
		var exibeResultado = document.getElementById(id); // div que exibirá o resultado. 
		var Ajax = openAjax(); // Inicia o Ajax. 
		
		Ajax.open(metodo, pagina, true); // fazendo a requisição 
		
		Ajax.onreadystatechange = function() 
		{ 
			if(Ajax.readyState == 1) // Quando estiver carregando, exibe: carregando...
			{ 
				exibeResultado.innerHTML = "<div style='width:80px; height:18px; background-color:#CC3300; padding-left:2px; padding-top:1px;'><font color='#FFFFFF'>Carregando...</font></div>"; 
			} 
			
			if(Ajax.readyState == 4) // Quando estiver tudo pronto. 
			{
				if(Ajax.status == 200)
				{ 
					var resultado = Ajax.responseText; // Coloca o retornado pelo Ajax nessa variável 
					resultado = resultado.replace(/\+/g," "); // Resolve o problema dos acentos (saiba mais aqui: http://www.plugsites.net/leandro/?p=4) 
					resultado = unescape(resultado); // Resolve o problema dos acentos 
					exibeResultado.innerHTML = resultado; 
				}
				else
				{ 
					exibeResultado.innerHTML = "<div align='center'><strong>Erro: Problemas com a conexão.</strong></div>"; 
				} 
			} 
		} 
	Ajax.send(null); // submete 
	} 
} 
/////////////////////////////////////////////////////////////////////


// MENUS DO LAYOUT //////////////////////////////////////////////////
	function MENU_OVER( td_id, img_id )
	{
		var td_mudar = document.getElementById(td_id); 
		td_mudar.style.background = 'url(../_img/layout_fundo_01_hover.gif)';
		td_mudar.style.cursor = 'pointer';
		
		var img_mudar = document.getElementById(img_id); 
		img_mudar.src = '../_img/layout_menu_bullet_01_hover.gif';
	}
	
	function MENU_OUT( td_id, img_id )
	{
		var td_mudar = document.getElementById(td_id); 
		td_mudar.style.background = 'url()';
		
		var img_mudar = document.getElementById(img_id); 
		img_mudar.src = '../_img/layout_menu_bullet_01.gif';
	}
	
	function BANNER_OVER( td_id, numero )
	{
		var td_mudar = document.getElementById(td_id); 
		td_mudar.style.background = 'url(../_img/layout_banner_botao_'+numero+'_hover.gif)';
		td_mudar.style.cursor = 'pointer';
	}
	
	function BANNER_OUT( td_id, numero )
	{
		var td_mudar = document.getElementById(td_id); 
		td_mudar.style.background = 'url(../_img/layout_banner_botao_'+numero+'.gif)';
	}
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////
// FUNÇÃO PARA LIMPAR O INPUT              //
function input_limpar( elm )
{
	if (!elm.base) 
		elm.base = elm.value
		
	if (elm.value == elm.base) 
		elm.value = "";
	else if (elm.value == "") 
		elm.value = elm.base;
}
/////////////////////////////////////////////

///////// POSICIONA LAYER DE ESCURIDÃO NO CENTRO //////////
//var site_escuro = false;
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var espaco_foto = 200;

function Posiciona_EscureceSite()
{
	nome_div = "div_site_escuro";
	with(document.getElementById(nome_div).style) 
	{
		width = document.body.clientWidth+"px";
		height = document.body.clientHeight+"px";

		position = 'absolute';
	}
	

	nome_div = "div_site_escuro_destaque";
	with(document.getElementById(nome_div).style) 
	{
		vLeft = ((document.body.clientWidth - parseInt(width)) / 2)-40;
		vTop = (( document.body.clientHeight - ((parseInt(height)*2))) / 2 )- espaco_foto; //parseInt(height);//200;
		position = 'absolute';
		
		if (is_chrome)
		{
			left = (document.body.scrollLeft + vLeft)+"px";
			top = (document.body.scrollTop + vTop)+"px";
		}else{
			left = (document.documentElement.scrollLeft + vLeft)+"px";
			top = (document.documentElement.scrollTop + vTop)+"px";
		}
	}
	
	setTimeout("Posiciona_EscureceSite()",10);
}

window.onload = function()
{
	Posiciona_EscureceSite();
	document.body.style.overflow	= 'hidden';
	document.body.style.overflow	= '';
}

function EscureceSite(condicao)
{
	nome_div = "div_site_escuro";
	nome_div_caixa = "div_site_escuro_destaque";
	
	if (condicao == true)
	{
		document.getElementById(nome_div).style.display = 'block';
		document.getElementById(nome_div_caixa).style.display = 'block';
		document.body.style.overflow	= 'hidden';
	}
	else
	{
		document.getElementById(nome_div).style.display = 'none';
		document.getElementById(nome_div_caixa).style.display = 'none';
		document.body.style.overflow	= '';
	}
}

function Escurece(condicao)
{
	nome_div = "div_site_escuro";
	
	if (condicao == true)
	{
		document.getElementById(nome_div).style.display = 'block';
	}
	else
	{
		document.getElementById(nome_div).style.display = 'none';
	}
}

function  MudaFoto(foto, id)
{
	nome_div = "div_imagem";
	document.getElementById(nome_div).style.background = 'url(../_img/carregando.gif) center #FFFFFF';
	document.getElementById(nome_div).style.background = 'url(../_arquivos_fotos/'+foto+') bottom left no-repeat #FFFFFF';
	carregaAjax("div_desc", "../fotos/ajax_descricao.asp?ID="+id, "GET");
}
/////////////////////////////////////////////////////////////


/////////////////////////////////////////////
// FUNÇÃO MENU OVER - mudar estilo         //
function muda_classe(objeto,classe)
{
	objeto.className = classe;
}
/////////////////////////////////////////////

/////////////////////////////////////////////
// FUNÇÃO FOTO OVER E OUT - muda imagem    //
function muda_thumb(imagem,objeto)
{
	objeto.style.background = "url(../_arquivos_fotos/"+imagem+") no-repeat";
}
/////////////////////////////////////////////

/////////////////////////////////////////////////
// Para mudar páginas em record sets paginados //
function muda_pagina()
{
	var valor = document.getElementById('paginas').value;
	document.location.href = valor;
}
/////////////////////////////////////////////////

-->