<!--
// See KB article about changing this dynamic HTML
	function getControlTag(src)
	{
		TRok = false
		while ("HTML" != src.tagName)
		{
			if ("IMG" == src.tagName || "FONT" == src.tagName || "A" == src.tagName || "TD" == src.tagName)
			    TRok = true
			if ("LI" == src.tagName)
				return src
			if ("TR" == src.tagName)
			{
				if(TRok)
					return src
				return null
			}
			src = src.parentElement
		}
		return null
	}
	function dynOutlineEnabled(src)
	{
		while ("BODY" != src.tagName)
		{
			table = "TABLE" == src.tagName;
			if(table && src.getAttribute("border", false) != "0")
				return false;
			if("OL" == src.tagName || "UL" == src.tagName || table)
			{
				if(null != src.getAttribute("nodynamicoutline", false))
					return false
				if(null != src.getAttribute("dynamicoutline", false))
					return true
				if(mac > 0)
				{
					var at = src.outerHTML.indexOf("dynamicoutline")
					if(at > 0)
					{
						var gt = src.outerHTML.indexOf(">")
						if(at < gt)
							return true
					}
				}
			}
			src = src.parentElement
		}
		return false
	}
    function initCollapse(src)
    {
		while ("BODY" != src.tagName)
		{
			table = "TABLE" == src.tagName;
    		if(table && src.getAttribute("border", false) != "0")
    			return false;
        	if("OL" == src.tagName || "UL" == src.tagName || table)
    		{
    			if(null != src.getAttribute("initcollapsed", false))
    				return true
    		}
    		src = src.parentElement
        }
		return false
    }
	function containedIn(src, dest)
	{
		if ("!" == src.tagName)
			return true
		src = getControlTag(src)
		if (src == dest)
		    return true
		return false
	}
    function initOutline()
    {
		var ms = navigator.appVersion.indexOf("MSIE");
    	mac = navigator.appVersion.indexOf("Macintosh");
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
		if(!ie4)
			return;
        listTags = new Array()
        listTags[0]="UL"
        listTags[1]="OL"
        listTags[2]="TABLE"
        for(j=0;j<listTags.length;j++)
        {
            tagName=listTags[j]
            coll=document.all.tags(tagName)
            for(i=0; i<coll.length; i++)
            {
                if(dynOutlineEnabled(coll[i].parentElement))
                {
                    if(initCollapse(coll[i]))
                        coll[i].style.display="none"
                }
            }
        }        
    }   
	function dynOutline()
	{
		var ms = navigator.appVersion.indexOf("MSIE");
		ie4 = (ms>0) && (parseInt(navigator.appVersion.substring(ms+5, ms+6)) >= 4);
		if(!ie4)
			return;
		var src = event.srcElement
		src = getControlTag(src)
		if (null == src)
			return
		if (!dynOutlineEnabled(src))
			return
		var idx = src.sourceIndex+1
		while (idx < document.all.length && containedIn(document.all[idx], src))
		{
			srcTmp = document.all[idx]
			tag = srcTmp.tagName
			if ("UL" == tag || "OL" == tag || "TABLE" == tag)
				srcTmp.style.display = srcTmp.style.display == "none" ? "" : "none"
			idx++;
		}
	}
	
	//Funções da página de inscrição da palestra do ministro
function validaCPF() {
cpf = document.frmaluno.cpf.value;
erro = new String;
if (cpf.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; 
var nonNumbers = /\D/;
if (nonNumbers.test(cpf)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; 
if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999"){
erro += "Numero de CPF invalido!"
}
var a = [];
var b = new Number;
var c = 11;
for (i=0; i<11; i++){
a[i] = cpf.charAt(i);
if (i < 9) b += (a[i] * --c);
}
if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
b = 0;
c = 11;
for (y=0; y<10; y++) b += (a[y] * c--); 
if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
erro +="CPF Inválido!";
}
if (erro.length > 0){
alert(erro);
return false;										 
}

}

function Numero(e){
  navegador = /msie/i.test(navigator.userAgent);
    if (navegador) 
	  var tecla = event.keyCode; 
	else
		var tecla = e.which;  
		if(tecla > 47 && tecla < 58) // numeros de 0 a 9    
			return true; 
		else    {    
			if (tecla != 8) // backspace     
				return false;    
			else     
				return true;
	}
}



