OCULTO="none";
VISIBLE="block";
function mostrar(blo) {
  document.getElementById(blo).style.display=VISIBLE;
}
function validacion(){    
var accs=1;


	if (document.formup.idcategoria.value=="" & accs!=0){
		alert("Debes ingresar Genero.");
		document.formup.idcategoria.focus();  
		accs=0;
		}	
	if (document.formup.idcantante.value=="" & accs!=0){
		alert("Debes ingresar Cantante.");
		document.formup.idcantante.focus();  
		accs=0;
		}	
	if (document.formup.titulo.value=="" & accs!=0){
		alert("Debes ingresar Titulo.");
		document.formup.titulo.focus();  
		accs=0;
		}
	if (document.formup.repetido.value=="1" & accs!=0){
		alert("El titulo de esta cancion ya esta ingresada.");
		document.formup.titulo.focus();  
		accs=0;
		}
if (document.formup.cancion.value=="" & accs!=0){
		alert("Debes ingresar letra de la cancion.");
		document.formup.cancion.focus();  
		accs=0;
		}	

	if (accs==1) { document.formup.submit();}
	}
	
	
function validacionvideo(){    
var accs=1;


	if (document.formup.idcategoria.value=="" & accs!=0){
		alert("Debes ingresar Genero.");
		document.formup.idcategoria.focus();  
		accs=0;
		}	
	if (document.formup.idcantante.value=="" & accs!=0){
		alert("Debes ingresar Cantante.");
		document.formup.idcantante.focus();  
		accs=0;
		}	
	if (document.formup.titulo.value=="" & accs!=0){
		alert("Debes ingresar Titulo.");
		document.formup.titulo.focus();  
		accs=0;
		}
 
if (document.formup.video.value=="" & accs!=0){
		alert("Debes ingresar codigo del video youtube.");
		document.formup.video.focus();  
		accs=0;
		}	
if (document.formup.cancion.value!="" & document.formup.idcancion.value!=""){
		alert("La letra de cancion ya existe.");
		document.formup.video.focus();  
		accs=0;
		}	

	if (accs==1) { document.formup.submit();}
	}





function validacioncantante(){    
var accs=1;


	if (document.formup.cantante.value=="" & accs!=0){
		alert("Debes ingresar Grupo/cantante.");
		document.formup.cantante.focus();  
		accs=0;
		}	
	if (document.formup.repetido.value!="0" & accs!=0){
		alert("El cantante que intenta agregar ya se encuentra en nuestra base de datos.");
		document.formup.cantante.focus();  
		accs=0;
		}	
	if (document.formup.descripcion.value=="" & accs!=0){
		alert("Debes ingresar Biografia o informacion del cantante.");
		document.formup.descripcion.focus();  
		accs=0;
		}	
	if (document.formup.imagen1.value=="" & accs!=0){
		alert("Debes ingresar por lo menos la primer imagen.");
		document.formup.imagen1.focus();  
		accs=0;
		}
 

	if (accs==1) { document.formup.submit();}
	}


function validacionimagen(){    
var accs=1;


	if (document.formup.titulo.value=="" & accs!=0){
		alert("Debes ingresar Titulo de la imagen.");
		document.formup.titulo.focus();  
		accs=0;
		}	
	if (document.formup.descripcion.value=="" & accs!=0){
		alert("Debe ingresar una descripcion para la imagen.");
		document.formup.descripcion.focus();  
		accs=0;
		}	
	if (document.formup.imagen.value=="" & accs!=0){
		alert("Debes ingresar Imagen.");
		document.formup.imagen.focus();  
		accs=0;
		}	
	if (accs==1) { document.formup.submit();}
	}

	
function validacioncantantemod(){    
var accs=1;


	if (document.formup.cantante.value=="" & accs!=0){
		alert("Debes ingresar Grupo/cantante.");
		document.formup.cantante.focus();  
		accs=0;
		}	
	if (document.formup.repetido.value!="0" & accs!=0){
		alert("El cantante que intenta agregar ya se encuentra en nuestra base de datos.");
		document.formup.cantante.focus();  
		accs=0;
		}	
	if (document.formup.descripcion.value=="" & accs!=0){
		alert("Debes ingresar Biografia o informacion del cantante.");
		document.formup.descripcion.focus();  
		accs=0;
		}	
 
 

	if (accs==1) { document.formup.submit();}
	}



