var RatingTool={MyRateObject:null,OldRate:null,Init:function(Element){RatingTool.MyRateObject=Element;RatingTool.ValueObject=Element.childNodes[0];RatingTool.OldRate=Element.rate?Element.rate:0;RatingTool.SetRating(RatingTool.OldRate);Element.onmousemove=RatingTool.MouseMove;Element.onclick=RatingTool.OnClick;Element.onmouseout=RatingTool.MouseOut;},SetRating:function(Rate){RatingTool.ValueObject.width=Rate*10;},MouseMove:function(e){if(e==null)e=window.event;var RateValue=10*(e.clientX-getClientLeft(this))/this.offsetWidth;if(RateValue<.5)RateValue=0;else RateValue=Math.ceil(RateValue);RateValue=Math.max(Math.min(RateValue,10),0);RatingTool.ValueObject.width=10*RateValue;},MouseOut:function(e){RatingTool.MyRateObject.onmousemove=null;RatingTool.MyRateObject.onclick=null;RatingTool.MyRateObject.onmouseout=null;RatingTool.MyRateObject=null;RatingTool.Cancel();},OnClick:function(){RatingTool.MyRateObject.rate=RatingTool.GetRateValue(this.childNodes[0].width);RatingTool.OldRate=RatingTool.MyRateObject.rate;},GetRateValue:function(Width){return Math.round((Width==null?RatingTool.OldWidth:Width)/10);},Cancel:function(){RatingTool.ValueObject.width=RatingTool.OldRate*10;}};