<!--

////////////////////////////// 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 
	} 
} 
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////
// 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;
}
/////////////////////////////////////////////


/////////////////////////////////////////////
// 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;
}
/////////////////////////////////////////////////

/////////////////////////////////////////////
// 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;
}
/////////////////////////////////////////////

/////////////////////////////////////////////
// FUNÇÃO PARA LIMPAR O INPUT DE SENHA     //
function muda_senha( elm, novo )
{
	elm.style.display = "none";
	document.getElementById(novo).style.display = "block";
	document.getElementById(novo).focus();
}
function volta_senha( elm, novo )
{
	if (elm.value == "")
	{
		elm.style.display = "none";
		document.getElementById(novo).style.display = "block";
	}
}
/////////////////////////////////////////////

// PARA EXIBIR ROLAGEM EM UM DIV //
function ABRE_SUAVE(k, nome, tamanho, velocidade, orientacao)
{
	objeto = document.getElementById(nome);
	
	if ( k <= tamanho)
	{
		if (orientacao == "vertical")
			objeto.style.height = k+"px";
		else
			objeto.style.width = k+"px";
			
		setTimeout("ABRE_SUAVE( "+(k+velocidade)+", '"+nome+"', "+tamanho+", "+velocidade+", '"+orientacao+"' )",10);
		
	}else{
		
		if (orientacao == "vertical")
			objeto.style.height = tamanho+"px";
		else
			objeto.style.width = tamanho+"px";
	}
}
/////////////////////////////////////

// INDICAÇÃO
function checa_indica(formulario, indica_id)
{
	campo=[	
				formulario.nome1,
				formulario.email1,
				formulario.nome2,
				formulario.email2
			];
	n_campo=[
				"Seu Nome",
				"Seu E-mail",
				"Nome do amigo",
				"E-mail do amigo"
			];


	if (checa_nulo(campo[0],n_campo[0])==false)
		return(false);
		
	if (checa_nulo(campo[1],n_campo[1])==false)
		return(false);
	if (checa_email(campo[1],n_campo[1])==false)
		return(false);

	if (checa_nulo(campo[2],n_campo[2])==false)
		return(false);
		
	if (checa_nulo(campo[3],n_campo[3])==false)
		return(false);
	if (checa_email(campo[3],n_campo[3])==false)
		return(false);
		
	
	document.getElementById('tab_form'+indica_id).style.display = 'none';
	document.getElementById('i_form2'+indica_id).style.display = 'block';

	return(true);
}
/////////////////////////////////////////////////////////////


/*document.onmousemove = mouseMoveMenuRolagem;
var_mouse_x = '0px';
var_mouse_y = '0px';
	
function mouseMoveMenuRolagem(ev){
    ev = window.event;
    if (ev.pageX && ev.pageY) {
        x = ev.pageX;
        y = ev.pageY
    }
    else {
        x = ev.clientX + document.body.scrollLeft - document.body.clientLeft;
        y = ev.clientY + document.body.scrollTop - document.body.clientTop;
    }
    var_mouse_x = (x - 15) + 'px';
    var_mouse_y = (y + 15) + 'px';
}*/



// CADASTRO ANTES DE DOWNLOAD
function abre_cadastro(url)
{
	//alert(document.body.scrollTop);
	fundo = document.getElementById('div_cadastro_fundo');
	fundo.style.height = document.body.clientHeight;
	//fundo.style.width = document.body.clientWidth;
	fundo.style.display = 'block';
	fundo.style.top = document.body.scrollTop+'px';
	caixa = document.getElementById('div_cadastro_link');
	caixa.style.display = 'block';
	
	//alert(document.documentElement.clientHeight);
    caixa.style.left = ((document.body.clientWidth/2)-140)+'px';
    caixa.style.top = ((document.documentElement.clientHeight/2)-100)+'px';
	
	
	//caixa.style.top = (event.clientY-100)+'px';
	//caixa.style.left = (event.clientX-100)+'px';
	document.getElementById('down_url').value = url;
}

function verifica_pais(objeto,valor_aceito,obj_select)
{
	caixa_estados = document.getElementById(obj_select);
	
	if (objeto.value.toLowerCase() != valor_aceito && objeto.value.toLowerCase() != valor_aceito+' ')
	{
		caixa_estados.disabled = true;
	}else{
		caixa_estados.disabled = false;
	}
}
/////////////////////////////////////////////////////////////

-->
