function ObrigaIntroducaoNumeros(ponto,elemento)
{
	var key = window.event.keyCode;
	var valor=document.getElementById(elemento).value;
	
	if(key!=0 && key!=8 && key!=9 && key!=46 && key!=37 && key!=38 && key!=39 && key!=40)
	{
		if(key<48 || (key>57 && key<96) || key>105)
		{
			if(key==44)
			{
				if(ponto)
				{
					if(valor!='')
					{
						if(valor.match(/,/)!=null)
						{
							window.event.returnValue=false;
						}
					}
					else
					{
						window.event.returnValue=false;
					}
				}
				else
				{
					window.event.returnValue=false;
				}
			}
			else
			{
				window.event.returnValue=false;
			}
		}
	}
}

// Impede que se utilize as opções do botao direito do rato
function DisableRightClick()
{
	var but=window.event.button;
	if (but==2)
	{
		alert('Não é permitido nesta janela o acesso ao menu do botão direito do rato.');
	}
}

function DisableBackPress()
{
	var key=event.keyCode;
	alert(key);
	if (key==8)
	{
		event.returnValue=false;
	}
}

var DecimalDigitPattern=',';
var ThousandDigitPattern='\.';
var DecimalDigit=',';
var ThousandDigit='.';

function FormataMoeda(number,decimals)
{
	var n, lenStr;
	number = number.toString();
	if (number=='0')
	{
		return 0;
	}
	else
	{
		n=number.search(DecimalDigitPattern);
		if (n>-1)
		{
			lenStr = number.length;
			if ((lenStr-n)<decimals)
			{
				for(i=0;i<=(decimals-lenStr+n);i++)
				{
					number=number+'0';
				}
			}
		}
		else
		{
			n=number.length;
			if(decimals>0)
			{
				number=number+DecimalDigit;
				for(i=1;i<=decimals;i++)
				{
					number=number+'0';
				}
			}
		}
		n=n-3;
		while(n>=1)
		{
		    number = number.substring(0,n) + ThousandDigit + number.substr(n);
		    n=n-3;
		}
		return number;
	}
}

function publicidade()
{
	window.open('/Informacoes/PopUpPublicidade.aspx','FormularioPublicidade','width=505,height=290,top=100,left=100,scrollbars=no,menubar=no,resizable=no,status=no');
}

function profissionais()
{
	window.open('/Informacoes/PopUpProfissionais.aspx','FormularioProfissionais','width=505,height=290,top=100,left=100,scrollbars=no,menubar=no,resizable=no,status=no');
}

function InfoTiposPublicacao()
{
	window.open('/ContaCliente/InfoTiposPublicacao.htm','InfoTiposPublicacao','width=585,height=580,top=10,left=10,scrollbars=yes,menubar=no,resizable=no,status=no');
}

function ClickBanner()
{
	window.location =  "/Informacoes/Aderir.aspx";
}

/*FUNCOES PARA A JANELA VOADORA*/

function MostraJanelaVoadora(NomeDiv,Html)
{
	document.getElementById(NomeDiv).style.display = '';
	document.getElementById(NomeDiv).innerHTML = Html;
}

function EscondeJanelaVoadora(NomeDiv)
{
	document.getElementById(NomeDiv).innerHTML = '';
	document.getElementById(NomeDiv).style.display = 'none';
}

function MoveJanelaVoadora(posx,posy,NomeDiv,ev)
{
	var mx,my;
	
	if(document.all)
	{
		mx = document.body.scrollLeft + window.event.x;
		my = document.body.scrollTop + window.event.y;
	}
	else
	{
		mx = ev.pageX;
		my = ev.pageY;
	}
	
	document.getElementById(NomeDiv).style.top = my+posy;
	document.getElementById(NomeDiv).style.left = mx+posx;
}

/*FIM FUNCOES PARA A JANELA VOADORA*/

var ii = 0;
function animate()
{
	try{
	
	var tempo;
	var aux_obj = document.getElementById("seta");
	
	switch(ii)
	{
		case 0:
			document.getElementById("aderir").style.color = '#FFFFFF';
			if (aux_obj != null)
				aux_obj.style.visibility = 'hidden' 
			ii = 1;
			tempo = 50;
			break;
		case 1:
			document.getElementById("aderir").style.color = '#003169'; 
			if (aux_obj != null)
				aux_obj.style.visibility = 'visible' 
			ii = 2;
			tempo = 50;
			break;
		case 2:
			document.getElementById("aderir").style.color = '#FFFFFF'; 
			if (aux_obj != null)
				aux_obj.style.visibility = 'hidden' 
			ii = 3;
			tempo = 50;
			break;
		case 3:
			document.getElementById("aderir").style.color = '#003169';
			if (aux_obj != null)
				aux_obj.style.visibility = 'visible' 
			ii = 0;
			tempo = 3500;
			break;
	}
	
	setTimeout('animate()', tempo);
	}
	catch (ex)
	{
		setTimeout('animate()', 3500);
	}
}
setTimeout('animate()', 3500);
