function VerifClientePeper()
{
	 if( FormCadastro.ClientePeper.checked )
	 {
			document.all( "DivCliPeper" ).style.display = "";
	 }
	 else
	 {
			document.all( "DivCliPeper" ).style.display = "none";
	 }
}

function VerifClienteChkChk()
{
	 if( FormCadastro.ClienteChkChk.checked )
	 {
			document.all( "DivCliChkChk" ).style.display = "";
	 }
	 else
	 {
			document.all( "DivCliChkChk" ).style.display = "none";
	 }
}


function ConfirmarCadastro(F)
{
 	if(F.NomeFantasia.value == "")
 	{
		F.NomeFantasia.focus();
		alert("É imprescindível o preenchimento do campo\nreferente ao Nome Fantasia da Empresa");
		return false;
 	}

 	if(F.RazSoc.value == "")
 	{
		F.RazSoc.focus();
		alert("É imprescindível o preenchimento do campo\nreferente à Razão Social da Empresa");
		return false;
 	}



 	if(F.CNPJ.value == "")
 	{
		F.CNPJ.focus();
		alert("É imprescindível o preenchimento do campo\nreferente ao CNPJ");
		return false;
 	}

	if ( ( !F.Segmento1.checked ) && ( !F.Segmento2.checked ) && ( !F.Segmento3.checked ) && ( !F.Segmento4.checked ) && ( !F.Segmento5.checked ) && ( !F.Segmento6.checked ) )
	{
		 alert("É imprescindível a escolha de pelo menos um Segmento da Educação");
		 return false;
	}

 	if( F.CEP.value == "" )
 	{
		F.CEP.focus();
		alert("É imprescindível o preenchimento do campo\nreferente ao CEP");
		return false;
 	}

 	if( F.Complemento.value == "" )
 	{
		F.Complemento.focus();
		alert("Por favor, informe o Número do Edifício ou outros complementos");
		return false;
 	}

 	if(F.Telefone.value == "")
 	{
		F.Telefone.focus();
		alert("É imprescindível o preenchimento do campo\nreferente ao Telefone");
		return false;
 	}

	if( F.Telefone.value.length < 8 )
	{
	 F.Telefone.focus();
	 alert("Por favor, informe-nos um Telefone válido");
	 return false;
	}

	if(F.Fax.value == "")
 	{
		F.Fax.focus();
		alert("É imprescindível o preenchimento do campo\nreferente ao Fax");
		return false;
 	}

	if( F.Fax.value.length < 8 )
	{
	 F.Fax.focus();
	 alert("Por favor, informe-nos um Fax válido");
	 return false;
	}
	if(!verificaemail(F.email.value))
 	{
		F.email.focus();
		alert("Por favor, informe-nos um email válido");
		return false;
 	}

 	if (!F.LiContrato.checked)
 	{
 		alert("É imprescindível a leitura do contrato. Por favor, leia-o antes de prosseguir");
 		return false;
 	}

 	HaTaxa = false;
	for( i = 0; i<=1; i++ )
	{
		 if( F.TxAdesao[i].checked ){ HaTaxa = true; }
	}

  if( !HaTaxa ){
		 alert("É imprescindível a escolha de uma Forma de Pagamento");
		 return false;
	}

 	HaPacote = false;
	for( i = 0; i<=2; i++ )
	{
		 if( F.Pacote[i].checked ){ HaPacote = true; }
	}

  if( !HaPacote ){
		 alert("É imprescindível a escolha de um Pacote");
		 return false;
	}

 	F.submit();
}

function verificaemail(campoemail) {
  stremail = campoemail;
	while (true)  {
    if (stremail.charAt(0) != " " ) {
			break
		}
    stremail = stremail.substring(1,stremail.length)
	}
	while (true)  {
    if (stremail.charAt(stremail.length-1) != " ") {
			break
		}
    stremail = stremail.substring(0,stremail.length-1)
	}
  if (stremail == "") {
		return false;
	}
  if ( stremail.indexOf('@',0) == -1 || stremail.indexOf('.',0) == -1 || stremail.indexOf('..',0) > -1 || stremail.charAt(stremail.length-1) == "." ) {
		return false;
	}
  validos = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@-_'
  n_arroba = 0
  n_total = stremail.length
   for (i=0;i < n_total ;i++){
      if (validos.indexOf(stremail.charAt(i))==-1){
        return false;
		}
    if (stremail.charAt(i) == '@') {
			n_arroba = n_arroba+1
			if (n_arroba == 2) {
        return false
			}
		}
	}
	return true;
}

/* Escolas parceiras */
var scrollerwidth="450px"
var scrollerheight="100px"
var scrollerspeed=1
var scrollercontent=''
var pauseit=1
scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1)
var copyspeed=scrollerspeed
var iedom=document.all||document.getElementById
var actualheight=''
var cross_scroller, ns_scroller
var pausespeed=(pauseit==0)? copyspeed: 0

function populate(){
if (iedom){
cross_scroller=document.getElementById? document.getElementById("iescroller") : document.all.iescroller
cross_scroller.style.top=parseInt(scrollerheight)+8+"px"
//cross_scroller.innerHTML=scrollercontent
actualheight=cross_scroller.offsetHeight
}
else if (document.layers){
ns_scroller=document.ns_scroller.document.ns_scroller2
ns_scroller.top=parseInt(scrollerheight)+8
ns_scroller.document.write(scrollercontent)
ns_scroller.document.close()
actualheight=ns_scroller.document.height
}
lefttime=setInterval("scrollscroller()",30)
}
//window.onload=populate

function scrollscroller(){

if (iedom){
if (parseInt(cross_scroller.style.top)>(actualheight*(-1)+8))
cross_scroller.style.top=parseInt(cross_scroller.style.top)-copyspeed+"px"
else
cross_scroller.style.top=parseInt(scrollerheight)+8+"px"
}
else if (document.layers){
if (ns_scroller.top>(actualheight*(-1)+8))
ns_scroller.top-=copyspeed
else
ns_scroller.top=parseInt(scrollerheight)+8
}
}



function PosicionaDivDoc()
{

	DivLarg = document.all( 'divdocumentos' ).style.pixelWidth;
	DivAltu = document.all( 'divdocumentos' ).style.pixelHeight;

	Larg = document.body.clientWidth;
	Altu = document.body.clientHeight;

	document.all( 'divdocumentos' ).style.top = ( Altu - DivAltu ) / 2 + document.body.scrollTop;
	document.all( 'divdocumentos' ).style.left = ( Larg - DivLarg ) / 2;


	document.all( 'divdocumentos' ).style.display = '';
}




 function ApenasAlgar( )
{   if (((event.keyCode) > 47) && ((event.keyCode) < 58))
  { return( true ); }
else { return( false ); } }

