function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente,pgphp) {
	obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	if(transparente == true) {
		obj+= '<param name="wmode" value="transparent" />';
	}
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<param name="FlashVars" value="pg='+pgphp+'" />';
	obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" quality="'+qualidade+'" bgcolor="'+bgcolor+'" FlashVars="pg='+pgphp+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}

function abrePag(id){
	if(id == 'menu1'){
		window.document.getElementById('menu1').style.display = '';
		window.document.getElementById('menu2').style.display = 'none';
		window.document.getElementById('menu3').style.display = 'none';
		document.getElementById('1').className = "ativo";
		document.getElementById('2').className = "";
		document.getElementById('3').className = "";
	}if(id == 'menu2'){
		window.document.getElementById('menu1').style.display = 'none';
		window.document.getElementById('menu2').style.display = '';
		window.document.getElementById('menu3').style.display = 'none';
		document.getElementById('1').className = "";
		document.getElementById('2').className = "ativo";
		document.getElementById('3').className = "";
	}if(id == 'menu3'){
		window.document.getElementById('menu1').style.display = 'none';
		window.document.getElementById('menu2').style.display = 'none';
		window.document.getElementById('menu3').style.display = '';
		document.getElementById('1').className = "";
		document.getElementById('2').className = "";
		document.getElementById('3').className = "ativo";
		
	}
		
}

function abreForm(id){
	if(id == 'indique'){
		window.document.getElementById('indique').style.display = '';
		window.document.getElementById('votar').style.display = 'none';
	}
	if(id == 'votar'){
		window.document.getElementById('votar').style.display = '';
		window.document.getElementById('indique').style.display = 'none';
	}
		
}

function Ativa() {
	VerificaSenha(id);
}	

function VerificaSenha(id) {
	
		if((window.document.frmCadastro.senha.value != "") && (window.document.frmCadastro.senha_confirma.value != "")){
			if(window.document.frmCadastro.senha.value == window.document.frmCadastro.senha_confirma.value) {
				//alert('correto');	
			} else {
				alert('Senha não confere.');
				window.document.frmCadastro.senha_confirma.value = "";	
			}
		}
}

function validaCadastro(){

	if(window.document.frmCadastro.nome.value == ""){
		alert("O campo NOME deve ser preenchido!");
		return false;
	}
	
	if(window.document.frmCadastro.foto.value == ""){
		alert("O campo FOTO deve ser preenchido!");
		return false;
	}
	
	if(window.document.frmCadastro.cpf.value == ""){
		alert("O campo CPF deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.email.value == ""){
		alert("O campo E-MAIL deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.telefone.value == ""){
		alert("O campo TELEFONE FIXO deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.curso.value == ""){
		alert("O campo CURSO DE INTERESSE deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.login.value == ""){
		alert("O campo LOGIN deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.senha.value == "" || window.document.frmCadastro.senha_confirma.value == ""){
		alert("O campo SENHA deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.resposta.value == ""){
		alert("O campo 'Porque eu mereço ganhar uma bolsa de estudos?' deve ser preenchido!");
		return false;
	}
	return true;
}

function validaAltera(){
	if(window.document.frmCadastro.nome.value == ""){
		alert("O campo NOME deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.cpf.value == ""){
		alert("O campo CPF deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.email.value == ""){
		alert("O campo E-MAIL deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.telefone.value == ""){
		alert("O campo TELEFONE FIXO deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.curso.value == ""){
		alert("O campo CURSO DE INTERESSE deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.login.value == ""){
		alert("O campo LOGIN deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.senha.value == "" || window.document.frmCadastro.senha_confirma.value == ""){
		alert("O campo SENHA deve ser preenchido!");
		return false;
	}
	if(window.document.frmCadastro.resposta.value == ""){
		alert("O campo 'Porque eu mereço ganhar uma bolsa de estudos?' deve ser preenchido!");
		return false;
	}
	return true;
}

function validaVoto(){
	if(window.document.frmVoto.nome.value == ""){
		alert("O campo NOME deve ser preenchido!");
		return false;
	}
	
	if(window.document.frmVoto.email.value == ""){
		alert("O campo E-MAIL deve ser preenchido!");
		return false;
	}
	return true;
}

function validaLogin(){
	if(window.document.frmLogin.login.value == ""){
		alert("O campo LOGIN deve ser preenchido!");
		return false;
	}
	
	if(window.document.frmLogin.senha.value == ""){
		alert("O campo SENHA deve ser preenchido!");
		return false;
	}
	//window.document.frmLogin.submit();
	return true;
}

function validaIndique(){
	if(window.document.frmIndique.nome.value == ""){
		alert("Digite seu NOME por favor!");
		return false;
	}
	
	if(window.document.frmIndique.email.value == ""){
		alert("Digite seu E-MAIL por favor!");
		return false;
	}
	if(window.document.frmIndique.nome1.value == ""){
		alert("Digite o NOME DO SEU AMIGO por favor!");
		return false;
	}
	if(window.document.frmIndique.email1.value == ""){
		alert("Digite o E-MAIL DO SEU AMIGO por favor!");
		return false;
	}
	return true;
}

function formatar(src, mask) {
	var i = src.value.length;
	var saida = mask.substring(0,1);
	var texto = mask.substring(i)

	if (texto.substring(0,1) != saida) {
		src.value += texto.substring(0,1);
	}
}

function maxLength(textAreaField, limit) {
	var ta = document.getElementById(textAreaField);
	
	if (ta.value.length >= limit) {
		ta.value = ta.value.substring(0, limit-1);
		alert('O limite de caracteres foi excedido.');
	}
}