window.addEvent('domready', function(){
	var infDiv = document.createElement('div');
	document.body.appendChild(infDiv);
	infDiv.id = 'informDiv';
	$('informDiv').setStyles({
		position: 'absolute',
		width: 'auto',
		height: 'auto',
		left: '40%',
		top: '10%',
		overflow: 'auto',
		textAlign: 'center',
		border: '#777 1px solid',
		background: '#cccccc',
		display: 'none',
		opacity: '0.95',
		padding: '5px 20px 5px 20px',
		zIndex: 1
	});
	infDiv.addEvent('click',function(){
		infDiv.setStyle('display','none');
	});
});
function voting(id_ex){
	trs = $('votingtbl').getElements('tr');
	cnt = trs.length;
	for(i=0;i<cnt;i++) trs[i].getElements('td')[3].innerHTML = '';
	var url = 'vote.php';
	$('td_'+id_ex).innerHTML = '<img src="images/wait.gif">';
	new Ajax(url, {
		method: 'post',
		data: {"id_ex":id_ex,"ball":$('ex_'+id_ex).value},
		update: 'td_'+id_ex
	}).request();


}
function voting_ex(id_ex){
	trs = $('votingtbl').getElements('tr');
	cnt = trs.length;
	for(i=0;i<cnt;i++) trs[i].getElements('td')[3].innerHTML = '';
	var url = 'vote/vote.php';
	$('td_'+id_ex).innerHTML = '<img src="images/wait_ex.gif">';
	new Ajax(url, {
		method: 'post',
		data: {"id_ex":id_ex,"ball":$('ex_'+id_ex).value},
		update: 'td_'+id_ex
	}).request();


}
function voting_a(id_ex){
	trs = $('votingtbl').getElements('tr');
	cnt = trs.length;
//	for(i=0;i<cnt;i++){ trs[i].getElements('td')[0].innerHTML = '<A HREF="/forum.forum.php?F=1&N='+trs[i].getElements('td')[0].innerHTML+'">'+trs[i].getElements('td')[0].innerHTML+'</a>';
	for(i=0;i<cnt;i++){ trs[i].getElements('td')[0].innerHTML = 're-re';
                       }

}
function colorize_table(tbl_id){
	tbl = $(tbl_id);
	trs = tbl.getElements('tr');

    tds = tbl.getElements('td');
	cnt = trs.length;
  	cntd = tds.length;
	trs[0].style.backgroundColor = '#d3dce3';
	trs[1].style.backgroundColor = '#ffdd11';
	trs[2].style.backgroundColor = '#ccdddd';
	trs[3].style.backgroundColor = '#ccaa00';
	for(i=4;i<cnt;i++)
		if(i%2 == 0) trs[i].style.backgroundColor = '#ccc';
		else trs[i].style.backgroundColor = '#ddd';
	for(i=0;i<cntd;i++)
        tds[i].align = 'center';
}