/* starrating user */
function rate(rating,id) {
    try {
		req = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }
	req.onreadystatechange = handlestars;	
	req.open('get', '/topic/starupdate.html?mode=update&rating='+rating+'&id='+id);
	rating = rating * 25;
	document.getElementById('current-rating'+id).style.width = rating+'px';
	req.send(null);
	req.id = id;
}

function handlestars() {
	if ((req.readyState == 4) && (req.status == 200)) {
		id = req.id;
		document.getElementById('rating1'+id).innerHTML = req.responseText;
    }
}
/*
function reloadstars(id) {
    try {
		req1 = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }
    req1.onreadystatechange = handlerelaodstars;	
    document.getElementById('rating1'+id).innerHTML = loadstatus;
	req1.open('get', '/topic/starupdate.html?mode=reload1&id='+id);
	req1.send(null);
}

function handlerelaodstars(id) {
	if ((req1.readyState == 4) && (req1.status == 200)) {
		id = req.id;
		document.getElementById('rating1'+id).innerHTML = req1.responseText;
		//reloaddurchschnitt(id);
	}
}

function reloaddurchschnitt(id) {
    try {
		req2 = window.XMLHttpRequest?new XMLHttpRequest():
        new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
    //Kein AJAX Support
    }
    req2.onreadystatechange = handlerelaoddurchschnitt;	
	req2.open('get', '/topic/starupdate.html?mode=reload2&id='+id);
	req2.send(null);
}

function handlerelaoddurchschnitt(id) {
	if ((req2.readyState == 4) && (req2.status == 200)) {
		document.getElementById('rating2').innerHTML = req2.responseText;
	}
}
*/

