function Bewertung(stufen, id, textfield, bewertung)
{
	this.stufen = stufen;
	this.id = id;
	this.textfield = textfield;
	this.bewertung = bewertung;
	this.img0 = '/img/meinung-rot-0.gif';
	this.img1 = '/img/meinung-rot-1.gif';

	this.click = function(n)
	{
		this.bewertung = n;
		document.getElementById(this.textfield).value = n;
		document.getElementById(this.textfield).focus();
	}

	this.over = function(n)
	{
		for(var i=1; i<=this.stufen; i++)
		{
			this.setImage(i, (i<=n ? this.img1 : this.img0));
		}
	}

	this.out = function(n)
	{
		for(var i=1; i<=this.stufen; i++)
		{
			this.setImage(i, (i<=this.bewertung ? this.img1 : this.img0));
		}
	}

	this.setImage = function(i, uri)
	{
		document.getElementById(this.id+i).src = uri;
	}

	this.check = function()
	{
		if(!(this.bewertung >= 1 && this.bewertung <= this.stufen))
		{
			alert("Bitte geben Sie eine Bewertung (1 bis 5 Sterne) ab.");
			return false;
		}
		return true;
	}
}
