function stars(d){if(!d.id||!d.callback||!d.width||!d.height)return false;this.$=function(v,o){return((typeof(o)=='object'?o:document).getElementById(v))};this.$S=function(o){return((typeof(o)=='object'?o:this.$(o)).style)};this.agent=function(v){return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0))};this.abPos=function(o){var o=(typeof(o)=='object'?o:this.$(o)),z={X:0,Y:0};while(o!=null){z.X+=o.offsetLeft;z.Y+=o.offsetTop;o=o.offsetParent};return(z)};this.XY=function(e,v){var o=this.agent('msie')?{'X':event.clientX+document.body.scrollLeft,'Y':event.clientY+document.body.scrollTop}:{'X':e.pageX,'Y':e.pageY};return(v?o[v]:o)};this.mouse=function(e,o){if(this.stop||isNaN(this.stop)){this.stop=0;var c=this;document.onmousemove=function(e){if(!c.$('star'+d.id)||!c.$S('starCur'+d.id)||!c.$S('rating'+d.id))return false;var n=d.id;var p=c.abPos(c.$('star'+n)),x=c.XY(e),a=x.X-p.X,b=x.Y-p.Y;c.num=o.id;if(a<1||a>d.width||b<0||b>d.height){c.stop=1;c.revert()}else{c.$S('starCur'+n).width=a+'px';c.$('rating'+n).className=d.RatingOnClassName;c.$('rating'+n).innerHTML=Math.round(a/d.width*100)+'%'}}}};this.update=function(e,o){if(!this.$('rating'+d.id))return false;var n=d.id,v=parseInt(this.$('rating'+n).innerHTML);this.$('starCur'+n).title=v;if(d.actionURL){req=new XMLHttpRequest();req.open('GET',d.actionURL+(v/100),false);req.send(null)}else{if(d.callback)d.callback.returnMethod()(v)}};this.revert=function(){if(!this.$('starCur'+d.id))return false;var n=d.id,v=parseInt(this.$('starCur'+n).title);this.$S('starCur'+n).width=Math.round(v*d.width/100)+'px';this.$('rating'+n).innerHTML=(v>0?Math.round(v)+'%':0+'%');this.$('rating'+n).className=d.RatingOffClassName};String.prototype.returnMethod=function(){if(!/\W/.test(this.toString())){var a=eval(this.toString());if(typeof(a)==="function"){return a}else{return null}}}}
