<!-- //

function muda_pagina(nova_pagina)
//simplesmente redireciona o usuario para o link desejado.
{
	window.location = nova_pagina;
}

function ajustar_cep(input)
{
/* Função que ajusta o cep a de um campo de um form para o formato 00000-000 automaticamente. (v1.0)

USO: coloque num input: <input name="NOME" type="text" onKeyPress="ajustar_cpf(this)">
*/
	if ((event.keyCode<48)||(event.keyCode>57)){
		event.returnValue = false; 
		} else { 
		if (input.value.length==5)
			input.value=input.value + "-" ;
	}
}

function ajustar_cpf(input)
{
/* Função que ajusta o cpf a de um campo de um form para o formato 000.000.000-00 automaticamente. (v1.0)

USO: coloque num input: <input name="NOME" type="text" onKeyPress="ajustar_cpf(this)">
*/
	if ((event.keyCode<48)||(event.keyCode>57)){
		event.returnValue = false; 
		} else { 
		if ((input.value.length==3)||(input.value.length==7))
			input.value=input.value + "." ;
		if (input.value.length==11)
			input.value=input.value + "-" ;
	}
}

function ajustar_data(input)
{
/* Função que ajusta a data de um campo de um form para o formato DD/MM/AAAA automaticamente. (v1.0)

USO: coloque num input: <input name="NOME" type="text" onKeyPress="ajustar_data(this)">
*/
	if ((event.keyCode<48)||(event.keyCode>57)){
		event.returnValue = false; 
		} else { 
		if ((input.value.length==2)||(input.value.length==5))
			input.value=input.value + "/" ;
	}
}

function ConfirmaExclusao() {
	confirmado = window.confirm("Tem certeza que quer excluir esse registro?")
	if (confirmado==true)
	{
		document.getElementById('acao').value='excluir';
		document.forms["form"].submit(); 
	}
	else{
		return false;
	}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function foto_preview() { //v3.0
	var i,j=0,x,a=foto_preview.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2]; x.border='1'}
}

function popUp(URL,width,height) {
	winpops=window.open(URL, "", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height + ",left =" + (screen.width/2 - width/2) + ",top = " + (screen.height/2 - height/2))
}

function abrirMapa(URL,width,height) {
	winpops=window.open(URL, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height + ",left =" + (screen.width/2 - width/2) + ",top = " + (screen.height/2 - height/2))
}

function addToFavorites()
{
	if (window.external)
	{
		window.external.AddFavorite("http://www.solelua.com.br","Estação Sol e Lua")
	}
	else
	{ 
		alert("Sentimos muito, seu navegador não suporta essa função.");
	}
}
// -->