// FUNÇÃO VALIDAÇÃO DE E-MAIL ------- INICIO

function abrir(pagina)
{
newwindow=window.open(pagina, '_blank', 'width=328,height=265,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left=300,top=200')
}

function abrir2(pagina)
{
newwindow=window.open(pagina, '_blank', 'width=550,height=400,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=300,top=200')
}
// -->


function mostraLinha(nome){
	nome = document.getElementById( nome );

	if(nome.style.display == 'none')
		{	nome.style.display = '';	} 
	else{	nome.style.display = 'none'	}	
}

 function ocultaLinha(nome){
	nome = document.getElementById( nome );

	if(nome.style.display == '')
		{	nome.style.display = 'none';	} 
	else{	nome.style.display = ''	}	
}


 <!--
function popup(strImgUrl) {
	var win=window.screen, w=win.width, h=win.height, l=(w-480)/2, t=(h-700)/2;
	 0;window.open('popup.asp?'+strImgUrl,'popupIMG','toolbar=no,directories=no,location=no,status=no,menubar=no,scrollbars=no,scrolling=no,resizable=no,width='+w+',height='+h+',left='+l+',top='+t);
}
//-->
 

function ver_email(campo)
{
	//esta função retorna um valor logico 
	//testa a validade do e-mail
	// o mesmo deverá conter apenas 1 arroba e no minimo 1 ponto apos esse arroba
	//recebe um parametro que seria o nome do campo, junto com o nome do form
	//ex.: document.form.campo
	
	var posa, arroba=0, ponto=0;
	var n = campo.value.length;
	var v = campo.value;

	
	//verificação do arroba
	//inicia-se em 3 o looping
	//serve para certificar-se de que o usuario digitou um nome com no minimo 3 letras
	for (i=3;i<=n;i++) {
		if (v.charAt(i) == '@') {
			posa = i; //posição em que estao o arroba
			arroba = arroba + 1;	
		}
	}

	
	//verificação do ponto
	//inicia-se a ver em posa+3 
	// serve para certificar-se de que o usuario ira digitar um provedor com no minimo 2 letras
	for (i=posa + 3;i<=n;i++) {
		if (v.charAt(i) == '.') {
			ponto = 1;
			
		}
	}

	
	if (arroba == 1 && ponto == 1) 
		return true;
	else 
		return false;


}

// FUNÇÃO VALIDAÇÃO DE E-MAIL ------- FIM

// FUNÇÃO VALIDAÇÃO DA NEWSLETTER ------- INICIO




// FUNÇÃO VALIDAÇÃO DA NEWSLETTER ------- FIM


// FUNÇÃO LIMITA TEXT-AREA ------- INICIO

function limita_textarea(campo,n)
{
//função que limita a qtde de caracteres do campo text area
//utilizar no campo: onKeyPress="return limita_textarea(this,n) , onde n é qtde de caracteres

	if (campo.value.length > n - 1) {
		return false;
	} else {
		return true;
	}
 
}

// FUNÇÃO LIMITA TEXT-AREA ------- FIM

// Alerta se a quantidade colocada no carrinho for superior a estoque

function validaMedidas() 
{ 
var01 = document.getElementById("cQtdeProduto").value
if(var01>30) {
alert("Você não pode adicionar quantidade superior ao estoque ao seu carrinho!");}
}

// FUNÇÃO QUE IMPEDE COPIAR E COLAR ------- INICIO

function nao_cola() {
	
	var ctrl=window.event.ctrlKey;
	var tecla=window.event.keyCode; 

		if (ctrl && tecla==86) return false;
		if (ctrl && tecla==67) return false;
}


// FUNÇÃO QUE IMPEDE COPIAR E COLAR ------- FIM

//SO NUMEROS - INICIO
function Tecla(e)
{
	if (document.all) // Internet Explorer
		var tecla = event.keyCode;
	else if(document.layers) // Nestcape
		var tecla = e.which;
		if (tecla > 47 && tecla < 58) // numeros de 0 a 9
			return true;
		else
			{
				if (tecla != 8) // backspace
					event.keyCode = 0;
					//return false;
				else
					return true;
			}
}
//SO NUMEROS - FIM

// FUNÇÃO ALTERA A IMAGEM PRINCIPAL ------- INICIO

   // na pagina detalhes


// FUNÇÃO ALTERA A IMAGEM PRINCIPAL ------- FIM


// VERIFICAÇÃO DE CPF -------------- INICIO
function verificaCpf (pCpf)
{

 //CPF informado
var cpf = pCpf.replace(".","");
cpf = cpf.replace(".","");
cpf = cpf.replace("-","");


var numerosCpf = new Array(10); 

// contador, posição, digito do cpf, digitop a conferir, variavel para calculos
var i, n, digito, verDigito, soma;


//verificação da entrada

if (cpf.length != 11)
	return false;


//separando os valores do cpf, sem os digitos
for (i=0;i<=8;i++)
{
	numerosCpf[i] = cpf.substr(i,1);
}

//capturando os digitos
digito = cpf.slice(9);


//conferindo o 10 digito

soma = 0;
for (i=8;i>=0;i--)
	soma = soma + numerosCpf[8-i] * (i+2);

numerosCpf[9] = soma % 11;

if (numerosCpf[9] < 2)
	numerosCpf[9] = 0;
else
	numerosCpf[9] = 11 - numerosCpf[9];



//conferindo o 11° digito

soma = 0;
for (i=9;i>=0;i--)
	soma = soma + numerosCpf[9-i] * (i+2);

numerosCpf[10] = soma % 11;

if (numerosCpf[10] < 2)
	numerosCpf[10] = 0;
else
	numerosCpf[10] = 11 - numerosCpf[10];



//comparando agora os dois digitos

verDigito = numerosCpf[9] * 10 + numerosCpf[10];

if (verDigito == digito)
	return true;
else
	return false;


//fim da função
}

//VERIFICAÇÃO DE CPF ------------- FIM

//SÓ INTEIROS

function Inteiros(){
var caract = new RegExp(/^[0-9]+$/i);
var caract = caract.test(String.fromCharCode(event.keyCode));

if(!caract){
alert("Caracter inválido: " +String.fromCharCode(event.keyCode));
event.keyCode=0;
return;
}
}
 


//EXIBE NOVO LAYER (DIV) --------- INICIO

function mostraDiv (pDiv, pImagem)
{
var statusAtual = pDiv.style.display;
	if (statusAtual == 'none')
	{
		pImagem.src = 'imagens/veja_menos.gif';
		pDiv.style.display = '';
	}
	else
	{
		pImagem.src = 'imagens/veja_mais.gif';
		pDiv.style.display = 'none';
	}


}


<!--

<!--
  function mOvr(src,clrOver) {
    if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'hand';
	  src.bgColor = clrOver;
	}
  }
  function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrIn;
	}
  }
  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();
    }
  }
// -->
//-->
 

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}

 

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


//EXIBE NOVO LAYER (DIV) --------- FIM


									   
									   
 
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
 
