var URLSite = window.location.href;
var TituloSite = document.title;

var MensagemAtual = 0;
var offset = 0;
var posicoesVetor = 2; //Número de mensagens
var vetor = new Array(2); //Cria o vetor com 2 posicoes
vetor[0]="P R O J E T O   M E R G U L H A R";
vetor[1]="H T T P : / / W W W . P R O J E T O M E R G U L H A R . C O M . B R";


function cadmail() {
	window.open('cadmail.asp?email='+document.emailx.email.value+'&Opcao='+document.emailx.tipo.value,'email','resizable=no, width=270, height=180, scrollbars=no');
	document.emailx.reset()
}

function limpa() {
	document.emailx.email.value=''
}
	
function mostrabanner()   {
	var text = vetor[MensagemAtual];
	if (offset < text.length) {
		var partialMessage = text.substring(0, offset +1);
		window.status = partialMessage;
		offset++;
		IDdoTimer = setTimeout("mostrabanner()", 20);
	} else {
		offset = 0;
		MensagemAtual++
		if (MensagemAtual == posicoesVetor) MensagemAtual = 0;
			IDdoTimer = setTimeout ("mostrabanner()", 1000);
		}
}

function anuncie(janela) {
	window.open(janela,'anuncie','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=400,height=300,top=120,left=120');
}

function addfav(){
	if (document.all) window.external.AddFavorite(URLSite,TituloSite);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function mostrabanner()   {
	var text = vetor[MensagemAtual];
	if (offset < text.length) {
		var partialMessage = text.substring(0, offset +1);
		window.status = partialMessage;
		offset++;
		IDdoTimer = setTimeout("mostrabanner()", 20);
	} else {
		offset = 0;
		MensagemAtual++
		if (MensagemAtual == posicoesVetor) MensagemAtual = 0;
		IDdoTimer = setTimeout ("mostrabanner()", 1000);
	}
}

function valida(theForm) {
	if (theForm.frmLogin.value == "") {
		alert("Informe o Login, com o qual será reconhecido no curso.");
		theForm.frmLogin.focus();
		return (false);
	}

	if (theForm.frmLogin.value.length < 6) {
		alert("Login deve ter no mínimo 6 caracteres");
		theForm.frmLogin.focus();
		return (false);
	}

	if (theForm.frmLogin.value.length > 15) {
		alert("Login pode ter no máximo 15 caracteres");
		theForm.frmLogin.focus();
		return (false);
	}
	
	if (theForm.frmSenha.value == "") {
		alert("Informe sua senha para entrada no curso");
		theForm.frmSenha.focus();
		return (false);
	}
	
	if (theForm.frmSenha.value.length < 5) {
		alert("A senha deve ter no mínimo 5 caracteres");
		theForm.frmSenha.focus();
		return (false);
	}
	
	if (theForm.frmSenha.value.length > 10) {
		alert("A senha pode ter no máximo 10 caracteres");
		theForm.frmSenha.focus();
		return (false);
	}
	
	return (true);
}

function addfav(){
	if (document.all) window.external.AddFavorite(URLSite,TituloSite);
}