<!--
//FUNCION QUE REGULA EL TAMAÑO DE UN TEXT AREA MIENTRAS SE ESCRIBE EN EL
function sz(t)
{
	a = t.value.split('\n');
	b=0;
	cols=t.cols+10;
	for (x=0;x < a.length; x++)
	{
		if (a[x].length >= cols) b+= Math.floor(a[x].length/cols);
	}
	b+= a.length;
	t.rows = b;
}


//FUNCION QUE ELIMINA UN TEXTO DE UN TEXTAREA CUANDO SE MONTAN EN EL
function focus_textarea(v,t,t2)
{
	if (v.value == t) {v.value	=	"";}
	if (v.value == t2) {v.value	=	"";}
}


//FUNCION QUE REEMPLAZA DICHO TEXTO CUANDO SE SALE DE UN TEXTAREA SIN HABER ESCRITO NADA
function blur_textarea(v,t)
{
	if (v.value == "") {v.value	=	t;}
}

//FUNCION QUE REEMPLAZA LOS SALTOS DE LINEA POR BR
function nl2br(str)
{
   return str.replace(/\n/g,"<br>");
}


//FUNCION QUE MODIFICA LA FOTO DE AVATAR POR OTRA
function foto_avatar(fid)
{
	cargar_contenido('contenedor_extra','/u_foto/proceso_foto.php','GET','proceso=6&fid='+fid,'Cambiando avatar...');
}

//FUNCION QUE MODIFICA EL ESTADO DE LA FOTO DE EVENTO
function foto_evento_estatus(int_status,id,id_evento,id_foto)
{
	var contenedor	=	'contenedor_confirmacion';
	var mensaje		=	"<strong>Atencion</strong> | Esta seguro que desea cambiar el estatus esta foto | [<a class='Link2' href='proceso.php?proceso=5&mid=show&id="+id+"&id_evento="+id_evento+"&id_foto="+id_foto+"&int_status="+int_status+"'>SI</a>] [<a class='Link2' href='javascript:noEliminar_foto();'>NO</a>]";
	var error		=	'2';

	redir_mismaPagina(contenedor,mensaje,error);
}



//FUNCION QUE HACE EL LLAMADO A ELIMINAR UNA FOTO
function foto_eliminar(fid,fids,aid,posicion)
{
	var contenedor	=	'contenedor_confirmacion';
	var mensaje		=	"<strong>Atencion</strong> | Esta seguro que desea borrar esta foto | [<a class='Link2' href='proceso_foto.php?proceso=5&mid=show&aid="+aid+"&fid="+fid+"&fids="+fids+"&num_foto="+posicion+"'>SI</a>] [<a class='Link2' href='javascript:noEliminar_foto();'>NO</a>]";
	var error		=	'2';

	redir_mismaPagina(contenedor,mensaje,error);
}


//FUNCION QUE HACE EL LLAMADO A ELIMINAR UNA FOTO DE EVENTO
function foto_evento_eliminar(id,id_evento,id_foto,int_posicion,id_foto_2)
{
	var contenedor	=	'contenedor_confirmacion';
	var mensaje		=	"<strong>Atencion</strong> | Esta seguro que desea borrar esta foto | [<a class='Link2' href='proceso.php?proceso=6&mid=show&id="+id+"&id_evento="+id_evento+"&id_foto="+id_foto+"&num_foto="+int_posicion+"&id_foto_2="+id_foto_2+"'>SI</a>] [<a class='Link2' href='javascript:noEliminar_foto();'>NO</a>]";
	var error		=	'2';

	redir_mismaPagina(contenedor,mensaje,error);
}



//FUNCION QUE DEVUELVE UN RESULTADO CUANDO UN USUARIO NO QUIERE ELIMINAR UNA FOTO EN LA PREGUNTA DE CONFIRMACION
function noEliminar_foto()
{
	var miConf			=	document.getElementById('contenedor_confirmacion');
	
	//LO LIMPIO
	miConf.innerHTML	=	"";
	miConf.className 	=	"";
}