function ver_img(idcancion)
{
	 setTimeout("ver_img_show("+idcancion+",1)",800);
}
function ver_img_show(idcancion,numero)
{ 	numero=numero+1;
	if (numero!=4) {
	document.getElementById("img-"+idcancion+"").src ="/imagen_video/"+idcancion+"_"+numero+".jpg";
	setTimeout("ver_img_show("+idcancion+","+numero+")",800);
	} else { document.getElementById("img-"+idcancion+"").src ="/imagen_video/"+idcancion+"_1.jpg"; } 
}

function ver_img_menu(idcancion)
{
	 setTimeout("ver_img_show_menu("+idcancion+",1)",800);
}
function ver_img_show_menu(idcancion,numero)
{ 	numero=numero+1;
	if (numero!=4) {
	document.getElementById("img-menu-"+idcancion+"").src ="/imagen_video/"+idcancion+"_"+numero+".jpg";
	setTimeout("ver_img_show_menu("+idcancion+","+numero+")",800);
	} else { document.getElementById("img-menu-"+idcancion+"").src ="/imagen_video/"+idcancion+"_1.jpg"; } 
}
function eliminarcuenta() {
if(confirm("¿Realmente desea eliminar su cuenta?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/modificar-datos/?del=si&seid='+seid+'';
		}
	} 
} 


function eliminarcancion(idcancion) {
if(confirm("¿Realmente desea eliminar?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/mis-letras/?del=si&idcancion='+idcancion+'';
		}
	} 
}


function eliminarvideo(idvideo) {
if(confirm("¿Realmente desea eliminar?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/mis-videos/?del=si&idvideo='+idvideo+'';
		}
	} 
}

function eliminarcantante(idcantante) {
if(confirm("¿Realmente desea eliminar?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/mis-biografias/?del=si&idcantante='+idcantante+'';
		}
	} 
}



function eliminarvideo(idvideo) {
if(confirm("¿Realmente desea eliminar?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/mis-videos/?del=si&idvideo='+idvideo+'';
		}
	} 
}


function eliminarimagen(idenviadas) {
if(confirm("¿Realmente desea eliminar?")) {
	if(confirm("Confirmar")) { 
		document.location.href= '/mis-imagenes/?del=si&idenviadas='+idenviadas+'';
		}
	} 
}


function nuevoAjax()
{ 
    /* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
    lo que se puede copiar tal como esta aqui */
    var xmlhttp=false; 
    try 
    { 
        // Creacion del objeto AJAX para navegadores no IE
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
    }
    catch(e)
    { 
        try
        { 
            // Creacion del objet AJAX para IE 
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
        } 
        catch(E) { xmlhttp=false; }
    }
    if (!xmlhttp && typeof XMLHttpRequest!='undefined') { xmlhttp=new XMLHttpRequest(); } 

    return xmlhttp; 
}


function cargavotar(idvideo_activa)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxvotarvideo.php?idvideo_activa="+idvideo_activa+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
        if (ajax.readyState==1)  { document.getElementById("divotar").innerHTML="Cargando..." ;}
		if (ajax.readyState==4)
        { 
            document.getElementById("divotar").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}

function cargavotarcancion(idcancion_activa)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxvotarcancion.php?idcancion_activa="+idcancion_activa+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
        if (ajax.readyState==1)  { document.getElementById("divotar").innerHTML="Cargando..." ;}
		if (ajax.readyState==4)
        { 
            document.getElementById("divotar").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}



function cargavotarcantante(idcantante)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxvotarcantante.php?idcantante="+idcantante+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
        if (ajax.readyState==1)  { document.getElementById("divotar").innerHTML="Cargando..." ;}
		if (ajax.readyState==4)
        { 
            document.getElementById("divotar").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}

