StarOutUrl=		'../images/entre-pros/molette_grise.gif';		//image par défaut
StarOverUrl=	'../images/entre-pros/molette_orange.gif';		//image d'une étoile sélectionnée
StarBaseId=		'Star';				//id de base des étoiles
NbStar=			5;					//nombre d'étoiles
Note = 			0;
LgtStarBaseId = StarBaseId.lastIndexOf('');

function NotationSystem() {
	
	for (i=1;i<NbStar+1;i++) {
		var img	= jQuery("#note"+i);
		img.click(function(){ 
			StarNb = nombreSelect(this.id);
			Note = StarNb;
			jQuery("#noteImage").val(Note);			
		});
			
		img.alt = 'Donner la note de '+i;
		//Texte au survol
		img.mouseover(function(){ 			
			for (i=1;i<(Note*1)+1;i++) {				
				jQuery("#note"+i).attr('src', StarOutUrl);
			}
			StarOver(this.id);
		});
		
		img.mouseout(function() {
			StarOut(this.id);
			for (i=1;i<(Note*1)+1;i++) {				
				jQuery("#note"+i).attr('src', StarOverUrl);
			}
		});
	}
}

function StarOver(Star) {
	StarNb = nombreSelect(Star);
	for (i=1;i<(StarNb*1)+1;i++) {
		jQuery("#note"+i).attr('src', StarOverUrl);
	}
}

function StarOut(Star) {
	StarNb = nombreSelect(Star);
	for (i=1;i<(StarNb*1)+1;i++) {
		jQuery("#note"+i).attr('src', StarOutUrl);
	}
}

function nombreSelect(note) {
	NoteSelec = note.slice(LgtStarBaseId);
	return(NoteSelec);
}
