// JavaScript Document

function mostrar_div(id) {
	el = document.getElementById(id);
	if(el.style.display == 'none') {
		el.style.display = '';
	} else {
		el.style.display = "none";
    }
}
var urlis = "images/icons/estrela_on.gif";
var urlin = "images/icons/estrela_off.gif";
var descricao = new Array();
descricao[0] = "Dê sua nota:";
descricao[1] = "Não Gostei";
descricao[2] = "Regular";
descricao[3] = "Boa";
descricao[4] = "Muito Boa";
descricao[5] = "Perfeita";
function voto(cod_nota , prefixo , fixa_flag) {
	var pid = prefixo + "_nota_";
	var did = prefixo + "_mostra_nota_descricao";
	var oif = pid + "f";
	objf = document.getElementById(oif);
	desc = document.getElementById(did);

	if (fixa_flag == 0) {
		objf.value = cod_nota;
	} else if (fixa_flag == 2) {
		cod_nota = objf.value;
	}
	cod_nota = parseInt(cod_nota);
	for (var i = 1 ; i <= 5 ; i++) {
		oid = pid + i;
		obj = document.getElementById(oid);
		if (cod_nota < i) {
			obj.src = urlin;
		} else {
			obj.src = urlis;
		}
	}
	desc.innerHTML = descricao[cod_nota];
}
function voto_preload() {
	 if(document.images){
		 Aberto  = new Image(16,16) 
		 Fechado = new Image(16,16)
		 Aberto.src  = "images/icons/estrela_on.gif"
		 Fechado.src = "images/icons/estrela_off.gif"
	 }
}
voto_preload();

//valida nota
function valida_nota(campo,value) {
	if(value>0)
	    return true;
	return false;
}


