
var xmlHttp;

function showUser(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="provas2.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("cont").innerHTML=xmlHttp.responseText;
 } 
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function montessori(){
document.getElementById('monte').style.display = 'block';
}

function montessori2(){
document.getElementById('monte').style.display = 'none';
}

function pedago(){
document.getElementById('pedago').style.display = 'block';
}

function pedago2(){
document.getElementById('pedago').style.display = 'none';
}

function salaverde(){
document.getElementById('salaverde').style.display = 'block';
}

function salaverde2(){
document.getElementById('salaverde').style.display = 'none';
}

function classe(){
document.getElementById('classe').style.display = 'block';
}

function classe2(){
document.getElementById('classe').style.display = 'none';
}

function sigma(){
document.getElementById('sigma').style.display = 'block';
}

function sigma2(){
document.getElementById('sigma').style.display = 'none';
}

function desafios(){
document.getElementById('desafios').style.display = 'block';
}

function desafios2(){
document.getElementById('desafios').style.display = 'none';
}

function apre(){
document.getElementById('apre').style.display = 'block';
}

function apre2(){
document.getElementById('apre').style.display = 'none';
}


var request = false;

if(window.XMLHttpRequest){
  request = new XMLHttpRequest();
}else if(window.ActiveXObject){
  request = new ActiveXObject("Microsoft.XMLHTTP");
}

function getData(source){
  if(request){
    var data = document.getElementById("homeicons");
    request.open("GET",source);
    request.onreadystatechange = function(){
		if(request.readyState == 1) {
			data.innerHTML = 'Processando dados...';
		}
      if(request.readyState==4){
        data.innerHTML = request.responseText;
      }
    }
    request.send(null);
  }
}


function AbrirGaleria(id)
{
 window.open("galeria/galerias/popup.php?id="+id,"","resizable=no,toolbar=no,status=0,menubar=no,scrollbars=no,width=700,height=480");
}
function janelaviagem(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=680,height=480,scrollbars=no,resizable=no');

}
function abrir(str)
{
tipWin1 = window.open(str,'representantes','top=40,left=40,toolbar=no,width=470,height=520,scrollbars=no,resizable=no');

}

function encontro(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=240,height=425,scrollbars=no,resizable=no');

}

function video(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=320,height=280,scrollbars=no,resizable=no');

}

function fotos2(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=845,height=610,scrollbars=no,resizable=no');

}


function janelaorga(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=845,height=610,scrollbars=no,resizable=no');

}

function formandos(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=330,height=440,scrollbars=no,resizable=no');
}

function grupo(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=440,height=330,scrollbars=no,resizable=no');
}

function cartao(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=477,height=304,scrollbars=no,resizable=no');
}

function janelacir(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=564,height=330,scrollbars=no,resizable=no');

}

function cetes(str)
{
tipWin1 = window.open(str,'representantes','top=0,left=0,toolbar=no,width=450,height=519,scrollbars=no,resizable=no');

}



function validationcada() {
    if (document.form.nome.value.length < 6) {
	    window.alert("Preencha o campo com seu nome completo");
		return false;
	}
	if (document.form.nascimento.value.length < 6) {
	    window.alert("Preencha o campo com sua data de nascimento!");
		return false;
		}	
    if (document.form.cidade.value.length < 2) {
	    window.alert("Preencha o campo cidade!");
		return false;
		}
    if (document.form.mail.value.length < 6) {
	    window.alert("Preencha o campo e-mail!");
		return false;
	}
	if (document.form.tempo.value.length < 4) {
	    window.alert("Preencha o campo classe e ano cursado!");
		return false;
		}
		if (document.form.pro.value.length < 4) {
	    window.alert("Preencha o campo profissão!");
		return false;
		}
	if (document.form.mensagem.value.length < 4) {
	    window.alert("Preencha o campo mensagem!");
		return false;
		}
		if (document.form.foto.value.length < 1) {
	    window.alert("Escolha uma foto!");
		return false;
		}
	return true;
}


function validation() {
    if (document.form.nome.value.length < 6) {
	    window.alert("Preencha o campo nome");
		return false;
	}

    if (document.form.mail.value.length < 6) {
	    window.alert("Preencha o campo e-mail");
		return false;
	}
	if (document.form.mensagem.value.length < 4) {
	    window.alert("Preencha o campo mensagem!");
		return false;
		}
	return true;
}