function aboft(){ var xmlhttp=false;try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");}catch(e){ try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }catch(E){xmlhttp = false;}} if(!xmlhttp && typeof XMLHttpRequest!='undefined'){xmlhttp = new XMLHttpRequest();} return xmlhttp;} // -----pops------ \\ function abrir(pagina,largura,altura,top,left) { w = screen.width; h = screen.height; meio_w = w/2; meio_h = h/2; altura2 = altura/2; largura2 = largura/2; meio1 = meio_h-altura2; meio2 = meio_w-largura2; window.open(pagina,'','height=' + altura + ', width=' + largura + ', scroll = yes, top=' + meio1 + ', left=' + meio2 + ''); } function play_yt(id_video,width,height,acao) { document.write(''); } ///////////////////MAIS MENOS///////////////////////// function md(a) { admais = document.getElementById("mais"); admenos = document.getElementById("menos"); addd = document.getElementById("mais_det"); if((a == "mais") && (document.getElementById("mais"))){ addd.style.display = "inline"; admais.style.display = "none"; admenos.style.display = "inline"; } if((a == "menos") && (document.getElementById("menos"))){ addd.style.display = "none"; admenos.style.display = "none"; admais.style.display = "inline"; } } function buscaFoto(image,comp,alt,by,apelido){// get galeria de fotos if(by != ''){ var aux_by = '

Enviada por: '+apelido+'

'; }else{ var aux_by = ''; } document.getElementById('ress').innerHTML = 'foto
Foto divulgação'+aux_by+''; } function acao_display(id,alt,type,bloco){ if(type!=3){ olpop = document.getElementById("pop" + id);} oc = document.getElementById(bloco+id); if(alt==1){ if(type!=3) {olpop.style.display="none";} else{oc.style.display="block"; } }else{if(type!=3){olpop.style.display="block"; }else{oc.style.display="none";} }} function limp(obj){ document.getElementById(obj).style.display = "none"; } function opacity(id, opacStart, opacEnd) { var speed = Math.round(1500 / 180); var timer = 0; if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } }else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function search_video(tipo){ var h_s = document.getElementById('h_search'); var bt_s = document.getElementById('bt-video'); var querybusca = document.getElementById('q').value; document.getElementById('resultadoSug').style.display='none'; if(tipo=='v'){ bt_s.innerHTML = "Buscar Cifras e Tabs"; h_s.innerHTML = "
"; }else{ bt_s.innerHTML = "Buscar Vídeos Clipes"; h_s.innerHTML = "
"; } } function ss(t){window.status=t;return true;} function recomendar(tipo,titulo,codigo,obj,url,cod_usu){ var conteudo, url, metho, cod_usu; conteudo = document.getElementById(obj); conteudo.style.display='block'; cod_usu = readCookie("cod_usuario_log"); ajax_re=aboft(); conteudo.innerHTML="
\"\" Carregando...
"; ajax_re.open('GET', '/ajax/usuario_recomendar.php?tipo='+tipo+'&titulo='+titulo+'&codigo='+codigo+'&obj='+obj+'&url='+url+'&cod_usu='+cod_usu+'', true); ajax_re.setRequestHeader("Cache-Control", "no-cache"); ajax_re.setRequestHeader("Pragma", "no-cache"); ajax_re.setRequestHeader("Charset", "ISO-8859-1"); ajax_re.onreadystatechange=function(){ if(ajax_re.readyState==1){ //opacity(''+obj+'', 0, 100); }else if(ajax_re.readyState==4){ if(ajax_re.status==200){ conteudo.innerHTML = ajax_re.responseText; }else if(ajax_re.status==404){ conteudo.innerHTML = "Página não encontrada"; }else{ conteudo.innerHTML = "Error:".ajax_re.status; } } } ajax_re.send(null); } function submitRecomentaArt(field,obj){ var loader = document.getElementById("loaderRecomendar"); var resposta = document.getElementById(obj); var sep_email; ajax_sre=aboft(); var IE = document.all?true:false; if(!IE){ metho = 'GET'; }else{ metho = 'POST'; } ajax_sre.open(''+metho+'', '/ajax/usuario_recomendar_submet.php?'+field, true); loader.style.display="block"; loader.innerHTML="
Enviando \"\"
"; ajax_sre.setRequestHeader("Cache-Control", "no-cache"); ajax_sre.setRequestHeader("Pragma", "no-cache"); ajax_sre.setRequestHeader("Charset", "ISO-8859-1"); ajax_sre.onreadystatechange=function(){ if(ajax_sre.readyState==1){ }else if(ajax_sre.readyState==4){ if(ajax_sre.status==200){ loader.innerHTML = ajax_sre.responseText; if(loader.innerHTML==1){ var emails = document.getElementById('email_amigos').value; var arrayEmails = emails.split(/\s*,\s*/); sep_email = ""; for(i=0; i < arrayEmails.length; i++){ sep_email += arrayEmails[i]+"
"; } resposta.innerHTML='

'+document.getElementById('tituloRecomenda').value+' enviado para:
'+sep_email+'
'; //setTimeout("opacity('box-recomendar-art', 100, 0)", 5000); setTimeout("document.getElementById('"+obj+"').style.display='none'", 6000); }else{ setTimeout("document.getElementById(\"loaderRecomendar\").style.display='none'", 5000); } }else if(ajax_sre.status==404){ conteudo.innerHTML = "Página não encontrada"; }else{ conteudo.innerHTML = "Error:".ajax_sre.status; } } } ajax_sre.send(null); } function setFieldRecondeArt() { field = "&comentario_recomendar="+encodeURI(document.getElementById('comentario_recomendar').value)+"&email_amigos="+encodeURI(document.getElementById('email_amigos').value)+"&seu_nome_recomendar="+encodeURI(document.getElementById('seu_nome_recomendar').value)+"&seu_email_recomendar="+encodeURI(document.getElementById('seu_email_recomendar').value)+"&tituloRecomenda="+encodeURI(document.getElementById('tituloRecomenda').value)+"&tipo="+encodeURI(document.getElementById('tipo').value)+"&url="+encodeURI(document.getElementById('url').value)+"&codigo="+encodeURI(document.getElementById('codigo').value); } function fa(cod_artista,artista,cod_usuario){ var conteudo, url, cod_usuario; conteudo = document.getElementById('box-result-fa'); cod_usuario = readCookie("cod_usuario_log"); if(cod_usuario!=''){ conteudo.style.display='block'; ajax_fa=aboft(); conteudo.innerHTML="
\"\" Adicionando...
"; ajax_fa.open('GET', '/ajax/usuario_sou_fa.php?cod_artista='+cod_artista+'&artista='+artista+'&cod_usuario='+cod_usuario, true); ajax_fa.setRequestHeader("Cache-Control", "no-cache"); ajax_fa.setRequestHeader("Pragma", "no-cache"); ajax_fa.setRequestHeader("Charset", "ISO-8859-1"); ajax_fa.onreadystatechange=function(){ if(ajax_fa.readyState==1){ //opacity('box-result-fa', 0, 100); }else if(ajax_fa.readyState==4){ if(ajax_fa.status==200){ conteudo.innerHTML = ajax_fa.responseText; //setTimeout("opacity('box-result-fa', 100, 0)", 4000); setTimeout("document.getElementById('box-result-fa').style.display='none'", 5000); }else if(ajax_fa.status==404){ conteudo.innerHTML = "Página não encontrada"; }else{ conteudo.innerHTML = "Error:".ajax_fa.status; } } } ajax_fa.send(null); }else{ alert('Para inserir artistas a sua lista de fãs, é necessário que estar logado no site.'); } } /**********************LOGIN*********************/ function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name){ var cookieValue = ""; var search = name + "="; if(document.cookie.length > 0){ offset = document.cookie.indexOf(search); if (offset != -1){ offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) } } return cookieValue; } function openMenuLogin(){ var men, d; d = document.getElementById('print-munu-usuario'); cod_usuario = readCookie("cod_usuario_log"); men = ""; if( cod_usuario != "" ){ men +='

Minha página

'; men +=''; d.innerHTML = men; } } function openLogin(){ var cod_usuario, login_membro; d = document; cod_usuario = readCookie("cod_usuario_log"); login_membro = readCookie("login"); if( cod_usuario != "" ){ d.write('
'); d.write('
'); d.write('Olá, '+login_membro+''); d.write(''); d.write('
'); d.write('
'); }else{ d.write('
'); d.write('
'); d.write('
'); d.write(''); d.write(''); d.write(''); d.write(''); d.write(''); d.write('
'); d.write('
'); d.write('
'); } } function setLogin(field){ var metho; ajax=aboft(); var cod_usuario = readCookie("cod_usuario_log"); var IE = document.all?true:false; if(!IE){ metho = 'GET'; }else{ metho = 'POST'; } ajax.open(metho, '/ajax/login.php?'+field+'&cod_usuario='+cod_usuario,true); var obj = document.getElementById('boxLogin'); var pre = document.getElementById('objBotao'); ajax.onreadystatechange=function(){ if(ajax.readyState==1){ pre.innerHTML= ''; }else if(ajax.readyState==4){ if(ajax.status==200){ obj.innerHTML = ajax.responseText; t = obj.innerHTML; if(t!=1){ openMenuLogin(); } var url = window.location.href; if(t==1){ window.location.href='http://www.pegacifras.com.br/login.php?action='+url+'&erro=sim'; obj.innerHTML = '
'; } } else if(ajax.status==404){ obj.innerHTML = "Página no encontrada"; } else { obj.innerHTML = "Error:".ajax.status; } } } ajax.send(null); } function setFieldLogin() { field = "&acao="+encodeURI(document.getElementById('enviar_usu').value)+"&email="+encodeURI(document.getElementById('email_usu').value)+"&senha="+encodeURI(document.getElementById('senha_usu').value); } ////// Suggest \\\\\\ var idLine = 0; function ajaxSugestao(q , acao, e) { var tecla = (window.event)?event.keyCode:e.which; var conteudo, preloader, aux; conteudo = document.getElementById('resultadoSug'); preloader = document.getElementById('preloaderSug') var value_query = document.getElementById("q").value; var query = document.getElementById("q"); query.setAttribute("autocomplete", "off"); if(tecla == 27) { conteudo.innerHTML=''; conteudo.style.display='none'; } if (tecla ==40 || tecla ==38 || tecla ==13) { checarLista(tecla); } if ( tecla != 27 && tecla != 13 && tecla < 38 || tecla > 40 ) { if ( acao == 'art' && q.length > 0 ) { ajax=aboft(); ajax.open('GET', '/ajax/sugestao-artistas.php?q='+ escape(q), true); //ajax.setRequestHeader("Cache-Control", "no-cache"); //ajax.setRequestHeader("Pragma", "no-cache"); //ajax.setRequestHeader("Charset", "ISO-8859-1"); ajax.onreadystatechange = function() { if(ajax.readyState==1) { idLine = 0; preloader.style.display='block'; preloader.innerHTML = ''; } else if (ajax.readyState==4) { if (ajax.status==200) { conteudo.innerHTML = ajax.responseText; var arrayArtista = (ajax.responseText); var listaArtistas = arrayArtista.split('|'); preloader.style.display='none'; //Limpa if ( conteudo.innerHTML == 1) { conteudo.style.display='none'; } else { conteudo.style.display='block'; } sep_lista = ""; sep_lista += '

Sugestões

[Fechar]

'; conteudo.innerHTML = sep_lista; } else if (ajax.status==404) { conteudo.innerHTML = "Página não encontrada"; } else { conteudo.innerHTML = "Error:".ajax.status; } } } ajax.send(null); } else {//fecha if acao conteudo.style.display='none'; } } } function habilitaSugestao(acao){ var conteudo = document.getElementById('resultadoSug'); if(acao != 'art'){ conteudo.style.display = 'none'; } } function strip_tags(v) { if ( v ) { var re=/<\S[^>]*>/g; v = v.replace(re,""); return v; } } function negril(texto, tprocura) { v=strip_tags(tprocura); v=tprocura.split(' '); for(n in v) { pos=texto.toLowerCase().indexOf(v[n].toLowerCase()); if (pos != -1 && v[n].length > 0) { t=texto.substring(0,pos); t+=''+texto.substring(pos,pos+v[n].length)+''; texto=t+texto.substring(pos+v[n].length); } } return texto; } function doc (id) { return document.getElementById ( id ); } //Altera o valor da pesquisa function setarEscolha ( text ) { doc('q').value = strip_tags(text); } //Controlador de índice function checarLista(kCode) { total_li = doc('resultadoSug').getElementsByTagName('li').length; texto = ''; liSelect = ''; switch ( kCode) { case 38 : { idLine--; if ( idLine >= 1 ) { if (idLine < total_li) doc("valueLineSug"+( idLine + 1) ).className=''; doc("valueLineSug"+idLine).className='hovSugest'; texto = doc("valueLineSug" + idLine).innerHTML; setarEscolha(texto); } else { idLine = total_li; doc("valueLineSug" + 1 ).className=''; doc("valueLineSug" + idLine).className='hovSugest'; texto = doc("valueLineSug" + idLine).innerHTML; setarEscolha(texto); } break; } case 40 : { idLine++; if (idLine <= total_li) { if (idLine >1 ) doc("valueLineSug"+( idLine - 1) ).className=''; doc("valueLineSug" + idLine).className='hovSugest'; texto = doc("valueLineSug" + idLine).innerHTML; setarEscolha(texto); } else { idLine = 1; document.getElementById("valueLineSug"+total_li).className = ''; document.getElementById("valueLineSug"+idLine).className='hovSugest'; texto = doc("valueLineSug" + idLine).innerHTML; setarEscolha(texto); } break; } case 13 : { if(idLine != '') { var line = document.getElementById("valueLineSug"+idLine); var valor = line.getAttribute('href'); document.location.href = valor; doc('resultadoSug').style.display = 'none'; } break; } } } String.prototype.formatarAcento = function(){var A=this.toLowerCase();A=A.replace(/[áàâãäÁÀÂÃÄ]/g,"a").replace(/[éèêëÉÈÊË]/g,"e").replace(/[íìîïÍÌÎÏ]/g,"i").replace(/[óòôõöÓÒÔÕÖ]/g,"o").replace(/[úùûüÚÙÛÜ]/g,"u").replace(/[çÇ]/g,"c").replace(/[ñÑ]/g,"n").replace(/ /g,"-").replace(/['"`´.]/g,"");return A};