function makeNiceRatingForm(options) { gRatingOptions = options || {}; var form = $('rateForm'); if (!form) return; gRatingButtons = form.getElements('input'); gUserRating = ""; gRatingButtons.each(function(el){ if ( el.type=="button" ) { gUserRating = el.value; } }); gRatingButtons.each(function(el, i){ el.initialRateValue = el.value; // save it as a property try { el.type = "button"; } catch (e){}// avoid normal submit (use ajax); not working in IE6 //hide the text IE/Opera - breaks safari if (navigator.userAgent.indexOf('AppleWebKit/') == -1 ) el.value = ""; el.setStyles({ 'textIndent' : "-50px", 'marginLeft' : 0, 'marginRight' : 0 }); if (i!=gRatingButtons.length-1 && el.nextSibling.nodeType == 3 /*TEXT_NODE*/) el.parentNode.removeChild(el.nextSibling); if (i>0 && el.previousSibling.nodeType == 3 /*TEXT_NODE*/) el.parentNode.removeChild(el.previousSibling); el.addEvents({ 'mouseenter' : function(){updateRating(el)}, 'mouseleave' : function(){resetRating(el)}, 'click' : function(e){submitRating(e)} }); }); } function resetRating(el) { for (i = 1; i el.value) break; } } function updateRating(el) { for (i = 1; i 49) ? true : false; for (i = 1; i