function rhighlight(field, stars) {
	if(stars == 0) {
		stars = rating[field];
	}
	for(var i = 1; i < 6; i ++) {
		var star = document.getElementById('rating_'+field+'_'+i);
		if(i <= stars) {
			star.src = '1pic/rating_star_full.gif';
		}
		else {
			star.src = '1pic/rating_star_empty.gif';
		}
	}
}

function rate(field, stars) {
	rating[field] = stars;
	document.getElementById('field_'+field).value = stars;
	
	rhighlight(field, 0);
}

function showBestPreis(evt) {
	var field = $('bestpreis_text');
	
	if(!evt) var evt = window.event;
	var pos = new Object();
	pos.left = evt.clientX;
	pos.top = evt.clientY;
	var b = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ? 
	window.document.documentElement : window.document.body || null;
	if (b)
	{
		pos.scrollLeft= pos.left + b.scrollLeft;
		pos.scrollTop = pos.top + b.scrollTop;
		pos.clientHeight = b.clientHeight;
	}


	field.style.left = pos.scrollLeft - 365 +'px';
	if((pos.clientHeight - 200) > pos.top) { 
		field.style.top = 5+pos.scrollTop+'px';
	}
	else {
		field.style.top = (pos.scrollTop - 190)+'px';
	}
	
	field.style.display = 'block';
}
function hideBestPreis() {
	$('bestpreis_text').style.display = 'none';
}