//FUNCION QUE ENVIA UN COMENTARIO DE UNA FOTO
function enviar_comentario()
{
	var t			=	document.getElementById("fcomentario_texto");
	var f			=	document.getElementById("ffoto_id");
	var a			=	document.getElementById("ffoto_usr_id");
	var l			=	document.getElementById("fusr_login");

	var album		=	document.getElementById('id_album');
	var usuario		=	document.getElementById('id_usuario');
	
	cargar_contenido('comentario_loader','/u_foto/proceso_foto.php','GET','proceso=7&fid='+f.value+'&com='+t.value+'&id_usuario='+usuario.value+'&aid='+album.value,'<?php echo $loader_comentario; ?>');
	
	var cont		=	document.getElementById("comentario_texto");
	var n_div		=	document.createElement("div");
	n_div.className	=	"foto_comentario_box";
	n_div.innerHTML	=	"<div id='foto'><img src='/imgsite/usuario/th_"+a.value+"' border='0' align='absmiddle'></div><div id='texto'><span class='Texto15'>"+l.value+"</span> <span class='Texto4b'>enviado ahora</span> <br />"+nl2br(t.value)+"</div>";
	
	cont.appendChild(n_div);
	
	//Limpio el campo
	t.value	=	"Escribir otro comentario...";
}


//FUNCION QUE ENVIA UN COMENTARIO DE UN EVENTO
function enviar_comentario_evento(fcomentario_texto,fid_evento,ffid_usuario,fid_usuario,incremento)
{
	//alert(fcomentario_texto.value);
	cargar_contenido('comentario_loading','/u_evento/proceso.php','GET','proceso=8&id_usuario='+fid_usuario.value+'&id_evento='+fid_evento.value+'&txt_mensaje='+nl2br(fcomentario_texto.value),'<?php echo $loader_comentario; ?>');
	var incrementar	=	incremento.value;
	var cont		=	document.getElementById("comentario_loader"+incrementar);
	incrementar++;
	incremento.value	=	incrementar;
	var n_div		=	document.createElement("div");
	n_div.id		=	'comentario_loader'+incrementar;
	n_div.className	=	"evento_comentario_box_2";
	n_div.innerHTML	=	"<div id='foto'><img src='/imgsite/usuario/th_"+ffid_usuario.value+"' border='0' align='absmiddle'></div><div id='texto'><span class='Texto15'>"+fid_usuario.value+"</span> <span class='Texto4b'>enviado ahora</span> <br />"+nl2br(fcomentario_texto.value)+"</div>";
	//cont.appendChild(n_div);
	cont.parentNode.insertBefore(n_div,cont);
	//Limpio el campo
	fcomentario_texto.value	=	"Escribir otro comentario...";
}

function enviar_comentario_evento_n()
{
	//alert(fcomentario_texto.value);
	var comentario_texto	=	document.getElementById('fcomentario_texto');
	var id_evento			=	document.getElementById('fid_evento');
	var id_usuario			=	document.getElementById('fid_usuario');
	
	cargar_contenido('comentario_loading','/u_evento/proceso.php','GET','proceso=8&id_usuario='+id_usuario.value+'&id_evento='+id_evento.value+'&txt_mensaje='+nl2br(comentario_texto.value),'');

	var com_texto			=	document.getElementById('fcomentario_texto');
	com_texto.value			=	'';
	
	var comentario 			=	document.getElementById('comentario_loading_2');
	comentario.innerHTML	=	'Mensaje enviado... En unos segundos aparecerá abajo';
}


//FUNCION QUE ENVIA UN COMENTARIO DE UN GRUPO
function enviar_comentario_grupo(fcomentario_texto,fid_grupo,ffid_usuario,fid_usuario,incremento)
{
	//alert(fcomentario_texto.value);
	cargar_contenido('comentario_loading','/u_grupo/proceso.php','GET','proceso=8&id_usuario='+fid_usuario.value+'&id_grupo='+fid_grupo.value+'&txt_mensaje='+nl2br(fcomentario_texto.value),'<?php echo $loader_comentario; ?>');
	var incrementar	=	incremento.value;
	var cont		=	document.getElementById("comentario_loader"+incrementar);
	incrementar++;
	incremento.value	=	incrementar;
	var n_div		=	document.createElement("div");
	n_div.id		=	'comentario_loader'+incrementar;
	n_div.className	=	"grupo_comentario_box_2";
	n_div.innerHTML	=	"<div id='foto'><img src='/imgsite/usuario/th_"+ffid_usuario.value+"' border='0' align='absmiddle'></div><div id='texto'><span class='Texto15'>"+fid_usuario.value+"</span> <span class='Texto4b'>enviado ahora</span> <br />"+nl2br(fcomentario_texto.value)+"</div>";
	//cont.appendChild(n_div);
	cont.parentNode.insertBefore(n_div,cont);
	//Limpio el campo
	//fcomentario_texto.value	=	"Escribir otro comentario...";
}

