//function reload() { location.href = window.location.href; }
//if (self != top) { setTimeout("reload()", 1000); }


var ok=0,umk=0,i=0,type_timer;saveWidth = 0;

window.status=" ";

function SetCookie(cookieName,cookieValue,nDays) {
	var today = new Date();
	var expire = new Date();
	if (nDays==null) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
}
function getCookie(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}

function scaleImg(what) {
        what = document.getElementById(what);
        load = document.getElementById("loading");
        what.style.display = "block";
        load.style.display = "none";
        if (navigator.appName == "Netscape")
          winW = window.innerWidth;
        if (navigator.appName.indexOf("Microsoft") != -1)
          winW = document.body.offsetWidth;
        if (what.width > (780) || saveWidth > (780)) {
          if (what.width == (780))
            what.width = saveWidth;

          else
          {
            saveWidth = what.width;
            what.style.cursor = "pointer";
            what.width = (780);
          }

        }
}

function chkxml(){
	if(umk == 0) { 
		alert('verifique se já existe esse atleta...');
		return false;
	}
	else { return true; }
}
function aorelha(or){
	if(or == "noticias"){
		document.getElementById(or).attributes["class"].value = 'ativo';
		document.getElementById("videos").attributes["class"].value = 'desativado';
		document.all["tab1"].style.display = "";
		document.all["tab2"].style.display = "none";
	}
	else{
		document.getElementById(or).attributes["class"].value = 'ativo';
		document.getElementById("noticias").attributes["class"].value = 'desativado';
		document.all["tab1"].style.display = "none";
		document.all["tab2"].style.display = "";
	}

}
function aorelha2(or){
	if(or == "video"){
		document.getElementById(or).attributes["class"].value = 'ativo';
		document.getElementById("comentarios").attributes["class"].value = 'desativado';
		document.all["tab1"].style.display = "";
		document.all["tab2"].style.display = "none";
	}
	else{
		document.getElementById(or).attributes["class"].value = 'ativo';
		document.getElementById("video").attributes["class"].value = 'desativado';
		document.all["tab1"].style.display = "none";
		document.all["tab2"].style.display = "";
	}

}

function makeXML(){
	if (window.XMLHttpRequest) {
	    	http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
		http_request.overrideMimeType('text/xml');
	}
	} else if (window.ActiveXObject) { 
		try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch (e) {
			try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); }
			catch (e) {}
		}
	}
	return http_request;
}

function contarvideo(link){
	makeXML();
	http_request.open('POST', 'com.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send("contarvideo="+link);

}

var setado = 0;
function excluir(comuok,n){			       	
	makeXML();

	if(!setado) { setado = 1; }
	else { 
		alert("já foi feito o pedido, aguarde");
		return;
	}
	url = "delcom=" + comuok + "&delete=" + n;
	if (confirm('você realmente deseja excluir este comentário?')){
		http_request.onreadystatechange = function(){
			if (http_request.readyState == 4) {
				if (http_request.status == 200) {
					if(http_request.responseText == "1"){
						setado = 0;
						alert("comentário apagado com sucesso , obrigado");
						getcom(link);
					}
				}
			}
		}
		http_request.open('POST', 'com.php', true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        	http_request.send(url);

	}

}
function envcom2(nome,nota,msg){
	makeXML();
	if(!msg) {
		alert("coloca algum comentário, animal");
		return 0;
	}else {
		document.getElementById('novocoment').innerHTML = "<br><center><img src='pics/loading.gif'><br>enviando comentário...</center>";
	}
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == "1") { alert("nome não permitido para seu uso, precisa estar logado :)"); }
				if(http_request.responseText == "2") { alert("cadê o comentário cavalo?"); }
				if(http_request.responseText == "3") { alert("você acabou de comentar , aguarde..."); }
				if(http_request.responseText == "4") {
					alert("comentário feito com sucesso , obrigado");
					getcom(link);

				}
			}
		}
	}

	sr = 'envcom=' + escape(msg) + '&nome=' + escape(nome) + '&nota=' + nota + '&link=' + link;

	http_request.open('POST', 'com.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);

}
function showinfo(x){
	window.open('?showinfo='+x,'Location','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=800,height=600'); 
}

