function sh(id,act){
	div=eval('document.getElementById(\''+id+'\')');
	if(act=='h'){
		div.style.display='none';
	}
	else{
		div.style.display='block';
	}
}

function alerts(){
	sh('alerts','s');
	if(timeout){
		clearTimeout(timeout);
	}
	var timeout=setTimeout("sh('alerts','h')",5000);
}

function tabRank(tab,cid){
	document.getElementById('rank').style.background='url(../images/loading.gif) center no-repeat';
	document.getElementById('rank').innerHTML='';
	if(tab=='t1'){
		document.getElementById('t1').className='tab_selected';
		document.getElementById('t2').className='tab_unselected';
		hiframe.location.href='rank.php?cid='+cid+'&muestra=visitas&tipo=N';
	}
	else if(tab=='t2'){
		document.getElementById('t2').className='tab_selected';
		document.getElementById('t1').className='tab_unselected';
		hiframe.location.href='rank.php?cid='+cid+'&muestra=destacado&tipo=N';
	}
}

function compruebaDisponibilidad(campo){
		if (campo.form.usuario.value!=''){
			document.getElementById('check_username').innerHTML='Comprobando disponibilidad...';
			hiframe.location.href='disponibilidad.php?usuario='+campo.form.usuario.value;
		}
}

function recargaCapcha(photo){
   var img=document.getElementById(photo);
   img.src="";
   img.src="capcha.php?"+Date();
}

function pup(act,id,w,h,scrollbar){
	t=((screen.height-h)-((screen.height-h)/2));
	l=((screen.width-w)-((screen.width-w)/2));
	window.open(act+'.php?id='+id+'','YPup','toolbar=0,scrollbars='+scrollbar+',location=0,statusbar=0,menubar=0,resizable=0,width='+w+',height='+h+',top='+t+',left='+l+'');
}

var num=0;
function recomendadas(direc){
	if(direc=='next'){
		num++;
		if(num>(rec_total-1)){
			num=0;
		}
	}
	else{
		num--;
		if(num<0){
			num=(rec_total-1);
		}
	}
	document.getElementById('rep_content').style.background='url(../images/loading.gif) center no-repeat';
	document.getElementById('rep_content').innerHTML='';
	hiframe.location.href='recomendadas.php?d='+num;
}

function borrarEntrada(id){
temp=window.confirm('ATENCION!\nRealmente quieres borrar esta entrada?\nEsta accion no puede deshacerse.');
if(temp){window.location.href='borrar_entrada.php?id='+id+'';}
else{return false;}
}

function borrarGaleria(id){
temp=window.confirm('ATENCION!\nRealmente quieres eliminar esta galeria?\nRecuerda que al hacerlo, tambien se elminaran todas las imagenes existentes en la misma.');
if(temp){window.location.href='borrar_galeria.php?id='+id+'';}
else{return false;}
}

function borrarImagen(id,id_galeria){
temp=window.confirm('ATENCION!\nRealmente queres borrar esta imagen?\nEsta accion no puede deshacerse.');
if(temp){window.location.href='borrar_imagen.php?id='+id+'&id_galeria='+id_galeria;}
else{return false;}
}

function borrarDescarga(id){
temp=window.confirm('ATENCION!\nRealmente quieres borrar este archivo?\nEsta accion no puede deshacerse.');
if(temp){window.location.href='borrar_descarga.php?id='+id;}
else{return false;}
}

function zoomText(Accion,Elemento){
	var obj=document.getElementById(Elemento);
	var max = 150
	var min = 120
	if (obj.style.fontSize==""){
		obj.style.fontSize="100%";
	}
	actual=parseInt(obj.style.fontSize);
	incremento=10;
	if( Accion=="reestablecer" ){
		obj.style.fontSize="100%"
	}
	if( Accion=="aumentar" && ((actual+incremento) <= max )){
		valor=actual+incremento;
		obj.style.fontSize=valor+"%"
	}
	if( Accion=="disminuir" && ((actual+incremento) >= min )){
		valor=actual-incremento;
		obj.style.fontSize=valor+"%"
	}
} 
