function busca(end){
	window.location = end+'busca/'+document.getElementById('bus').value+'/';
}

function aba_man(cod){
	if(document.getElementById('det0')){
		document.getElementById('det0').style.display = 'none';
		document.getElementById('com0').style.display = 'none';
		document.getElementById('aba0').className = 'aba_vol';
	}
	if(document.getElementById('det1')){
		document.getElementById('det1').style.display = 'none';
		document.getElementById('com1').style.display = 'none';
		document.getElementById('aba1').className = 'aba_vol';
	}
	if(document.getElementById('det2')){
		document.getElementById('det2').style.display = 'none';
		document.getElementById('com2').style.display = 'none';
		document.getElementById('aba2').className = 'aba_vol';
	}
	if(document.getElementById('det3')){
		document.getElementById('det3').style.display = 'none';
		document.getElementById('com3').style.display = 'none';
		document.getElementById('aba3').className = 'aba_vol';
	}
	document.getElementById('aba'+cod).className = 'aba_vol_ati';
	document.getElementById('det'+cod).style.display = 'inherit';
	document.getElementById('com'+cod).style.display = 'inherit';
}



$(document).ready(function(){
	if(navigator.appVersion.length > 80){le = -70; to = 5;}
	else{ le = -16; to = 0;}

	$("#top-animes1").bubbletip($('#bubble-top-animes1'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
	$("#top-animes2").bubbletip($('#bubble-top-animes2'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
	$("#top-animes3").bubbletip($('#bubble-top-animes3'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
	$("#top-animes4").bubbletip($('#bubble-top-animes4'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
	$("#top-animes5").bubbletip($('#bubble-top-animes5'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
	$("#top-animes6").bubbletip($('#bubble-top-animes6'),{
		deltaDirection:'left',
		offsetTop: to,
		offsetLeft: le,
		animationDuration:100,
		delayHide:100
	});
});

var curvyCornersNoAutoScan = true;
				function aba(cod,tipo,idi, auxi,ex){
				if(document.getElementById('cont_leg_fansub'+cod)){
					document.getElementById('lista_leg_fansub'+cod).style.display = 'none';
					document.getElementById('cont_leg_fansub'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_leg_mp4'+cod)){
					document.getElementById('lista_leg_mp4'+cod).style.display = 'none';
					document.getElementById('cont_leg_mp4'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_leg_on'+cod)){
					document.getElementById('lista_leg_on'+cod).style.display = 'none';
					document.getElementById('cont_leg_on'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_leg_rmvb'+cod)){
					document.getElementById('lista_leg_rmvb'+cod).style.display = 'none';
					document.getElementById('cont_leg_rmvb'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_dub_fansub'+cod)){
					document.getElementById('lista_dub_fansub'+cod).style.display = 'none';
					document.getElementById('cont_dub_fansub'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_dub_mp4'+cod)){
					document.getElementById('lista_dub_mp4'+cod).style.display = 'none';
					document.getElementById('cont_dub_mp4'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_dub_on'+cod)){
					document.getElementById('lista_dub_on'+cod).style.display = 'none';
					document.getElementById('cont_dub_on'+cod).style.display = 'none';
				}
				if(document.getElementById('cont_dub_rmvb'+cod)){
					document.getElementById('lista_dub_rmvb'+cod).style.display = 'none';
					document.getElementById('cont_dub_rmvb'+cod).style.display = 'none';
				}
				if(document.getElementById('idi_fansub'+cod)){
					document.getElementById('idi_fansub'+cod).style.display = 'none';
				}
				if(document.getElementById('idi_mp4'+cod)){
					document.getElementById('idi_mp4'+cod).style.display = 'none';
				}
				if(document.getElementById('idi_on'+cod)){
					document.getElementById('idi_on'+cod).style.display = 'none';
				}
				if(document.getElementById('idi_rmvb'+cod)){
					document.getElementById('idi_rmvb'+cod).style.display = 'none';
				}

			if((document.getElementById(tipo+cod).className == 'sel'+ex) && (auxi == 1)){
				document.getElementById(tipo+cod).className = tipo+ex;
				document.getElementById('links'+cod).style.display = 'none';
				document.getElementById('info'+cod).style.display = 'none';
			}else{//esta clicando em outro e nao fechando
				document.getElementById('links'+cod).style.display = '';
				document.getElementById('info'+cod).style.display = '';
				document.getElementById('cont_'+idi+'_'+tipo+cod).style.display = '';
				document.getElementById('lista_'+idi+'_'+tipo+cod).style.display = '';
				document.getElementById('idi_'+tipo+cod).style.display = '';
				
				//muda class do selecionado
				if(document.getElementById('fansub'+cod))
					{document.getElementById('fansub'+cod).className = 'fansub'+ex;}
				if(document.getElementById('mp4'+cod))
					{document.getElementById('mp4'+cod).className = 'mp4'+ex;}
				if(document.getElementById('on'+cod))
					{document.getElementById('on'+cod).className = 'on'+ex;}
				if(document.getElementById('rmvb'+cod))
					{document.getElementById('rmvb'+cod).className = 'rmvb'+ex;}
				document.getElementById(tipo+cod).className = 'sel'+ex;
			}
		}
function sel_bus(obj){
	if(obj.className == 'caixa_busca_a'){
		obj.className = 'caixa_busca';
		obj.value = '';
	}
	else if(obj.value == ''){
		obj.className = 'caixa_busca_a';
		obj.value = 'Busque Aqui';
	}
}

function letra(id, div, end) {
	ajaxHTML(div,end+'letras_mostra.php?id='+id);
}

function comen_cad(num){
	window.open('comen_cad.php?news='+num,'Comentários','width=352,height=380,scrolling=auto,top=0,left=0')
}
function comen_ler(num){
	window.open('comen_ler.php?news='+num,'Comentários','width=370,height=380,scrolling=auto,top=0,left=0,scrollbars=yes')
}

function bloquear_ip(ip,s){
	if(s == 'S'){ sta = 'Bloquear';}
	else{ sta = 'Desbloquear';}
	if(confirm('Deseja Realmente '+sta+' o IP '+ip+'?')){
		ajax('com_bloquear.php?ip='+ip+'&s='+s);
		alert('IP '+sta+' com Sucesso!');
		history.go(0);
	}
}
					
function marcar_lido(id,t){
	if(confirm('Deseja Realmente marcar este contato como lido?')){
		//link em ajax para pagina de exclusao
		ajax('contato_status.php?id='+id+'&t='+t);
		alert('Marcado com Sucesso!!');
		history.go(0);
	}
}					
					
function move_i(what) { what.style.background='#DCDCDC';}
function move_o(what) { what.style.background='#FFFFFF';}
function red(lin){ window.location = lin;}



//FUNCOES AJAX
try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}
fila=[];
ifila=0;

function ajax(url) //apenas executa uma pagina sem mostrar
{
	req = null;
	if (window.XMLHttpRequest) {
		req = new XMLHttpRequest();
		req.open("GET",url,true);
		req.send(null);
	} else if (window.ActiveXObject) {
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if (req) {
			req.open("GET",url,true);
			req.send();
		}
	}
}

function ajaxHTML(id,url){ //mostra a mensagem de carregando enquanto a pagina é carregada
    //Carregando...
    document.getElementById(id).innerHTML="Carregando...."
    
    //Adiciona à fila
    fila[fila.length]=[id,url]
    //Se não há conexões pendentes, executa
    if((ifila+1)==fila.length)ajaxRun()
}

function ajaxHTML2(id,url){ // nao mostra a mensagem de carregando enquanto a pagina é carregada
    document.getElementById(id).innerHTML=""
    
    //Adiciona à fila
    fila[fila.length]=[id,url]
    //Se não há conexões pendentes, executa
    if((ifila+1)==fila.length)ajaxRun()
}

function ajaxHTML3(id,url){ // nao apaga o conteudo da div p/ carregar
    
    //Adiciona à fila
    fila[fila.length]=[id,url]
    //Se não há conexões pendentes, executa
    if((ifila+1)==fila.length)ajaxRun3()
}

function ajaxHTML3(id,url){ // só apaga o conteudo quando terminar de carregar
    
    //Adiciona à fila
    fila[fila.length]=[id,url]
    //Se não há conexões pendentes, executa
    if((ifila+1)==fila.length)ajaxRun3()
}

function ajaxRun(){
    //Abre a conexão
    xmlhttp.open("GET",fila[ifila][1],true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra o HTML recebido
            retorno=unescape(xmlhttp.responseText.replace())
            document.getElementById(fila[ifila][0]).innerHTML= retorno
            //Roda o próximo
            ifila++
            if(ifila<fila.length)setTimeout("ajaxRun()",20)
        }
    }
    //Executa
    xmlhttp.send(null)
}

function ajaxRun3(){
    //Abre a conexão
    xmlhttp.open("GET",fila[ifila][1],true);
    //Função para tratamento do retorno
    xmlhttp.onreadystatechange=function() {
        if (xmlhttp.readyState==4){
            //Mostra o HTML recebido
            retorno=unescape(xmlhttp.responseText.replace())
            document.getElementById(fila[ifila][0]).innerHTML= document.getElementById(fila[ifila][0]).innerHTML + retorno
            //Roda o próximo
            ifila++
            if(ifila<fila.length)setTimeout("ajaxRun3()",20)
        }
    }
    //Executa
    xmlhttp.send(null)
}