var ratings = new Array; function pivote_getHTTPObject() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != "undefined") { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var pivote_http = pivote_getHTTPObject(); function pivote_handleHttpResponse() { if(pivote_http.readyState == 4) { var s = pivote_http.responseText; var res = s.split(","); var id = res[0]; var index = res[1]; var message = res[2]; var textmsg = document.createTextNode(message); var votediv = document.getElementById('votediv_' + id); votediv.removeChild(votediv.firstChild); votediv.appendChild(textmsg); var maxvote = "5"; for(z=1;z<=maxvote;z++) { i = document.getElementById("image_" + id + "_" + z); if(z<=index) usei = "/pivot/db/pivote/pivote-gfx/star1.gif"; else usei = "/pivot/db/pivote/pivote-gfx/star0.gif"; i.setAttribute("src", usei); i.setAttribute("onmouseover", null); i.setAttribute("onmouseout", null); } } } function pivote_vote(id, index) { var url = "/pivot/db/pivote/pivote.php?id=" + id + "&index=" + index; pivote_http.open("GET", url, true); pivote_http.onreadystatechange = pivote_handleHttpResponse; pivote_http.send(null); } function pivote_hover(id, index, rating) { var i; ratings[id] = rating; var maxvote = "5"; for(z=1;z<=maxvote;z++) { i = document.getElementById(id + "_" + z); if(z<=index) usei = "/pivot/db/pivote/pivote-gfx/star1.gif"; else usei = "/pivot/db/pivote/pivote-gfx/star0.gif"; i.setAttribute("src", usei); } } function pivote_unhover(id, index) { var i; var maxvote = "5"; for(z=1;z<=maxvote;z++) { i = document.getElementById(id + "_" + z); if(z<=ratings[id]) usei = "/pivot/db/pivote/pivote-gfx/star1.gif"; else usei = "/pivot/db/pivote/pivote-gfx/star0.gif"; i.setAttribute("src", usei); } }