function chkvideo2img(link,digitado){
	alert("Não é possível salver arquivos no momento, contato@quasemanobras.com.");
	return -1;
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == "erro") { document.getElementById('video2ERRO').innerHTML = "<font color='red'>figura não bate com digitado</font>"; getinfo(link); }
				else { //janela = window.open(http_request.responseText,'Download','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=1,height=1'); 
				parent.location= link;
				}
			}
		}
	}
		
	sr = 'xmlimgchk=' + escape(link) + '&dig=' + digitado;

	http_request.open('POST', 'com.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}

function xmlenquete(y,ow){
	document.getElementById('enquete').innerHTML = "<center><img src='pics/loading2.gif'></center>";
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) document.getElementById('enquete').innerHTML = http_request.responseText;
		}
	}
	if(ow == true) ow = 1;
	else ow = 2;
		
	sr = 'xmlenquete=' + y + '&enota=' + ow;

	http_request.open('POST', 'index.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}
function vertodas(){
	document.location = ".?procura=" + document.formproc.procura.value;
}

function vis(){
	document.getElementById('visualizar').innerHTML = "<center><img src='pics/loading.gif'></center>";
	document.getElementById('visualizar').style.display = '';
	
	if(!document.getElementById('noticia').value) vw = "digite algo meu senhor x)";
	else  vw = document.getElementById('noticia').value;
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) document.getElementById('visualizar').innerHTML = http_request.responseText;
		}
	}
		
	sr = 'preview=' + vw;

	http_request.open('POST', 'index.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
		
}
function sendmsg(x,y){
	msg = x.value;
	
	if(!msg) return 0;
	makeXML(); 

	sr = 'chatsend=' + msg + '&url=' + y;

        http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
	x.value = "";
}

function chkchar(x,y){
	char = x.value;

	if(window.event) {
		if(window.event.keyCode == 13) { sendmsg(x,y); }
		else if(window.event.keyCode == 27) { char = ""; } 
	}
	
	else { document.onkeypress = function(e){
			if(e.keyCode == 13) sendmsg(x,y);
			if(e.keyCode == 27) char = "";
		}
	}
		
}
function chkchar2(){
	if(window.event) {
		if(window.event.keyCode == 13)  xmlogin(document.getElementById('login').value,document.getElementById('password').value);
	}	
	else { document.onkeypress = function(e){
			if(e.keyCode == 13) xmlogin(document.getElementById('login').value,document.getElementById('password').value); 
		}
	}
	return false;
		
}
function chatal(url){
	makeXML(); 
//	removerOverlay();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200 && http_request.responseText) document.getElementById('chatmsg').innerHTML = http_request.responseText; 
		}
	}	

	sr = 'chatal=' + url;

        http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
	
	url = "chatal('" +url+ "');";
	setTimeout(url,2000);
}
function criarmsg(){
	document.getElementById('screenerr').style.display = "";
//	document.getElementById('screenerr').style.top = document.body.scrollTop + 15;
}
function openCHAT(ip){
	makeXML(); 
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 1) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = "criando conexão , aguarde !!!";
				}
				else if(http_request.responseText == 2) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = "número máximo de chats abertos ...";
				}
				if((http_request.responseText != 1) && (http_request.responseText != 2) && http_request.responseText) { 
					pr = ".?creatchat=" + http_request.responseText;
					document.getElementById('screenerr').style.display = "none";
					window.open(pr,'chat','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,status=no,resizable=0,width=610,height=500');

				}
			}		

		}
	}	

	sr = 'openCHAT=' + ip;

        http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}
function recCHATo(){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) document.getElementById('screenerr').style.display = "none";
		}
	}

	http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send('chat=1&status=1');
	
}
function creatCHAT(y){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				pr = ".?creatchat=" + http_request.responseText;
				document.getElementById('screenerr').style.display = "none";
				window.open(pr,'chat','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,status=no,resizable=0,width=610,height=500');
			}
		}
	}
	if(!y) y = 'de';
	sr = 'pegarurl=' + y;
	http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}
function creatCHAT2(){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 1) setTimeout("creatCHAT2('para');",1000);
				else { 
					document.getElementById('screenerr').style.display = "none";
					creatCHAT('para');
				}
			}
		}
	}
	sr = 'pegarurl=para';
	http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);


}
function acCHATo(){
	criarmsg();
	document.getElementById('screenerrMSG').innerHTML = "ok x) ! criando chat, aguarde...<br><input type='button' value='abrir manualmente' onClick='creatCHAT2();' class='botao2'>";
	
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) setTimeout("creatCHAT2();",1000);
		}
	}

	http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send('chat=1&status=2');
}
function chkscreenMSG(){
	if(document.getElementById('screenerr').style.display == 'none') removerOverlay(); 
	else setTimeout("chkscreenMSG();",1);
}


