var gRatingOptions, gRatingButtons, gUserRating; function makeNiceRatingForm(options) { gRatingOptions = options || {}; var form = document.getElementById('rateForm'); if (!form) return; //? template changed gRatingButtons = form.getElementsByTagName('input'); gUserRating = ""; for (var i=0; i0 && rateButton.previousSibling.nodeType == 3 /*TEXT_NODE*/) rateButton.parentNode.removeChild(rateButton.previousSibling); if(window.addEventListener){ // Mozilla, Netscape, Firefox rateButton.addEventListener("click", updateRating, false ); rateButton.addEventListener("mouseout", resetRatingStarDisplay, false ); rateButton.addEventListener("mouseover", updateRatingStarDisplayEvt, false ); } else if(window.attachEvent) { // IE rateButton.attachEvent("onclick", updateRating); rateButton.attachEvent("onmouseout", resetRatingStarDisplay); rateButton.attachEvent("onmouseover", updateRatingStarDisplayEvt); } } resetRatingStarDisplay(); } function resetRatingStarDisplay() { updateRatingStarDisplay( gUserRating ); } function updateRatingStarDisplay(userRating) { for (var i=0; i=gRatingButtons[i].initialRateValue ) ? "rateButtonStarFull" : "rateButtonStarEmpty"; } function updateRatingStarDisplayEvt(e) { updateRatingStarDisplay( e.target ? e.target.initialRateValue : e.srcElement.initialRateValue); } function updateRating(e) { var rateButton = e.target || e.srcElement; if (rateButton.initialRateValue == gUserRating) return false; //nothing to do for (var i=0; i