function cargavotarimagen(idenviadas)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxvotarimagen.php?idenviadas="+idenviadas+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
        if (ajax.readyState==1)  { document.getElementById("divotar").innerHTML="Cargando..." ;}
		if (ajax.readyState==4)
        { 
            document.getElementById("divotar").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}

function premiar(idusuario)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxpremiar.php?idusuario="+idusuario+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
        if (ajax.readyState==1)  { document.getElementById("divpuntos").innerHTML="Cargando..." ;}
		if (ajax.readyState==4)
        { 
            document.getElementById("divpuntos").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}
function comentario(id,pagina,tipo,idusuario)
{
    ajax=nuevoAjax();
   ajax.open("GET", "/ajaxcomentario.php?id="+id+"&pagina="+pagina+"&tipo="+tipo+"&idusuario="+idusuario+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
	        if (ajax.readyState==1)  { document.getElementById("divcomentario"+id+"").innerHTML='<br/><br/><div align="center">Cargando...</div><br/>' ;}

        if (ajax.readyState==4)
        { 
            document.getElementById("divcomentario"+id+"").innerHTML=ajax.responseText;
        } 
    }
	$("#divcomentario"+id+"").show("slow");
    ajax.send(null);  
	
}





function eliminarcomentario(idcomentario)
{
    ajax=nuevoAjax();
   ajax.open("GET", "/ajaxcomentariodel.php?idcomentario="+idcomentario+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
	        if (ajax.readyState==1)  { document.getElementById("divcomentario-"+idcomentario+"").innerHTML='<br/><br/><div align="center">Eliminando...</div><br/>' ;}

        if (ajax.readyState==4)
        { 
            document.getElementById("divcomentario-"+idcomentario+"").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);  
	
}

function cargacanciones(idcantante)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxscanciones.php?idcantante="+idcantante+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
	 if (ajax.readyState==1)
        {  document.getElementById("divcancion").innerHTML='Buscando...';
        } 
        if (ajax.readyState==4)
        { 
            document.getElementById("divcancion").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}
 
 function checktitulo(titulo, idcantante,idcancion)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxstitulo.php?idcantante="+idcantante+"&idcancion="+idcancion+"&titulo="+titulo+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
	 if (ajax.readyState==1)
        {  document.getElementById("divcheck").innerHTML='Buscando canciones repetidas...';
        } 
        if (ajax.readyState==4)
        { 
            document.getElementById("divcheck").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}

 function checkcantante(cantante,idcantante)
{
    ajax=nuevoAjax();
    ajax.open("GET", "/ajaxscantante.php?cantante="+cantante+"&idcantante="+idcantante+"&num_ale="+Math.random(), true);
    ajax.onreadystatechange=function() 
    { 
	 if (ajax.readyState==1)
        {  document.getElementById("divcheck").innerHTML='Buscando cantantes repetidos...';
        } 
        if (ajax.readyState==4)
        { 
            document.getElementById("divcheck").innerHTML=ajax.responseText;
        } 
    }
    ajax.send(null);       
}

 function slider(id)
{
var img;
var titulo;
var descripcion;
img= document.getElementById("imagen"+id+"").value;
titulo= document.getElementById("titulo"+id+"").value;
descripcion= document.getElementById("descripcion"+id+"").value;


document.getElementById("slider_titulo").innerHTML  =titulo;

document.getElementById("slider_descripcion").innerHTML=descripcion ;


   		

		
}

function ocultarcomentario(idcont){ $("#divcomentario"+idcont+"").hide("slow"); }


function radio(idradio) {
  new_window = window.open('/radio-escuchar.php?idradio='+idradio+'', 'popupw','toolbar=0,menubar=0,resizable=0,dependent=0,status=0,width=400,height=310,left=80,top=100,scrollbars=no');
  new_window.focus();}
  
function agregarletra()
  	{
		VISIBLE="block";
		  document.getElementById("divcancionagregar").style.display=VISIBLE;

	}