function limite(campo, countcampo, maxlimit)
{
if (campo.value.length > maxlimit)
{
  campo.value = campo.value.substring(0, maxlimit);
}
else
  countcampo.value = maxlimit - campo.value.length;
}

function mostraEsconde(qual)
{
	if (document.getElementById(qual).style.display == "none") {
		document.getElementById(qual).style.display = "";
	}
	else {
		document.getElementById(qual).style.display = "none";
	}
}

function mostra(qual)
{
	if (document.getElementById(qual).style.display == "none") {
		document.getElementById(qual).style.display = "";
	}
}

function Esconde(qual)
{
	document.getElementById(qual).style.display = "none";
}

function troca_imagem(imagem)
{
	document.getElementById("imagem_zoom").src = "scripts/timthumb.php?src=/"+imagem.src+"&w=250&h=190&zc=0";
	document.getElementById('linkz').href = imagem.src;



/*	document.getElementById("imagemxx").innerHTML = "<a href=\""+imagem.src+"\" op=\"fancybox\"><img id=\"imagem_zoom\" src=\"scripts/timthumb.php?src=/"+imagem.src+"&w=250&h=190&zc=0\"></a>";

*/



/*
document.getElementById("imagemxx").innerHTML = "<a href=\"<? echo $diretoriover.$cod.'_1g.jpg'; ?>\" op=\"fancybox\"><img id=\"imagem_zoom\" src=\"scripts/timthumb.php?src=/<? echo $diretoriover.$cod.'_1g.jpg'; ?>&w=<? echo $grande_largura; ?>&h=<? echo $grande_altura; ?>&zc=0\" alt=\"<? echo $lpro['titulo']; ?>\" /></a>"; */
	


/*	

			<a href="<? echo $diretoriover.$cod.'_1g.jpg'; ?>" op="fancybox"><img id="imagem_zoom" src="scripts/timthumb.php?src=/<? echo $diretoriover.$cod.'_1g.jpg'; ?>&w=<? echo $grande_largura; ?>&h=<? echo $grande_altura; ?>&zc=0" alt="<? echo $lpro['titulo']; ?>" /></a>


<? echo $diretoriover.$cod.'_1g.jpg'; ?>&w=<? echo $grande_largura; ?>&h=<? echo $grande_altura; ?>&zc=0" */

}

function formatar(src, mask){
  var i = src.value.length;
  var saida = mask.substring(0,1);
  var texto = mask.substring(i)
if (texto.substring(0,1) != saida)
  {
    src.value += texto.substring(0,1);
  }
}

function limite(campo, countcampo, maxlimit)
{
if (campo.value.length > maxlimit)
{
  campo.value = campo.value.substring(0, maxlimit);
}
else
  countcampo.value = maxlimit - campo.value.length;
}


