function objetoAjax(){
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;
}
function agregar(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url="http://www.guiamusica.com/";
var titulo=" Descripcion de mi sitio web";
window.external.AddFavorite(url,titulo);
}else{
if(navigator.appName == "Netscape")
window.sidebar.addPanel("GuiaMusica", "http://www.guiamusica.com/", "");
}
}
function inicio(objk,direccion){
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>3)){
objk.style.behavior="url(#default#homepage)";
objk.setHomePage(direccion);
}else{
alert("Su navegador no dispone de esta opción");
}
}
function pagina(pag){
window.open(pag,"iframe");
document.getElementById("iframe").src = pag;
}
function comprobar(){
var p = document.getElementById("iframe").src;
window.open("","_self");pagina(p);
}
function comprobar_tamano(){
var miIframe = document.getElementById("iframe");
if(miIframe.contentDocument){alturaPagina = miIframe.contentDocument.height;
}else{alturaPagina = miIframe.contentWindow.document.body.scrollHeight;}
miIframe.style.height = alturaPagina + "px";
}
//BUSQUEDA
function busqueda(id,boton){
var texto = frames["iframe"].document.getElementById("busqueda").value;
if(texto == "Busca tu musica..."){texto = "";}
document.getElementById("iframe").src = "nueva_resultados_canciones.php?texto="+encodeURIComponent(texto);
frames["iframe"].document.getElementById("busqueda").value = "";
comprobar_tamano();
}
//FUNCIONES VALIDACION Y UTILIDAD
function Abrir_ventana (pagina) {
x = (screen.width - 600) / 2;
y = (screen.height - 500) / 2;
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=600, height=500, top="+y+", left="+x+"";
window.open(pagina,"",opciones);
}
function stripslashes(str) {
str=str.replace(/\\'/g,'\'');
str=str.replace(/\\"/g,'"');
str=str.replace(/\\0/g,'\0');
str=str.replace(/\\\\/g,'\\');
return str;
}
function valEmail(valor){
re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/;
if(!re.exec(valor)){
return false;
}else{
return true;
}
}
function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57)){return false;}else{return true;}
}
function over(num){
frames["iframe"].document.getElementById(num+"_fila").style.backgroundColor = '#A47903';
}
function out(num){
frames["iframe"].document.getElementById(num+"_fila").style.backgroundColor = '';
if(frames["iframe"].document.getElementById(num).checked == true){
frames["iframe"].document.getElementById(num+"_fila").style.backgroundColor = 'LightBlue';
}
}
function resultados_over(id){
if(frames["iframe"].document.getElementById(id).className != "pestañapush"){
frames["iframe"].document.getElementById(id).className = "pestañaroll";
}
}
function resultados_out(id){
if(frames["iframe"].document.getElementById(id).className != "pestañapush"){
frames["iframe"].document.getElementById(id).className = "pestaña";
}
if(frames["iframe"].document.getElementById(id).className == "pestañaroll"){
frames["iframe"].document.getElementById(id).className = "pestaña";
}
}
function seleccionar(num){
check = frames["iframe"].document.getElementsByName("check[]");
for(i=0;i
deseleccionar todo';
frames["iframe"].document.getElementById("seleccionar_t").setAttribute("onclick","parent.deseleccionar_todo();");
can = frames["iframe"].document.getElementsByName("canciones[]");
for(i=0;i
seleccionar todo';
frames["iframe"].document.getElementById("seleccionar_t").setAttribute("onclick","parent.seleccionar_todo();");
can = frames["iframe"].document.getElementsByName("canciones[]");
for(i=0;i 0){document.getElementById("div_subir").style.display = "";
}else{document.getElementById("div_subir").style.display = "none";}
}else{
if(window.pageYOffset > 0){document.getElementById("div_subir").style.display = "";
}else{document.getElementById("div_subir").style.display = "none";}
}
}
//////////////// CARGAR LISTA
function gen(genero){
document.getElementById("lista_temporal").value = "Canal "+genero;
document.getElementById("nombre_de_lista").innerHTML = "Canal "+genero+"";
var can = new Number(document.getElementById("escuchando").value);
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_script.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
var c = ajax.responseText;
var cancion = c.split("|");
destruir();
var loc = stripslashes(cancion[1]);
if (navigator.appName == "Microsoft Internet Explorer"){
soundManager.onload = function(){play(cancion[0],loc,cancion[2],cancion[3]);}
play(cancion[0],loc,cancion[2],cancion[3]);
}else{
play(cancion[0],loc,cancion[2],cancion[3]);
}
document.getElementById("escuchando").value = 1;
document.getElementById("id_cancion_escuchando").value = cancion[0];
}
}
var variable = "sesion=e0bj3ea742t36eh1h3sm9ht3p7&escuchar_genero="+genero;
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(variable);
}
function escuchar_genero(genero){
document.getElementById("lista_temporal").value = "Canal "+genero;
document.getElementById("nombre_de_lista").innerHTML = "Canal "+genero+"";
var can = new Number(document.getElementById("escuchando").value);
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_script.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
var c = ajax.responseText;
var cancion = c.split("|");
destruir();
var loc = stripslashes(cancion[1]);
if (navigator.appName == "Microsoft Internet Explorer"){
soundManager.onload = function(){play(cancion[0],loc,cancion[2],cancion[3]);}
play(cancion[0],loc,cancion[2],cancion[3]);
}else{
play(cancion[0],loc,cancion[2],cancion[3]);
}
document.getElementById("escuchando").value = 1;
document.getElementById("id_cancion_escuchando").value = cancion[0];
}
}
var variable = "sesion=e0bj3ea742t36eh1h3sm9ht3p7&escuchar_genero="+genero;
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send(variable);
}
function ver_div(div){
no_ver_div();
var pagina = "";
var nlista = document.getElementById("lista").value;
if(div == "div_listas"){pagina = "nueva_listas_lista.php?sesion=e0bj3ea742t36eh1h3sm9ht3p7&lista="+nlista; }
if(div == "div_ayuda"){pagina = "nueva_ayuda.php";}
if(div == "div_condicionesuso"){pagina = "nueva_condiciones.php"; }
if(div == "div_privacidad"){pagina = "nueva_privacidad.php"; }
if(div == "div_contacto"){pagina = "nueva_contacto.php";}
if(div == "div_contra"){pagina = "nueva_login_contrasena.php";}
if(div == "div_registro"){pagina = "nueva_login_registro.php";}
if(div == "div_condiciones"){pagina = "nueva_login_aceptar_condiciones.php";}
if(div == "div_salir"){pagina = "nueva_login_salir.php";}
if(div == "div_enlaces"){pagina = "nueva_enlaces.php";}
if(div == "div_publicar"){pagina = "nueva_publicar.php";}
ajax=objetoAjax();
ajax.open("GET", pagina,true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_info").style.display = "";
document.getElementById("div_info").innerHTML = ajax.responseText;
if(div == "div_listas"){
var can = document.getElementById("nombre_canal").value.split("Canal ");
document.getElementById("canal").innerHTML = ''+document.getElementById("nombre_canal").value+"";
}
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajax.send(null);
}
function ver_publicar(id){
no_ver_div();
var pagina = "";
var nlista = document.getElementById("lista").value;
ajax=objetoAjax();
ajax.open("GET", "nueva_publicar.php?id_cancion="+id,true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_info").style.display = "";
document.getElementById("div_info").innerHTML = ajax.responseText;
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajax.send(null);
}
function no_ver_div(){
document.getElementById("div_opacidad").style.display = "none";
document.getElementById("div_info").style.display = "none";
document.getElementById("div_transparente").style.display = "none";
}
function usuario(u){
ajax=objetoAjax();
ajax.open("POST", "nueva_perfil.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_usuarios").style.display = "";
document.getElementById("div_usuarios").innerHTML = ajax.responseText;
}}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("usuario="+u);
}
function editar_artista(pagina){
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_editar").style.display = "";
window.open(pagina,"editar_discografia");
}
function salas(sala){
ajax=objetoAjax();
ajax.open("GET", "nueva_salas.php?sala="+sala,true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_info").style.display = "";
document.getElementById("div_info").innerHTML = ajax.responseText;
}}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("sala="+sala);
}
function eliminar_sala(id){
var ventana=confirm("¿Seguro que quieres Eliminar esta Sala?");
if (ventana){
ajax=objetoAjax();
ajax.open("POST", "nueva_salas.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
no_ver_div();
pagina("nueva_conciertos.php");
}
}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("id_borrar="+id);
}
}
function mapa(mapa){
ajaxx1=objetoAjax();
ajaxx1.open("POST", "nueva_salas_mapa.php",true);
ajaxx1.onreadystatechange=function(){
if (ajaxx1.readyState==4){
document.getElementById('div_opacidad2').setAttribute("onclick","nomapa();");
document.getElementById("div_opacidad2").style.display = "";
document.getElementById("div_mapa").style.display = "";
document.getElementById("div_mapa").innerHTML = ajaxx1.responseText;
}}
if (ajaxx1.overrideMimeType) { ajaxx1.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajaxx1.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajaxx1.send("mapa="+escape(mapa));
}
function nomapa(){
document.getElementById('div_opacidad2').setAttribute("onclick","no_ver_div();");
document.getElementById("div_opacidad2").style.display = "none";
document.getElementById("div_mapa").style.display = "none";
document.getElementById("div_mapa").innerHTML = "";
}
function abrir_valorados(div){
d = frames["iframe"].document.getElementsByName("div_fans");
for(i=0;iLista "+l+"";
document.getElementById('lista_temporal').value="Lista "+l;
}
function ver_album(artista,album){
pagina("nueva_artistas_album.php?album="+escape(album)+"&grupo="+escape(artista));
}
function lista_listas(){
var lista = document.getElementById("lista_temporal").value;
ajax=objetoAjax();
ajax.open("POST", "index.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_transparente").style.display = "";
document.getElementById("lista_de_listas").style.display = "";
document.getElementById("lista_de_listas").innerHTML = ajax.responseText;
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajax.send("lista_listas=lista_listas&lista="+lista+"&sesion=e0bj3ea742t36eh1h3sm9ht3p7");
}
//crear lista reproduccion
function lista_reproduccion(pagina){
no_ver_div();
ajax=objetoAjax();
ajax.open("GET", pagina,true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("lista_reproduccion").style.display = "";
document.getElementById("lista_reproduccion").innerHTML = ajax.responseText;
}
if (ajax.readyState<4){
document.getElementById("lista_reproduccion").style.display = "";
document.getElementById("lista_reproduccion").innerHTML = "Cargando Lista
";
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajax.send(null);
}
function crear_lista(lista){
no_ver_div();
ajax=objetoAjax();
ajax.open("GET", "nueva_listas_crear.php?lista="+lista,true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
if(ajax.responseText == ""){
login();
}else{
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_info").style.display = "";
document.getElementById("div_info").innerHTML = ajax.responseText;
}
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
ajax.send(null);
}
function crear_lista_usuario(lista_antigua){
var lista = document.getElementById("nombre_lista").value;
document.getElementById("error_nombre").innerHTML = "";
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_crear.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
alert("Ya esta creada tu lista");
no_ver_div();
pagina("nueva_listas.php?sesion=e0bj3ea742t36eh1h3sm9ht3p7&lista="+ajax.responseText);
}}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("nombre_lista="+lista+"&lista_antigua="+lista_antigua);
}
//borrar lista
function borrar_lista(lista){
if(confirm("¿Estas seguro que quieres borrar esta Lista?")){
ajax=objetoAjax();
ajax.open("POST", "nueva_listas.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
lista_listas();
pagina("nueva_listas.php?sesion=e0bj3ea742t36eh1h3sm9ht3p7");
}}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("borrar="+lista);
}
}
//nombre de lista
function nombre_lista(lista,num){
if(document.getElementById("nuevo_nombre_lista"+num).style.display == ""){
var n = document.getElementsByName("nombres_listas");
for(var i=0;iLista "+res[1]+"";
}
}}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("nombre_nuevo_lista="+escape(lista)+"&usuario=");
}
////////////////REPRODUCTOR
//escuchar canciones
function escuchar_cancion(ids,lista,numero){
document.getElementById("lista").value = lista;
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_script.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
c = ajax.responseText;
cancion = c.split("|");
destruir();
loc = stripslashes(cancion[1]);
play(cancion[0],loc,cancion[2],cancion[3]);
document.getElementById("escuchando").value = numero;
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("play_cancion=play_cancion&sesion=e0bj3ea742t36eh1h3sm9ht3p7&ids="+ids+"&lista="+lista+"&cancion="+numero);
}
function escuchar_cancion_anadir(ids){
var orden = document.getElementById("numero_orden").innerHTML;
var lista = "lista_temporal_e0bj3ea742t36eh1h3sm9ht3p7";
document.getElementById("lista_temporal").value = "Lista Temporal";
parent.document.getElementById("nombre_de_lista").innerHTML = "Lista Temporal";
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_script.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
c = ajax.responseText;
cancion = c.split("|");
destruir();
loc = stripslashes(cancion[1]);
play(cancion[0],loc,cancion[2],cancion[3]);
document.getElementById("escuchando").value = cancion[0];
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("escuchar_anadir=escuchar_anadir&sesion=e0bj3ea742t36eh1h3sm9ht3p7&ids="+ids+"&lista="+lista+"&orden="+orden);
}
//añadir ids,seleccion,todo a temporal
function anadir_canciones(ids){
if(ids == ""){
check = frames["iframe"].document.getElementsByName("canciones[]");ids = "";
for(i=0;iLista Temporal";
}
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_script.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
numero = ajax.responseText;
if(numero == 500){
alert("Has llegado al limite de 500 canciones, se Agregaran las primeras 500 canciones.\nPara escuchar mas canciones crea una lista nueva o borrar canciones de esta lista");
}else{
alert("Canciones añadidas a la Lista Temporal");
}
}
}
if (ajax.overrideMimeType) { ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("anadir_temporal=anadir_temporal&lista="+lista+"&ids="+ids);
}
//añadir ids,seleccion,todo a lista personalizada
function anadir_a_lista(ids){
ajax=objetoAjax();
ajax.open("POST", "nueva_listas_anadir.php",true);
ajax.onreadystatechange=function(){
if (ajax.readyState==4){
document.getElementById("div_info").innerHTML = "";
document.getElementById("div_info").style.display = "";
document.getElementById("div_opacidad").style.display = "";
document.getElementById("div_info").innerHTML = ajax.responseText;
}
}
if (ajax.overrideMimeType){ ajax.overrideMimeType('text/xml; charset=iso-8859-1'); }
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("ids="+ids);
}
function anadir_canciones_a_lista(ids){
if(ids == ""){
check = frames["iframe"].document.getElementsByName("canciones[]");ids = "";
for(i=0;i 25){
document.getElementById("error_usuario").innerHTML = "Usuario de 5 a 25 caracteres";
}else{document.getElementById("error_usuario").innerHTML = "";}
}
var contrasenia = document.getElementById('contrasenia_reg').value;
if(contrasenia == ""){
document.getElementById("error_contrasena").innerHTML = "Contraseña vacia";
}else{
if(contrasenia.length < 4 || contrasenia.length > 8){
document.getElementById("error_contrasena").innerHTML = "Contraseña de 4 a 8 caracteres";
}else{document.getElementById("error_contrasena").innerHTML = "";}
}
var repcon = document.getElementById('repcon').value;
if(repcon == ""){
document.getElementById("error_rep_contrasena").innerHTML = "Repetir contraseña vacia";
}else{
if(contrasenia != repcon){
document.getElementById("error_rep_contrasena").innerHTML = "Contraseña incorrecta";
}else{document.getElementById("error_rep_contrasena").innerHTML = "";}
}
var email = document.getElementById('e_mail').value;
if(email == ""){
document.getElementById("error_email").innerHTML = "E-mail vacio";
}else{
if(!valEmail(email)){
document.getElementById("error_email").innerHTML = "E-mail Incorrecto";
}else{document.getElementById("error_email").innerHTML = "";}
}
var nombre = document.getElementById('nombre').value;
if(nombre == ""){
document.getElementById("error_nombre_apellidos").innerHTML = "Nombre Vacio";
}else{document.getElementById("error_nombre_apellidos").innerHTML = "";}
var apellidos = document.getElementById('apellidos').value;
if(apellidos == ""){
document.getElementById("error_nombre_apellidos").innerHTML = "Apellidos Vacio";
}else{document.getElementById("error_nombre_apellidos").innerHTML = "";}
var dia = document.getElementById('dia').value;
if(dia == "Dia"){
document.getElementById("error_fecha").innerHTML = "Elige un Dia";
}
var mes = document.getElementById('mes').value;
if(mes == "Mes"){
document.getElementById("error_fecha").innerHTML = "Elige un Mes";
}
var ano = document.getElementById('ano').value;
if(ano == "Año"){
document.getElementById("error_fecha").innerHTML = "Elige un Año";
}
if(dia != "Dia" && mes != "Mes" && ano != "Año"){
document.getElementById("error_fecha").innerHTML = "";
}
var sexo = document.getElementsByName('sexo');
marcado = false;
for(i=0;i