function validaaluno() { 
	if (document.frmaluno.matricula.value == "") {
		alert("Campo matrícula é obrigatório");
		document.frmaluno.matricula.focus();
		return false;
	}
	 else if (document.frmaluno.cpf.value == "") {
		alert("Campo CPF é obrigatório");
		document.frmaluno.cpf.value = "";
		document.frmaluno.cpf.focus();
		return false;
	}
	else if (validaCPF() == 0) {
		return false;
	}
	else {	return true; }
}



function validavisitante() {
	if (document.frmvisitante.nome.value == "") {
		alert("Campo Nome Completo é Obrigatório");
		document.frmvisitante.nome.focus();
		return false;
	}
	else if (document.frmvisitante.rg.value == "") {
		alert("Campo RG é Obrigatório");
		document.frmvisitante.rg.focus();
		return false;
	}
	else if (document.frmvisitante.cpfb.value == "") {
		alert("Campo CPF é Obrigatório");
		document.frmvisitante.cpfb.focus();
		return false;
	}
	else if (validaCPFB() == 0) {
		document.frmvisitante.cpfb.value = "";
		document.frmvisitante.cpfb.focus();		
		return false;
	}
	else if (document.frmvisitante.telefone.value == "") {
		alert("Campo Telefone é Obrigatório");
		document.frmvisitante.telefone.focus();
		return false;
	}
	else if (document.frmvisitante.email.value == "") {
		alert("Campo E-mail ou Endereço é Obrigatório");
		document.frmvisitante.email.focus();
		return false;
	}
	else {
		return true;
	}
}
function validaCPFB() {
cpfb = document.frmvisitante.cpfb.value;
erro = new String;
if (cpfb.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; 
var nonNumbers = /\D/;
if (nonNumbers.test(cpfb)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; 
if (cpfb == "00000000000" || cpfb == "11111111111" || cpfb == "22222222222" || cpfb == "33333333333" || cpfb == "44444444444" || cpfb == "55555555555" || cpfb == "66666666666" || cpfb == "77777777777" || cpfb == "88888888888" || cpfb == "99999999999"){
erro += "Numero de CPF invalido!"
}
var a = [];
var b = new Number;
var c = 11;
for (i=0; i<11; i++){
a[i] = cpfb.charAt(i);
if (i < 9) b += (a[i] * --c);
}
if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
b = 0;
c = 11;
for (y=0; y<10; y++) b += (a[y] * c--); 
if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
if ((cpfb.charAt(9) != a[9]) || (cpfb.charAt(10) != a[10])){
erro +="CPF Inválido!";
}
if (erro.length > 0){
alert(erro);
return false;										 
}

}


// JavaScript Document
/****************************************************************************
* Flash Tag Write Object v1.2b - by Lucas Fererira - www.lucasferreira.com	*
* Info and Usage: www.lucasferreira.com/flashtag							*
* bugs/reports: contato@lucasferreira.com									*
****************************************************************************/

if(Browser == undefined){
	var Browser = {
		isIE: function(){ return (window.ActiveXObject && document.all && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1) ? true : false; }
	}
}

var Flash = function(movie, id, width, height, initParams){

	this.html = "";
	this.attributes = this.params = this.variables = null;
	
	this.variables = new Array();
	this.attributes = {
		"classid": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
		"codebase": "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab#version=8,0,22,0",
		"type": "application/x-shockwave-flash"
	}
	this.params = { "pluginurl": "http://www.macromedia.com/go/getflashplayer_br" };
	
	if(movie) {
		this.addAttribute("data", movie);
		this.addParameter("movie", movie);
	}
	
	if(id && id != null) this.addAttribute("id", id);
	if(width) this.addAttribute("width", width);
	if(height) this.addAttribute("height", height);
	
	if(initParams != undefined){
		for(var i in initParams){
			this.addParameter(i.toString(), initParams[i]);
		}
	}
	
}
Flash.version = "1.2b";
Flash.getObjectByExceptions = function(obj, excep){
	var tempObj = {};
	for(var i in obj){
		var inclui = true;
		for(var j=0; j<excep.length; j++)
			if(excep[j] == i.toString()) { inclui = false; break; };
		if(inclui) tempObj[i] = obj[i];
	}
	return tempObj;
}
Flash.prototype.addAttribute = function(prop, val){ this.attributes[prop] = val; }
Flash.prototype.addParameter = function(prop, val){ this.params[prop] = val; }
Flash.prototype.addVariable = function(prop, val){ this.variables.push([prop, val]); }
Flash.prototype.getFlashVars = function(){
	var tempString = new Array();
	
	for(var i=0; i<this.variables.length; i++)
		tempString.push(this.variables[i].join("="));
		
	return tempString.join("&");
}
Flash.prototype.toString = function(){
	
	this.params.flashVars = this.getFlashVars();
	if(Browser.isIE()){
		//IE
		this.html = "<ob" + "ject";
		var attr = Flash.getObjectByExceptions(this.attributes, ["type", "data"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["pluginurl", "extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect>";
	} else {
		//non-IE
		this.html = "<!--[if !IE]> <--> <obj" + "ect";
		var attr = Flash.getObjectByExceptions(this.attributes, ["classid", "codebase"]);
		for(var i in attr) if(i.toString() != "extend") this.html += " " + i.toString() + " = \"" + attr[i] + "\"";
		this.html += "> ";
		var params = Flash.getObjectByExceptions(this.params, ["extend"]);
		for(var i in params) if(i.toString() != "extend") this.html += "<param name=\"" + i.toString() + "\" value=\"" + params[i] + "\" /> ";
		this.html += " </obj" + "ect> <!--> <![endif]-->";
	}

	return this.html;
	
}
Flash.prototype.write = Flash.prototype.outIn = Flash.prototype.writeIn = function(w){
	if(typeof w == "string" && document.getElementById) var w = document.getElementById(w);
	if( w != undefined && w ) w.innerHTML = this.toString();
	else document.write( this.toString() );
}


function validaCPF() {
cpf = document.form.cpf.value;
erro = new String;
if (cpf.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; 
var nonNumbers = /\D/;
if (nonNumbers.test(cpf)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; 
if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999"){
erro += "Numero de CPF invalido!"
}
var a = [];
var b = new Number;
var c = 11;
for (i=0; i<11; i++){
a[i] = cpf.charAt(i);
if (i < 9) b += (a[i] * --c);
}
if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11-x }
b = 0;
c = 11;
for (y=0; y<10; y++) b += (a[y] * c--); 
if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11-x; }
if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])){
erro +="CPF Inválido!";
}
if (erro.length > 0){
alert(erro);
document.form.cpf.value = "";
document.form.cpf.focus();
return false;										 
}
return true;
}

function Validacampos () {
	if (document.form.nome.value == ""){
		alert ('Campo Nome deve ser preenchido');
		document.form.nome.focus();
	}
		else if (document.form.endereco.value == ""){
		alert ('Campo Endereço deve ser preenchido');
		document.form.endereco.focus();
	}
		else if (document.form.end_num.value == ""){
		alert ('Campo Número do Endereço deve ser preenchido');
		document.form.end_num.focus();
	}
		else if (document.form.cidade.value == ""){
		alert ('Campo Cidade deve ser preenchido');
		document.form.cidade.focus();
	}
		else if (document.form.uf.value == ""){
		alert ('Campo UF do Endereço deve ser preenchido');
		document.form.uf.focus();
	}
		else if (document.form.cep.value == ""){
		alert ('Campo CEP deve ser preenchido');
		document.form.cep.focus();
	}
		else if (document.form.telefone.value == ""){
		alert ('Campo Telefone deve ser preenchido');
		document.form.telefone.focus();
	}
		else if (document.form.colegio.value == ""){
		alert ('Campo Colégio onde você estuda deve ser preenchido');
		document.form.colegio.focus();
	}
		else if (document.form.email.value == ""){
		alert ('Campo Email deve ser preenchido');
		document.form.email.focus();
	}
		else if (document.form.visitaguiada.value == ""){
		alert ('Escolha um dia para realizar sua visita.');
	}
    else {
		return true;
		
	}
}


function Validatudo() {
	if ((validaCPF() == 1) && (Validacampos() == 1)) {
	document.form.submit();
	}
}
//-->