function achat(){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200){
				if(http_request.responseText == 1) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = "ok x) ! criando chat, aguarde...<br><input type='button' value='abrir manualmente' onClick='creatCHAT();' class='botao2'>";
					setTimeout("creatCHAT('de');",1000);
				}
				
				else if(http_request.responseText == 2) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = 'chat recusado =(...';
				}
				else if(http_request.responseText == 3) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = "criando conexão , aguarde !!!";
				}
				else if(http_request.responseText) {	
					criarmsg();
					document.getElementById('screenerrMSG').innerHTML = http_request.responseText + " querendo conversar com você<br>&nbsp;<br><input type='button' value='aceitar' onClick='acCHATo();' class='botao2'>&nbsp;<input type='button' value='recusar' onClick='recCHATo();' class='botao2'><bgsound src='sound/msg.wav'></bgsound>";
					setTimeout("chkscreenMSG();",1);
					bodyOverlay();
					
				}
			}
		}
	}	
			
	http_request.open('POST', '.', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send('chat=1');
	setTimeout("achat()", 5000); 
} 

achat();
function xmlvis(vislogin){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 1) { document.getElementById('picvis').src = 'pics/nk_2.gif'; document.getElementById('picvis').alt = 'invisivel'; }
				if(http_request.responseText == 0) { document.getElementById('picvis').src = 'pics/ok_2.gif'; document.getElementById('picvis').alt = 'visivel'; }
			}
		}
	}
		
	sr = 'setinvisible=' + vislogin;

	http_request.open('POST', 'index.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}

function btvote(down){
	document.getElementById('bestrick').innerHTML = "<center><img src='pics/loading2.gif'></center>";
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 0) document.getElementById('bestrick').innerHTML = "<font color='red'>erro ao votar , tente novamente mais tarde</font>";
				if(http_request.responseText != 0) document.getElementById('bestrick').innerHTML = "<b>bestrick</b> <img src='http://www.quasemanobras.com/pics/estrela.gif'>";
			}
		}
	}
		
	sr = 'xmlvote=1&vote=1&down=' + down;

	http_request.open('POST', 'com.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);


}
svtc = 0;
function svt(y,n){
	if(n == 0 && y == 0){
		for(i=1;i <= 3;i++){
			kpta = "st" + i;
			document.getElementById(kpta).src = "pics/star_bg.gif";
		}
		svtc = 0;
	}
	if(n == 2){
		if(!svtc) svtc = 1;
		else {
			for(i=1;i <= 3;i++) { kpta = "st" + i; document.getElementById(kpta).src = "pics/star_bg.gif"; }
			for(i=1;i <= y;i++){
				kpta = "st" + i;
				document.getElementById(kpta).src = "pics/star.gif";
			}
		}
	}
	if(n == 1 && !svtc){
		for(i=1;i <= y;i++){
			kpta = "st" + i;
			document.getElementById(kpta).src = "pics/star.gif";
		}
	}
	if(n == 0 && !svtc) {
		for(i=1;i <= y;i++){
			kpta = "st" + i;
			document.getElementById(kpta).src = "pics/star_bg.gif";
		}
	}
}

function reSize(el,acdiv){
		var x = 0;
		var y = el.offsetHeight;
		
		while (el.offsetParent && el.tagName.toUpperCase() != 'BODY'){
			x += el.offsetLeft;
			y += el.offsetTop;
			el = el.offsetParent;
		}

		x += el.offsetLeft;
		y += el.offsetTop;

		document.getElementById(acdiv).style.left = x + 'px';
		document.getElementById(acdiv).style.top = y + 'px';
}
function aa(y){
	if(y == 1) acDiv.innerHTML="<table width='100px' height='40px'><tr bgcolor='white'><td><center><img src='pics/loading.gif'></td></tr></table>";
	if(y == 2) acDiv.innerHTML="<input type='button' value='verificando dados , aguarde x)' class='botao2' disabled>";

	document.getElementById("acDiv").style.display = 'block';
}	

