function showIco(site)
{
	var img = new Image();
	img.src = "http://"+site+"/favicon.ico";
	if ("0" != ""+img.width)
	{
		document.write('<img src="'+img.src+'" width="16" height="16" />');
	}
}

/*
 *	@return		void
 */
function checkNewsUrl (url)
{
	$('news_url_status').innerHTML = '<img src="/img/indicator.gif">';
	ajaxLoadText(
	{
		url:		'/ajax/news/check_url',
		method:		'GET',
		args:		{url:url},
		onwait:		function(){},
		onerror:	function(){},
		onready:	function(req){
			$('news_url_status').innerHTML = req;
		}
	});
}

/**
 *	@return		bool
 */
function checkNewsForm (form)
{
	if( !form.title.value.match(/\S/) )
		return errFocus(L('news.error_no_title'), form.title);
	if( !form.text.value.match(/\S/) )
		return errFocus(L('news.error_no_text'), form.text);
	if( !form.tags.value.match(/\S/) )
		return errFocus(L('news.error_no_tags'), form.tags);
	return true;
}

function newsVote (el, interval, id, div_id)
{
		$(div_id).innerHTML = "<img src=\"/img/ajax/tiny_red.gif\">";
		el.blur();
		ajaxLoadText({
			url:'/ajax/news/vote',
			args:{interval:interval, id:id},
			forse:1,
			onready:function( text )
			{
				var votes = $(div_id);
				votes.innerHTML = text;
				votes.parentNode.parentNode.parentNode.getElementsByTagName("DIV")[0].className += " inactive";
				votes.parentNode.parentNode.getElementsByTagName("DIV")[0].onclick = "";
				votes.parentNode.parentNode.getElementsByTagName("A")[0].onclick = "";
			}
		});
		return false;
}
