function	VoteStar ( name, classpref, root, value ) {
	this.vote = value;
	this.vote_max = 5;
	this.name = name;
	this.classpref = classpref == false ? 'votestar_' : classpref;
	this.root = root;

	this.initialize = function ( ) {
		this.root.innerHTML = this.preDraw ( );
		this.onClick ( this.vote );
	},

	this.onClick = function ( v ) {
		var j = 0;

		this.vote = v;

		for ( j = 1; j <= this.vote_max; j ++ ) {
			e = document.getElementById ( 'votestar_' + this.name + '_' + j );

			if ( !this.vote ) {
				e.className = this.classpref + 'na';
			} else {
				if ( Math.abs ( this.vote ) >= j ) {
					if ( e.className != this.classpref + 'a' ) {
						e.className = this.classpref + 'a';
					}
				} else {
					if ( e.className != this.classpref + 'na' ) {
						e.className = this.classpref + 'na';
					}
				}
			}
		}
	}

	this.preDraw = function ( ) {
		var	t = '';
		var j = 0;

		t += '<table cellpadding = "0" cellspacing = "0" border = "0" class = "' + this.classpref + '"><tr>';
		for ( j = 1; j <= this.vote_max; j ++ ) {
			if ( this.vote < 0 ) {
				t += '<td id = "votestar_' + this.name + '_' + j + '" class = "' + this.classpref + 'na"><img src = "./i/s.gif" width = "17" height = "16" alt = ""></td>';
			} else {
				t += '<td id = "votestar_' + this.name + '_' + j + '" class = "' + this.classpref + 'na"><div onclick = "' + this.name + '.onClick ( ' + j + ' )"><img src = "./i/s.gif" width = "17" height = "16" alt = ""></div></td>';
			}
		}
		t += '</tr></table>';

		return this.html = t;
	},

	this.initialize ( );
}