function enviar_comentario_grupo_n()
{
	//alert(fcomentario_texto.value);
	var comentario_texto	=	document.getElementById('fcomentario_texto');
	var id_grupo			=	document.getElementById('fid_grupo');
	var id_usuario			=	document.getElementById('fid_usuario');
	
	cargar_contenido('comentario_loading','/u_grupo/proceso.php','GET','proceso=8&id_usuario='+id_usuario.value+'&id_grupo='+id_grupo.value+'&txt_mensaje='+nl2br(comentario_texto.value),'');

	var com_texto			=	document.getElementById('fcomentario_texto');
	com_texto.value			=	'';
	
	var comentario 			=	document.getElementById('comentario_loading_2');
	comentario.innerHTML	=	'Mensaje enviado... En unos segundos aparecerá abajo';
}


//FUNCION QUE BORRA UN COMENTARIO DE UNA FOTO
function borrar_comentario(id)
{
	var fid					=	document.getElementById("ffoto_id");

	var come				=	document.getElementById("comentario_"+id);
	come.style.display		=	"none";
	
	cargar_contenido('comentario_loader','/u_foto/proceso_foto.php','GET','proceso=8&fid='+fid.value+'&cid='+id,'');
}


//FUNCION QUE BORRA UN COMENTARIO DE UN EVENTO
function borrar_comentario_evento(id)
{
	var id_evento			=	document.getElementById("fid_evento");

	var come				=	document.getElementById("comentario_"+id);
	come.style.display		=	"none";
	//alert('proceso=9&id_mensaje='+id+'&id_evento='+e.value+'&id_usuario='+u.value);
	cargar_contenido('comentario_loading','/u_evento/proceso.php','GET','proceso=9&id_mensaje='+id+'&id_evento='+id_evento.value,'');
}


//FUNCION QUE BORRA UN COMENTARIO DE UN GRUPO
function borrar_comentario_grupo(id)
{
	var id_grupo			=	document.getElementById("fid_grupo");

	var come				=	document.getElementById("comentario_"+id);
	come.style.display		=	"none";
	//alert('proceso=9&id_mensaje='+id+'&id_evento='+e.value+'&id_usuario='+u.value);
	cargar_contenido('comentario_loading','/u_grupo/proceso.php','GET','proceso=9&id_mensaje='+id+'&id_grupo='+id_grupo.value,'');
}


//FUNCION QUE ABRE VENTANA PARA REPORTAR MENSAJES
function reportar(idmensaje, tipo)
{
	MM_openBrWindow('/usuario/reportar_comienzo.php?idusuario=<?php echo $LoginUsr; ?>&idreporte=' + idmensaje + '&tipo=' + tipo,'','scrollbars=no,width=250,height=200');
}

//FUNCION QUE CAMBIA DE ESTILO CUALQUIER ETIQUETA POR OTRO
function cambiar_estilo(el,es)
{
	var elem		=	document.getElementById(el.id);
	elem.className	=	es;
}


//FUNCION QUE BORRA UN COMENTARIO DE UNA FOTO
function eliminar_contenido(id)
{
	var cont			=	document.getElementById(id);
	cont.innerHTML		=	"";
}

//FUNCION QUE ENVIA LA CONSULTA DE EXISTENCIA DE LOGIN
function verificar_datos(contenedor,tipo)
{
	var dato	=	document.getElementById(tipo);
	//alert(contenedor+tipo+dato.value);
	cargar_contenido(contenedor,'/suscripcion/_ajax/verificador.php','GET','tipo=' + tipo + '&dato=' + dato.value,'<img src=/_img/loader_4.gif align=absmiddle vspace=2 hspace=2>');
}

//FUNCION CON LA QUE CREO UN TIMEOUT
function tiempo_de_espera(tiempo,funcion,contenedor,tipo)
{
	clearTimeout(timeoutID);
	timeoutID	=	setTimeout(""+funcion+"('"+contenedor+"','"+tipo+"')", tiempo);
}
//-->
