function myclock(hours, mins, secs)
{		
	if (secs > 59)	
	{
		secs = 0;
		mins++;
	}
	if (mins > 59)
	{
		mins = 0;
		hours++;
	}
	if (hours > 23)
	{
		hours = 0;
	}
	if (secs < 10) secs = '0'+secs;
	if (mins < 10) mins = '0'+mins;
	if (hours < 10) hours = '0'+hours;
	datastr =hours+":" + mins;
	
	document.getElementById('time_element').textContent = datastr;		
	secs++;
	setTimeout("myclock("+hours+","+mins+","+secs+")", 1000);
}

id = 0;
	
function add_estimation_news(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '?page=newspage&id='+id+'&estimation='+estimation;
	}
}

function add_estimation_videoreport(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '?page=videoreport&id='+id+'&estimation='+estimation;
	}
}

function add_estimation_photoreport(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '?page=photoreport&id='+id+'&estimation='+estimation;
	}
}

function add_estimation_videoreport(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '?page=videoreport&id='+id+'&estimation='+estimation;
	}
}

function add_estimation_article(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '?page=articlepage&id='+id+'&estimation='+estimation;
	}
}

function add_estimation_photo_k(id,estimation)
{
	if ((estimation > 0) && (estimation<6))
	{
		alert('Спасибо! Ваш голос учтен!');
		top.location.href = '/votes.php?id='+id+'&estimation='+estimation;
	}
}

var est = false;
function star_clear(n)
{
	if (est == false)	
	for (i=1;i<6;i++)
	{
		document.getElementById('star_'+i).src = 'images/star'+i+'_1.jpg';
	}
	
}

function star(id)
{
	if (est == false)
	{
		id = id + 1;
		star_clear();
		for (i=1;i<id;i++)
		{
			document.getElementById('star_'+i).src = 'images/star'+i+'_2.jpg';
		}
	}
}