function xmlogout(){
		makeXML(); 
		reSize(document.getElementById('logout'),"acDiv");

		setTimeout("aa(1)",100);
		
		http_request.onreadystatechange = function(){
			if (http_request.readyState == 4) {
				if (http_request.status == 200) {
					if(http_request.responseText) {
						SetCookie(escape(http_request.responseText),"cya",0);
						setTimeout("window.location.reload()",2000)	
					}
				}
			}
		}
			
        	http_request.open('POST', 'index.php', true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	        http_request.send('xmlogout=1');
}
		
function xmlogin(loginv,passv){
		makeXML(); 
		reSize(document.getElementById('login'),"acDiv");
		
		setTimeout("aa(2)",100)
		
		http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 0) {
					acDiv.innerHTML="<input type='button' value='senha ou usuário invalido' class='botao2' disabled>";
					document.getElementById("acDiv").style.display = 'block';
				}
				else {
					str = http_request.responseText.split("(666|)");
					SetCookie(str[0],str[1],30);
					aa(1);
					setTimeout("window.location.reload()",2000)	
				}
			}
		}
		}

	
		sr = 'xmlogin=1&login=' + loginv + '&password=' + passv;

        	http_request.open('POST', 'index.php', true);
		http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	        http_request.send(sr);
}
function xmlsearch(){
	if(document.formproc.procura.value.length > 2){ 
		makeXML(); 
		
		reSize(document.formproc.procura,"acDiv");

		document.getElementById("acDiv").style.display = 'block';
		
		document.formproc.procura.setAttribute("autocomplete","off");

		http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {

				if(http_request.responseText == 0) { 
					acDiv.innerHTML="<input type='button' value='nenhum atleta encontrado' class='botao2' disabled>";
				}
				else {
					var itens = http_request.responseXML.getElementsByTagName('item');
					var itcount = itens.length;
					document.getElementById("acDiv").innerHTML = '';
					
//					var theTable = document.createElement('tableID');
					
//					var x = document.createElement('td');
					
					a = "<table width='200px'>"
					
					for (i=0; i<itcount; i++){
						a = a + unescape(itens[i].getAttribute("endereco")) + "<td width='90%'>" + unescape(itens[i].getAttribute("label")) + "</td><td width='10%'><center>" + unescape(itens[i].getAttribute("video")) + "</center></td></tr>";
						if(i > 5) {
							break;
						}
						
					}
					a = a + "</table>"
					if(i > 5) { 
						a = a + "<table width='200px'>";
						a = a + "<tr><td><center><input type='button' onClick='vertodas();' value='ver todos, " + itcount + "' class='botao2'></td></tr>";
						a = a + "</table>"
					}
					document.getElementById("acDiv").innerHTML = a;
					
					//x.innerHTML = a;
					//theTable.appendChild(x);
					
					//document.getElementById("acDiv").appendChild(theTable);	
					
				}
			}
		}	
	}


	sr = 'xmligero=1&procura=' + document.formproc.procura.value;

        http_request.open('POST', 'index.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
	}
	if(document.formproc.procura.value.length <= 2) {	
		document.getElementById("acDiv").style.display = 'none';
		acDiv.innerHTML="<table width='100px' height='40px'><tr bgcolor='white'><td><center><img src='pics/loading.gif'></td></tr></table>";
	}
}
function xmlchk(ad){
	makeXML();
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) {
			if (http_request.status == 200) {
				if(http_request.responseText == 0) { 
					aki.innerHTML= "<font color='white'><b>tudo ok , atleta liberado</b></font>";
					umk = 1;
				}		

				if(http_request.responseText == 1) aki.innerHTML= "<font color='red'><b>atleta existente , procure outro nome</b></font>";
			}
		}	
	};


	sr = 'chklg=1&login=' + ad;

        http_request.open('POST', 'upload.php', true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http_request.send(sr);
}

function mudaCor(elemento){
          elemento.className = (elemento.className=="cor_um")?"cor_dois":"cor_um";
}

function CheckAll() { 
	cont=0;
	for (var i=0;i<document.delform.elements.length;i++) {
		var x = document.delform.elements[i];
		if (x.type == 'checkbox') x.checked = document.delform.selall.checked;
	}
	if (cont == 0) cont = 1;
	else cont = 0;
} 

