<!-- 
// 

function ratonin(src,fondoin)
 { 
	if (!src.contains(event.fromElement)) {
	src.style.cursor = 'hand'; 
	src.bgColor = fondoin; 
	} 
} 

function ratonout(src,fondout) 
{ 
	if (!src.contains(event.toElement)) { 
	src.style.cursor = 'default'; 
	src.bgColor = fondout; 
	} 
} 

function ratonclick(src) 
{ 
	if(event.srcElement.tagName=='TD'){ 
	src.children.tags('A')[0].click();}
} 

function textCounter(campo, countcampo, maxlimit){//conta/mostra caracteres restantes e limita o tamanho do campo
    if (campo.value.length > maxlimit) //se passar do limite nao deixa entrar o caracter
        campo.value = campo.value.substring(0, maxlimit);
        //reduz o valor do campo de contadem
    else 
        countcampo.value = maxlimit - campo.value.length;
}

function confereComent()
{
	str = "É preciso preencher o nome, o e-mail e o texto.";

	if (document.forms[0].nome.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.forms[0].email.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.forms[0].desc.value.length == 0)
	{
		alert(str);
		return false;	
	}
}
function popupabrefoto(largura,altura, id, gal)
{
	var popup_URL = "../texto/popup.php?id="+id+"&gal="+gal+"&h="+altura+"&w="+largura;
	popup = window.open(popup_URL,"FOTOS","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menubar=no,width=" + largura + " height=" + altura + ",top=0,left=0");
	//,top="+((screen.availHeight/2)-(altura/2))+",left="+((screen.availWidth/2)-(largura/2))
	popup.focus();
}

function conferePedido()
{
	str = "Os campos marcados com * são obrigatórios.";

	if (document.form1.nome.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.email.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.cpf.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.rg.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.telefone.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.cep.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form1.desc.value.length == 0)
	{
		alert(str);
		return false;	
	}
	return true;
}

function conferePedido2()
{
	str = "Os campos marcados com * são obrigatórios.";

	if (document.form2.nome.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.email.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.razaosocial.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.cnpj.value.length == 0)
	{
		alert(str);
		return false;	
	}
	
	if (document.form2.responsavel.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.telefone.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.cep.value.length == 0)
	{
		alert(str);
		return false;	
	}
	if (document.form2.desc.value.length == 0)
	{
		alert(str);
		return false;	
	}
	return true;
}

function troca_destaque(num)
{
	for (i=1; i<=3; i++)
	{
		elemento = 'dest_' + i;
		elemento2 = 'compl2_' + i;
		if (i != num)
		{
			document.getElementById(elemento).style.display = "none";
			document.getElementById(elemento2).style.display = "none";
		}
		else
		{
			document.getElementById(elemento).style.display = "";
			document.getElementById(elemento2).style.display = "";
		}
	}
}

function fecha_layer(elemento)
{
	document.getElementById(elemento).style.display = "none";
}

function mudaform1()
{
	document.getElementById('pf').style.display = "";
	document.getElementById('pj').style.display = "none";

}

function mudaform2()
{
	document.getElementById('pf').style.display = "none";
	document.getElementById('pj').style.display = "";

}
//-->

