/*
---------------------------------------------------------------------------------
  Monta Div
---------------------------------------------------------------------------------
*/

function Http(){
	
	try{this.xmlhttp = new XMLHttpRequest();}
	catch(trymicrosoft){
		try
		{this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}
		catch(othermicrosoft){
			try{this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
			catch(failed){this.xmlhttp = null;}
		}
	}
}


function Profissao(){
	escondeFrame('icentro');
    var url = "ma_profissoes/Profissoes.php?";
	var div = document.getElementById('homeCentro');
		
	httpProfissao = null;
	var httpProfissao = new Http();
	httpProfissao.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpProfissao.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpProfissao.xmlhttp.readyState == 4){
										if(httpProfissao.xmlhttp.status == 200){
		                                    div.innerHTML = httpProfissao.xmlhttp.responseText;
                                            mostraProfissao();
										 }
									 }
								  };
	httpProfissao.xmlhttp.send(null);

}

function Intercambio(){
   escondeFrame('icentro');
    var url = "ma_intercambio/Intercambio.php?=";
	var div = document.getElementById('homeCentro');
		
	httpIntercambio = null;
	var httpIntercambio = new Http();
	httpIntercambio.xmlhttp.open("GET", url + "time=" + new Date(), true);
	httpIntercambio.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpIntercambio.xmlhttp.readyState == 4){
										if(httpIntercambio.xmlhttp.status == 200)
										{
		                                    div.innerHTML = httpIntercambio.xmlhttp.responseText;
										    mostraIntercambio();
										}
									 }
								  };
	httpIntercambio.xmlhttp.send(null);
}

function Vestibular(){
    escondeFrame('icentro');
    var url = "ma_vestibular/Vestibular.php?=";
	var div = document.getElementById('homeCentro');
		
	httpVestibular = null;
	var httpVestibular = new Http();
	httpVestibular.xmlhttp.open("GET", url + "time=" + new Date(), true);
	httpVestibular.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpVestibular.xmlhttp.readyState == 4){
										if(httpVestibular.xmlhttp.status == 200){
		                                    div.innerHTML = httpVestibular.xmlhttp.responseText;
										    mostraVestibular();
										 }
									 }
								  };
	httpVestibular.xmlhttp.send(null);
}

function CursosTecnicos(){
	escondeFrame('icentro');
    var url = "ma_cursostecnicos/CursosTecnicos.php?";
	var div = document.getElementById('homeCentro');
		
	httpCursosTecnicos = null;
	var httpCursosTecnicos = new Http();
	httpCursosTecnicos.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpCursosTecnicos.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpCursosTecnicos.xmlhttp.readyState == 4){
										if(httpCursosTecnicos.xmlhttp.status == 200){
		                                    div.innerHTML = httpCursosTecnicos.xmlhttp.responseText;
                                            mostraProfissaoTecnica();
										 }
									 }
								  };
	httpCursosTecnicos.xmlhttp.send(null);
}

function Entrevista(){
    escondeFrame('icentro');
    var url = "mp_entrevista/Entrevista.php?=";
	var div = document.getElementById('homeCentro');
		
	httpEntrevista = null;
	var httpEntrevista = new Http();
	httpEntrevista.xmlhttp.open("GET", url + "time=" + new Date(), true);
	httpEntrevista.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpEntrevista.xmlhttp.readyState == 4){
										if(httpEntrevista.xmlhttp.status == 200){
		                                    div.innerHTML = httpEntrevista.xmlhttp.responseText;
										    mostraEntrevista();
										 }
									 }
								  };
	httpEntrevista.xmlhttp.send(null);
}

function PosGraduacao(){
	escondeFrame('icentro');
    var url = "mp_posgraduacao/PosGraduacao.php?";
	var div = document.getElementById('homeCentro');
		
	httpPosGraduacao = null;
	var httpPosGraduacao = new Http();
	httpPosGraduacao.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpPosGraduacao.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpPosGraduacao.xmlhttp.readyState == 4){
										if(httpPosGraduacao.xmlhttp.status == 200){
		                                    div.innerHTML = httpPosGraduacao.xmlhttp.responseText;
                                            mostraPosGraduacao();
										 }
									 }
								  };
	httpPosGraduacao.xmlhttp.send(null);

}

function Registrise()
{
	escondeFrame('icentro');
    var url = "mm_home/cadastroUsuario.php?email=&nome=&sexo=&dtnascimento=";
	var div = document.getElementById('homeCentro');
		
	httpRegistrise = null;
	var httpRegistrise = new Http();
	httpRegistrise.xmlhttp.open("GET", url +  "&time=" + new Date(), true);
	httpRegistrise.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpRegistrise.xmlhttp.readyState == 4){
										if(httpRegistrise.xmlhttp.status == 200){
		                                    div.innerHTML = httpRegistrise.xmlhttp.responseText;
										 }
									 }
								  };
	httpRegistrise.xmlhttp.send(null);
}

function EsqueciSenha()
{
	escondeFrame('icentro');
    var url = "mm_home/resetUsuario.php?";
	var div = document.getElementById('homeCentro');
		
	httpEsqueciSenha = null;
	var httpEsqueciSenha = new Http();
	httpEsqueciSenha.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpEsqueciSenha.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpEsqueciSenha.xmlhttp.readyState == 4){
										if(httpEsqueciSenha.xmlhttp.status == 200){
		                                    div.innerHTML = httpEsqueciSenha.xmlhttp.responseText;
										 }
									 }
								  };
	httpEsqueciSenha.xmlhttp.send(null);
}