function chk(){
	if (ok==1) {
		alert('Aguarde. A sua solicitação está sendo processada.');
		return false;
	}
	else { ok = 1; return true; }
}

function show_txt(text){
	this.text = text;
	if(i<text.length){
		i++
 		window.status = text.substring(0,i)
	}
 	else clearTimeout(type_timer)
 	type_timer = setTimeout("show_txt(text)",15)
}

function hide_txt(){
	clearTimeout(type_timer)
	window.status=" "
	i=0
}

function changeOver(obj,color) { obj.style.backgroundColor=color; }

function showonline(){
		window.open('.?showonline=1','ShowOnline','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=300,height=290');
		
}

function showatleta(atleta){
	/*url = ".?showatleta=" + atleta;*/
	parent.location=atleta;
}
function shownew(){
		window.open('.?shownew=1','ShowNovo','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=600,height=500');
		
}
function mailto(n){
		alert("Contatos devem ser feitos através do email contato@quasemanobras.com");
		return -1;
		n = '.?mailto=' + n;
		window.open(n,'mailto','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=400,height=330');
}
function down(n){
		n = ".?down=" + n;
		window.open(n,'_blank','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=650,height=600');
}

function upload(){
//		alert("Apenas um grupo 'Celeto' de atletas. Aguarde a liberação =) ");
//		return -1;

		window.open('.?upload=1','Upload','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=950,height=410');
}
function showmail(v){
	if(v == "y") { 
		if(confirm('existe video novo no INBOX,ao abrir será descarregado para o servidor, isso leva um tempo, deseja prosseguir?')){
			window.open('.?showmail=1','Showmail','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=800,height=400');
		}
	}
	else {
			window.open('.?showmail=1','Showmail','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=800,height=400');
		}	

}
		
function novo(){
		alert("Apenas um grupo 'Celeto' de atletas. Aguarde a liberação =) ");
		return -1;
		window.open('.?novo=1','NovoVideo','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=465,height=358');
}
function showfotos(foto){
		url = "show.php?show=" + foto;
		window.open(url,'Showfoto','toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,status=no,resizable=0,width=680,height=550');
}
function SelectLink(optionn,pagina,pagmax) {
        if(optionn == "1") { window.location= "upload.php?mudar=" + document.upload.atleta.options[document.upload.atleta.selectedIndex].value; }
	else { window.location="upload.php?apenas=" + document.delform.apenas.options[document.delform.apenas.selectedIndex].value + "&pagina=" + pagina + "&pagmax=" + pagmax; }
}
function mudarmanobra(n,m) {
	text = "mudar nome da manobra:" + n + " para";
	nome=prompt(text,'');
	if(nome) window.location="upload.php?mudarmanobra=" + nome + "&mudararquivo=" + m;
}

// escrito por num sei quem , mas funciona e vlw ... open source total ... 
function getPageSize(){
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
	xScroll = document.body.scrollWidth;
	yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
	xScroll = document.body.scrollWidth;
	yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
	xScroll = document.body.offsetWidth;
	yScroll = document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
	windowWidth = self.innerWidth;
	windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
	windowWidth = document.documentElement.clientWidth;
	windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
	windowWidth = document.body.clientWidth;
	windowHeight = document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
	pageHeight = windowHeight;
	} else {
	pageHeight = yScroll;
	}
		// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
}
function bodyOverlay() {
	var objBody = document.getElementsByTagName('body').item(0);
	var sizesPage = getPageSize();
	var bodyOverlay = document.createElement("div");
	bodyOverlay.setAttribute('id','bodyOverlay');
	bodyOverlay.style.height = arrayPageSize[1] + 'px'; // fundo com o tamanho total da página.
	bodyOverlay.style.width = arrayPageSize[0] + 'px'; // fundo com o tamanho total da página.
	if (!document.getElementById('bodyOverlay')) {
		objBody.insertBefore(bodyOverlay, objBody.firstChild);
	}
}

function removerOverlay() {
	var bodyOverlay = document.getElementById('bodyOverlay');
	if (bodyOverlay) {
		bodyOverlay.parentNode.removeChild(bodyOverlay);
	}
}
function flash(arqflash,largura,altura) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + largura + '" height="' + altura + '">');
	document.write('<param name="movie" value="' + arqflash + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="' + arqflash + '" width="' + largura + '" height="' + altura + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
	document.write('</object>');
}

