/*- Simple function that "display" N lighted stars, and (5-N) unlighted stars
    The stars images'id in the document muste be "note_i"
    Input parameters are :
    - stars_nb : number of stars which must be lighted
-*/

//alert("ENLIGHT");

  // Stupid instruction to ensure this function is loaded
var i=0;

note_0='/design/bedeo/images/note_0.png';
note_1='/design/bedeo/images/note_1.png';

function turn_on(prefix, stars_nb) 
{
	if (stars_nb>5) 
		stars_nb=5;
	if (stars_nb<0)
		stars_nb=0;

	var i=1;
	while (i<=stars_nb)
	{
		var current_image=prefix+i;
		document.getElementById(current_image).src=note_1;
		i++;
	}
	
	while (i<=5)
	{
		var current_image=prefix+i;
		document.getElementById(current_image).src=note_0;
		i++;
	}
}