function mostraFrame(frame,url)
{
  // esconde a div
  var div = document.getElementById('homeCentro');
  div.style.display = "none";

   // esconde a div
   var div = document.getElementById('propagandas-direito');
   div.style.display = "none";


  // mostra frame
  var auxframe = document.getElementById(frame);
  auxframe.src=url;
  auxframe.style.display = "";
  auxframe.style.width = "815px";
  auxframe.style.height = "1600px";
}

function mostraFramePeq(frame,url)
{
  // esconde a div
  var div = document.getElementById('homeCentro');
  div.style.display = "none";

   // esconde a div
   var div = document.getElementById('propagandas-direito');
   div.style.display = "";

  // mostra frame
  var auxframe = document.getElementById(frame);
  auxframe.src=url;
  auxframe.style.display = "";
  auxframe.style.width = "640px";
  auxframe.style.height = "1600px";
}


function escondeFrame(frame)
{
  //esconde frame
  var auxframe = document.getElementById(frame);
  auxframe.style.display = "none";
  auxframe.src = "";

  var div = document.getElementById('propagandas-direito');
  div.style.display = "none";

  //mostra div
  var div = document.getElementById('homeCentro');
  div.style.display = "";
  div.style.width = "815px";
}

function Professor(){
	
	document.getElementById('icentro').style.display = "none";
	document.getElementById('propagandas-direito').style.display = "";
	document.getElementById('homeCentro').style.display = "";
	document.getElementById('homeCentro').style.width = "640px";
   
    var url = "professor.php?";
	var div = document.getElementById('homeCentro');
		
	httpProfessor = null;
	var httpProfessor = new Http();
	httpProfessor.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpProfessor.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpProfessor.xmlhttp.readyState == 4){
										if(httpProfessor.xmlhttp.status == 200){
		                                    div.innerHTML = httpProfessor.xmlhttp.responseText;
										 }
									 }
								  };
	httpProfessor.xmlhttp.send(null);
}

function Corporativo(){
	
	document.getElementById('icentro').style.display = "none";
	document.getElementById('propagandas-direito').style.display = "";
	document.getElementById('homeCentro').style.display = "";
    document.getElementById('homeCentro').style.width = "640px";
	
    var url = "corporativo.php?";
	var div = document.getElementById('homeCentro');
		
	httpCorporativo = null;
	var httpCorporativo = new Http();
	httpCorporativo.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpCorporativo.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpCorporativo.xmlhttp.readyState == 4){
										if(httpCorporativo.xmlhttp.status == 200){
		                                    div.innerHTML = httpCorporativo.xmlhttp.responseText;
										 }
									 }
								  };
	httpCorporativo.xmlhttp.send(null);
}

function Academico(){
	
	document.getElementById('icentro').style.display = "none";
	document.getElementById('propagandas-direito').style.display = "";
	document.getElementById('homeCentro').style.display = "";
    document.getElementById('homeCentro').style.width = "640px";
	
    var url = "academico.php?";
	var div = document.getElementById('homeCentro');
		
	httpAcademico = null;
	var httpAcademico = new Http();
	httpAcademico.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpAcademico.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpAcademico.xmlhttp.readyState == 4){
										if(httpAcademico.xmlhttp.status == 200){
		                                    div.innerHTML = httpAcademico.xmlhttp.responseText;
										 }
									 }
								  };
	httpAcademico.xmlhttp.send(null);
}

function Profissional(){
	
	document.getElementById('icentro').style.display = "none";
	document.getElementById('propagandas-direito').style.display = "";
	document.getElementById('homeCentro').style.display = "";
    document.getElementById('homeCentro').style.width = "640px";
	
    var url = "profissional.php?";
	var div = document.getElementById('homeCentro');
		
	httpProfissional = null;
	var httpProfissional = new Http();
	httpProfissional.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpProfissional.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpProfissional.xmlhttp.readyState == 4){
										if(httpProfissional.xmlhttp.status == 200){
		                                    div.innerHTML = httpProfissional.xmlhttp.responseText;
										 }
									 }
								  };
	httpProfissional.xmlhttp.send(null);
}

function Logar(){
	
	document.getElementById('icentro').style.display = "none";
	document.getElementById('propagandas-direito').style.display = "";
	document.getElementById('homeCentro').style.display = "";
    document.getElementById('homeCentro').style.width = "640px";
	
    var url = "login.php?";
	var div = document.getElementById('homeCentro');
		
	httpLogar = null;
	var httpLogar = new Http();
	httpLogar.xmlhttp.open("GET", url +  "time=" + new Date(), true);
	httpLogar.xmlhttp.onreadystatechange = function(){
									div.innerHTML = 'Carregando...<br /><img src="img/carregando.gif" /><br />';
									if(httpLogar.xmlhttp.readyState == 4){
										if(httpLogar.xmlhttp.status == 200){
		                                    div.innerHTML = httpLogar.xmlhttp.responseText;
										 }
									 }
								  };
	httpLogar.xmlhttp.send(null);
}

function Colunistas(frame,url){
	
	document.getElementById('homeCentro').style.display = "none";
    document.getElementById('propagandas-direito').style.display = "block";
	document.getElementById(frame).style.display = "block";
	document.getElementById(frame).style.width = "640px";
	document.getElementById(frame).style.height = "1600px"; 
	document.getElementById(frame).src=url;
}
