var xmlHttp;
function crear_objeto() {
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} 
else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlHttp;
}
function mvt(id_secreta, puntos, nuevos_puntos) {
for( i=1; i <= 5 ; i++) {
document.getElementById("v" + id_secreta+'-'+i).src="imagenes/es2.gif";
}
for( i=1 ; i <= nuevos_puntos ; i++) {
document.getElementById("v" + id_secreta+'-'+i).src="imagenes/es1.gif";
}
}
function nmvt(id_secreta, puntos, nuevos_puntos) {
for( i=1; i <= 5 ; i++) {
if( i > puntos)
document.getElementById("v" + id_secreta+'-'+i).src="imagenes/es2.gif";
else
document.getElementById("v" + id_secreta+'-'+i).src="imagenes/es1.gif";
}
}
var idsecreta = 0;
function clic(id_secreta, nuevos_puntos) {
xmlHttp = crear_objeto();
url = "calificar.php";
postVars = "id=" + id_secreta + "&enviar=si&select=" + nuevos_puntos;
idsecreta = id_secreta;
xmlHttp.open('POST', url, true);
xmlHttp.onreadystatechange = clic_rp;
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send(postVars);
}
function clic_rp() {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
document.getElementById('Calificador-'+idsecreta).innerHTML = xmlHttp.responseText;
}
else {
alert("Error");
}
}
return true;
}