var unique_authors = Array ();

function exists_in_array ( id, authors )
{
	var exists = false;

	for ( var i = 0; ( i < authors.length ) && ( exists == false ); i++ )
	{
		if ( authors[i] == id )
		{
			exists = true;
		}
	}

	return exists;
}

var stop = false;

if ( 'undefined' != typeof(threads) )
{
	for ( var i = 0; ( i < threads.length ) && ( stop == false ); i++ )
	{
		if ( exists_in_array ( threads[i]['poster'], unique_authors ) == false )
		{
			unique_authors[ unique_authors.length ] = threads[i]['poster'];

			threads[i]['preview'] = threads[i]['preview'].substring ( 0 , 100 );

			document.getElementById('forumNews').innerHTML += '<div class="item ">'+
				'<div align="left"><b><a href="http://foros.softonic.com/showthread.phtml?t=' + threads[i]['threadid'] + '" title="' + threads[i]['preview'] + '..."> '+ threads[i]['title']+'</a></b></div>'+
				'<div class="by">por <a href="http://foros.softonic.com/member.phtml?userid=' + threads[i]['posterid'] + '" title="Usuario ' + threads[i]['poster'] + '">' + threads[i]['poster'] + '</a>  '+'</div>'+
			'</div>';
		}
		/*<i>'+threads[i]['replycount']+' respuesta(s)</i>*/
		if ( unique_authors.length == 5 )
		{
			stop = true;
		}
	}
}
