function assistir( id_video ) {
/*	var ul = document.getElementById('lista');
//	for( i = 0; i < ul.childNodes.length; i++ ) {
//		if ( ul.childNodes[i].nodeName == 'LI' ) {
//			ul.childNodes[i].className = 'quebraFloat comFotos'
//		}
	}
//	var li = document.getElementById('f'+id_video);
//	li.className = 'quebraFloat comFotos liSelecionado'
*/
	var li = document.getElementById('video');
	li.innerHTML = "<P><P><P><CENTER><img src='layout/carregando.gif' width='32' height='32'></CENTER>";	

	new Ajax.Request('videodiv.asp?cod='+id_video,
		{
			onComplete:function( txt ) {
				Element.update('video', txt.responseText);
			}
		}
	);
}



//function comentar() {
//}

var Vote = {
	id_video:0,
	ti:0,
	votos:0,
	init:function( divId, id_video ) {
		this.id_video = id_video;
		this.votos = 0;
		for( var i = 1; i <= 5; i++ ) {
			var img = $('e'+i);
			if ( img.src.indexOf('cheia') != -1 ) {
				this.votos++;
			}
			img.onmouseover = Vote.onmouseover;
			img.onmouseout = Vote.onmouseout;
			img.onclick = Vote.onclick;
		}
	},
	onclick:function() {
		var n = (""+this.id).substr(1,1);
		Element.update($('vote'), 'Votando...');
		setTimeout(
			function() {new Ajax.Updater('vote', 'ajax/vote.asp?cod='+Vote.id_video+'&valor='+n);}
		, 500);
	},
	onmouseover:function() {
		var idx = (""+this.id).substr(1,1);
		if ( Vote.ti ) {
			clearInterval(Vote.ti);
			Vote.ti = 0;
		}
		for( var i = 1; i <= 5; i++ ) {
			var img = $('e'+i);
			if ( i <= idx ) { 
				img.src = 'layout/estrela_cheia.gif';
			} else {
				img.src = 'layout/estrela_vazia.gif';
			}
		}	
	},
	onmouseout:function() {
		Vote.ti = setInterval(Vote._restore, 1000);
	},
	_restore:function() {
		for( var i = 1; i <= 5; i++ ) {
			var img = $('e'+i);
			if ( i <= Vote.votos ) {
				img.src = 'layout/estrela_cheia.gif';
			} else {
				img.src = 'layout/estrela_vazia.gif';
			}
		}	
	}	
};	
	

	

