function showHideLayers(theElement)
{
	divs = document.getElementsByTagName('div');
	for (i = 0; i < divs.length; i++)
		if (divs[i].id == theElement)
			divs[i].style.visibility = 'visible';
		else
			divs[i].style.visibility = 'hidden';
}
function startupload(progressID)
{
	Janela("progress.asp?progressid="+progressID,null,410,200);
}
function Janela(theURL,winName,w,h)
{
	l = (screen.availWidth-10 - w) / 2;
	t = (screen.availHeight-20 - h) / 2;
	features = "width="+w+",height="+h+",left="+l+",top="+t;
	features += ",screenX="+l+",screenY="+t;
	features += ",scrollbars=0,resizable=0,location=0";
	features += ",menubar=0,toolbar=0,status=0";
	window.open(theURL,winName,features);
}
function Janela1(theURL,winName,w,h)
{
	l = (screen.availWidth-10 - w) / 2;
	t = (screen.availHeight-20 - h) / 2;
	features = "width="+w+",height="+h+",left="+l+",top="+t;
	features += ",screenX="+l+",screenY="+t;
	features += ",scrollbars=1,resizable=0,location=0";
	features += ",menubar=0,toolbar=0,status=0";
	window.open(theURL,winName,features);
}
function minusculas(objeto)
{
	campo = eval (objeto);
	campo.value = campo.value.toLowerCase();
}
function redireciona()
{
	window.location = "index.asp";
}
function checkUncheckAll(theElement)
{
	var theForm = theElement.form, z = 0;
	while (theForm[z].type == 'checkbox' && theForm[z].name != 'todos')
	{
		theForm[z].checked = theElement.checked;
		z++;
	}
}
function confirmSubmit(theTextConfirm,theTextError,theElement)
{
	var theForm = theElement.form, z = 0;
	var encontrou = false;
	while (theForm[z].type == 'checkbox')
	{
		if (theForm[z].checked)
			encontrou = true;
		z++;
	}
	if (encontrou)
		return confirm(theTextConfirm);
	else
		alert(theTextError);
	return false;
}
function mascaraNumero(keypress)
{
	if (keypress > 47 && keypress < 58)
		return true;
	return false;
}
function mascaraValor(fld, milSep, decSep, e)
{
	var sep = 0;
	var key = '';
	var i = j = 0;
	var len = len2 = 0;
	var strCheck = '0123456789';
	var aux = aux2 = '';
	var whichCode = (window.Event) ? e.which : e.keyCode;
	if (whichCode == 13) return true;
	key = String.fromCharCode(whichCode);
	if (strCheck.indexOf(key) == -1) return false;
	len = fld.value.length;
	if (len == 4 && fld.value.substr(0,1) != '0') return false;
	if (len < 5)
	{
		for(i = 0; i < len; i++)
		if ((fld.value.charAt(i) != '0') && (fld.value.charAt(i) != decSep)) break;
		aux = '';
		for(; i < len; i++)
		if (strCheck.indexOf(fld.value.charAt(i))!=-1) aux += fld.value.charAt(i);
		aux += key;
		len = aux.length;
		if (len == 0) fld.value = '';
		if (len == 1) fld.value = '0'+ decSep + '0' + aux;
		if (len == 2) fld.value = '0'+ decSep + aux;
		if (len > 2)
		{
			aux2 = '';
			for (j = 0, i = len - 3; i >= 0; i--)
			{
				if (j == 3)
				{
					aux2 += milSep;
					j = 0;
				}
				aux2 += aux.charAt(i);
				j++;
			}
			fld.value = '';
			len2 = aux2.length;
			for (i = len2 - 1; i >= 0; i--)
				fld.value += aux2.charAt(i);
			fld.value += decSep + aux.substr(len - 2, len);
		}
		return false;
	}
	return false;
}
function mascaraData(fld, keypress)
{
	campo = eval (fld);
	separador = '/';
	conjunto1 = 2;
	conjunto2 = 5;
	if (keypress > 47 && keypress < 58)
	{
		if (campo.value.length == conjunto1)
		{
			campo.value = campo.value + separador;
		}
		if (campo.value.length == conjunto2)
		{
			campo.value = campo.value + separador;
		}
		return true;
	}
	return false;
}
function verificaData(theForm)
{
	if (theForm.data.value == '')
	{
		alert('Digite a data!');
		theForm.data.focus();
		return false;
	}
	else
	{
		var dia = parseInt(theForm.data.value.substring(0,2),10);
		var mes = parseInt(theForm.data.value.substring(3,5),10);
		var ano = parseInt(theForm.data.value.substring(6,10),10);
		data = new Date();
		if (dia <= 31 && mes <= 12 && ano >= 1900)
		{
			if (theForm.data.value.substring(0,1) == '0' && theForm.data.value.substring(1,2) != '0' || theForm.data.value.substring(0,1) != '0')
			{
				if (theForm.data.value.substring(2,3) == "/")
				{
					if (theForm.data.value.substring(3,4) == '0' && theForm.data.value.substring(4,5) != '0' || theForm.data.value.substring(3,4) != '0')
					{
						if (theForm.data.value.substring(5,6) == "/")
						{
							if (theForm.data.value.substring(6,7) == '0' || theForm.data.value.substring(6,7) == '' && theForm.data.value.substring(7,8) != '0')
							{
								alert('Verifique a data!');
								theForm.data.focus();
								return false;
							}
							if (mes == 2)
							{
								if ((dia > 0) && (dia <= 29))
								{
									if (dia == 29)
									{
										if ((ano % 4) != 0)
										{
											alert('Verifique a data!');
											theForm.data.focus();
											return false;
										}
									}
								}
								else
								{
									alert('Verifique a data!');
									theForm.data.focus();
									return false; 
								}
							}
							if ((mes == 4) || (mes == 6) || (mes == 9) || (mes == 11))
							{
								if (!((dia > 0 ) && (dia <= 30)))
								{
									alert('Verifique a data!');
									theForm.data.focus();
									return false;
								}
							}
							if ((mes == 1) || (mes == 3) || (mes == 5) || (mes ==7) || (mes == 8) || (mes == 10) || (mes == 12))
							{
								if (!((dia > 0) && (dia <= 31)))
								{
									alert('Verifique a data!');
									theForm.data.focus();
									return false;
								}
							}
						}
						else
						{
							alert('Verifique a data!');
							theForm.data.focus();
							return false;
						}
					}
					else
					{
						alert('Verifique a data!');
						theForm.data.focus();
						return false;
					}
				}
				else
				{
					alert('Verifique a data!');
					theForm.data.focus();
					return false;
				}
			}
			else
			{
				alert('Verifique a data!');
				theForm.data.focus();
				return false;
			}
		}
		else
		{
			alert('Verifique a data!');
			theForm.data.focus();
			return false;
		}
	}
	return true;
}
function verificaEmail(theForm)
{
	if (theForm.email.value == '')
	{
		alert('Digite seu e-mail!');
		theForm.email.focus();
		return false;
	}
	else
	{
		prim = theForm.email.value.indexOf("@");
		if (prim < 2)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@",prim + 1) != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".") < 1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(" ") != -1)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(";") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".@") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("@.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(".com.br.") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("/") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("[") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("]") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("(") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf(")") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("'") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("\"") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
		if(theForm.email.value.indexOf("..") > 0)
		{
			alert("O e-mail informado não parece estar correto.");
			theForm.email.focus();
			return false;
		}
	}
	return true;
}
function verificaContato(theForm)
{
	if (theForm.nome.value == '')
	{
		alert('Digite seu nome!');
		theForm.nome.focus();
		return false;
	}
	if (!verificaEmail(theForm))
		return false;
	if (theForm.texto.value == '')
	{
		alert('Digite sua mensagem!');
		theForm.texto.focus();
		return false;
	}
	return true;
}
function verificaAtletas(theForm,progressID)
{
	if (theForm.nome.value == '')
	{
		alert('Digite o nome!');
		theForm.nome.focus();
		return false;
	}
	if (theForm.posicao.selectedIndex == -1)
	{
		alert('Selecione a posição!');
		theForm.posicao.focus();
		return false;
	}
	if (!verificaData(theForm))
		return false;
	if (theForm.altura.value == '')
	{
		alert('Digite a altura!');
		theForm.altura.focus();
		return false;
	}
	if (theForm.altura.value.length < 4)
	{
		alert('Verifique a altura!');
		theForm.altura.focus();
		return false;
	}
	if (theForm.peso.value == '')
	{
		alert('Digite o peso!');
		theForm.peso.focus();
		return false;
	}
	if (theForm.peso.value.length < 2)
	{
		alert('Verifique o peso!');
		theForm.peso.focus();
		return false;
	}
	if (theForm.descricao.value != '')
	{
		if (theForm.descricao.value.length < 4)
		{
			alert('Digite pelo menos 4 letras na descrição!');
			theForm.descricao.focus();
			return false;
		}
	}
	ext = theForm.foto.value;
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
		startupload(progressID);
	return true;
}
function verificaFotos(theForm,progressID)
{
	if (theForm.titulo.value == '')
	{
		alert('Digite o título da foto!');
		theForm.titulo.focus();
		return false;
	}
	ext = theForm.foto.value;
	if (ext == '')
	{
		alert('Escolha a foto!');
		theForm.foto.focus();
		return false;
	}
	ext = ext.substring(ext.length-3,ext.length);
	ext = ext.toLowerCase();
	if (ext != 'jpg')
	{
		alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
		theForm.foto.focus();
		return false;
	}
	startupload(progressID);
	return true;
}
function verificaVideos(theForm,progressID)
{
	if (theForm.titulo.value == '')
	{
		alert('Digite o título do vídeo!');
		theForm.titulo.focus();
		return false;
	}
	ext = theForm.video.value;
	if (ext == '')
	{
		alert('Escolha o vídeo!');
		theForm.video.focus();
		return false;
	}
	ext = ext.substring(ext.length-3,ext.length);
	ext = ext.toLowerCase();
	if (ext != 'wmv')
	{
		alert('O arquivo selecionado não poderá ser enviado. Formato permitido: WMV!');
		theForm.video.focus();
		return false;
	}
	startupload(progressID);
	return true;
}
function verificaNoticias(theForm,progressID)
{
	if (!verificaData(theForm))
		return false;
	if (theForm.titulo.value == '')
	{
		alert('Digite o título!');
		theForm.titulo.focus();
		return false;
	}
	if (theForm.texto.value == '')
	{
		alert('Digite o texto!');
		theForm.texto.focus();
		return false;
	}
	if (theForm.texto.value.length < 4)
	{
		alert('Digite pelo menos 4 letras no texto!');
		theForm.texto.focus();
		return false;
	}
	ext = theForm.foto.value;
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
		startupload(progressID);
	return true;
}
function verificaParcerias(theForm,progressID)
{
	if (theForm.empresa.value == '')
	{
		alert('Digite o nome da empresa!');
		theForm.empresa.focus();
		return false;
	}
	ext = theForm.foto.value;
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
		startupload(progressID);
	return true;
}
function verificaSenha(theForm)
{
	if (theForm.login.value == '')
	{
		alert('Digite o login do usuário!');
		theForm.login.focus();
		return false;
	}
	if (theForm.senha1.value == '')
	{
		alert('Digite a senha!');
		theForm.senha1.focus();
		return false;
	}
	if (theForm.senha2.value == '')
	{
		alert('Confirme a senha!');
		theForm.senha2.focus();
		return false;
	}
	if (theForm.senha1.value != theForm.senha2.value)
	{
		alert('Confirmação de senha não confere!');
		theForm.senha1.focus();
		return false;
	}
	return true;
}
function verificaAnimacao(theForm,progressID)
{
	if (theForm.imagem.value == '')
	{
		alert('Digite o título!');
		theForm.imagem.focus();
		return false;
	}
	ext = theForm.foto.value;
	if (theForm.acao.value == 'incluir')
	{
		if (ext == '')
		{
			alert('Selecione a imagem!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
	{
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if (ext != 'jpg')
		{
			alert('O arquivo selecionado não poderá ser enviado. Formato permitido: JPG!');
			theForm.foto.focus();
			return false;
		}
	}
	if (ext != '')
		startupload(progressID);
	return true;
}
function verificaTransacoes(theForm)
{
	if (!verificaData(theForm))
		return false;
	if (theForm.atleta.value == '')
	{
		alert('Digite o nome do atleta!');
		theForm.atleta.focus();
		return false;
	}
	if (theForm.origem.value == '')
	{
		alert('Digite a origem!');
		theForm.origem.focus();
		return false;
	}
	if (theForm.destino.value == '')
	{
		alert('Digite o destino!');
		theForm.destino.focus();
		return false;
	}
	return true;
}
function goup(){if(sspeed!=rspeed*16){sspeed=sspeed*2;restart=sspeed;}}
function godown(){if(sspeed>rspeed){sspeed=sspeed/2;restart=sspeed;}}
function start(){
if(document.getElementById){ns6div=document.getElementById('iens6div');ns6div.style.top=sheight;ns6div.innerHTML=singletext[0];sizeup=ns6div.offsetHeight;ns6scroll();}
else 
if(document.layers){ns4layer=document.ns4div.document.ns4div1;ns4layer.top=sheight;ns4layer.document.write(singletext[0]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}
else 
if(document.all){iediv=iens6div;iediv.style.pixelTop=sheight;iediv.innerHTML=singletext[0];sizeup=iediv.offsetHeight;iescroll();}}
function iescroll(){if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){iediv.style.pixelTop=0;setTimeout("iescroll()",spause);}else 
if(iediv.style.pixelTop>=sizeup*-1){iediv.style.pixelTop-=sspeed;setTimeout("iescroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;iediv.style.pixelTop=sheight;iediv.innerHTML=singletext[ii];sizeup=iediv.offsetHeight;iescroll();}}
function ns4scroll(){if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4scroll()",spause);}else 
if(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll()",100);}else{if(ii==singletext.length-1)ii=0;else ii++;ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);ns4layer.document.close();sizeup=ns4layer.document.height;ns4scroll();}}
function ns6scroll(){if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.top=0;setTimeout("ns6scroll()",spause);}else 
if(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.style.top)-sspeed;setTimeout("ns6scroll()",100);}
else{if(ii==singletext.length-1)ii=0;else ii++;
ns6div.style.top=sheight;ns6div.innerHTML=singletext[ii];sizeup=ns6div.offsetHeight;ns6scroll();}}
//-- end Algorithm -->