// JavaScript Document
function changecontent(which)
{
	obj = document.getElementById("idIframe");
	
	switch(which)
	{
		case 0:
			obj.src = "main.html";
			break;
		
		case 1:
			obj.src = "professores.html";
			break;

		case 2:
			obj.src = "instalacoes.html";
			break;

		case 3:
			obj.src = "explicacoes.html";
			break;

		case 4:
			obj.src = "descontos.html";
			break;

		case 5:
			obj.src = "psicologia.html";
			break;

		case 6:
			obj.src = "formacao.html";
			break;
	}
}

function showTable(which)
{
	document.getElementById("ensbasico").style.display = (which==1 ? "block" : "none");
	document.getElementById("subOption").style.display = (which==1 ? "block" : "none");
	document.getElementById("enssecund").style.display = (which==2 ? "block" : "none");
	document.getElementById("enssuper").style.display = (which==3 ? "block" : "none");
	
	document.getElementById("op1").style.backgroundColor = (which==1 ? "#FF9933" : "#AEAEFF");
	document.getElementById("op2").style.backgroundColor = (which==2 ? "#FF9933" : "#AEAEFF");
	document.getElementById("op3").style.backgroundColor = (which==3 ? "#FF9933" : "#AEAEFF");
}

function showsubTable(which)
{
	document.getElementById("ciclo1").style.display = (which==1 ? "block" : "none");
	document.getElementById("ciclo2").style.display = (which==2 ? "block" : "none");
	document.getElementById("ciclo3").style.display = (which==3 ? "block" : "none");
	
	document.getElementById("subop1").style.backgroundColor = (which==1 ? "#FF9933" : "#AEAEFF");
	document.getElementById("subop2").style.backgroundColor = (which==2 ? "#FF9933" : "#AEAEFF");
	document.getElementById("subop3").style.backgroundColor = (which==3 ? "#FF9933" : "#AEAEFF");
}

function showTablePsi(which)
{
	document.getElementById("psico1").style.display = (which==1 ? "block" : "none");
	document.getElementById("psico2").style.display = (which==2 ? "block" : "none");
	document.getElementById("psico3").style.display = (which==3 ? "block" : "none");

	document.getElementById("op1").style.backgroundColor = (which==1 ? "#FF9933" : "#AEAEFF");
	document.getElementById("op2").style.backgroundColor = (which==2 ? "#FF9933" : "#AEAEFF");
	document.getElementById("op3").style.backgroundColor = (which==3 ? "#FF9933" : "#AEAEFF");
}

function checkaddress()
{
	allOK = true;
	
	address = document.getElementById("hisemail").value;
	
	sReg = /^$|^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/i;
	
	if(!sReg.test(address))
	{
		alert("Endereço de mail inválido!!", "hisemail");
		allOK = false;
	}
	
	return(allOK);
}		
		
function sendIt()
{
	allOK = true;
	
	allOK = checkaddress();
	
	if(document.getElementById("hisemail").value=="" && allOK)
	{
		alert("Indique um endereço de mail por favor!");
		document.getElementById("hisemail").focus();
		allOK=false;
	}
	if(document.getElementById("subject").value=="" && allOK)
	{
		alert("Indique um assunto por favor!");
		document.getElementById("subject").focus();
		allOK=false;
	}
		
	if(allOK)
	{
		document.forms[0].submit();
	}
}

