function Star_class(){
	this.num=0;
}
Star_class.prototype = {
	starSelector:function(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); },
 	starSelectorS:function(o) { return((typeof(o)=='object'?o:star.starSelector(o)).style); },
	agent:function(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); },
 	abPos:function(o) { var o=(typeof(o)=='object'?o:star.starSelector(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); },
	XY:function(e,v) { var o=star.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); },
 	mouse:function(e,o) { if(star.stop || isNaN(star.stop)) { star.stop=0;

		document.onmousemove=function(e) { 
			var n=star.num;
			var p=star.abPos(star.starSelector('star'+n)), x=star.XY(e), oX=x.X-p.X, oY=x.Y-p.Y; 
			star.num=o.id.substr(4);
			if(oX<1 || oX>84 || oY<0 || oY>19) { star.stop=1; star.revert(); }
			
			else {
				star.starSelectorS('starCur'+n).width=oX+'px';
				star.starSelectorS('starUser'+n).color='#111';
				star.starSelector('starUser'+n).innerHTML=Math.round(oX/84*100)+'%';
			}
		};
	}},	
	setIndicator:function(_vote){
		var n=star.num;
		star.starSelector('starCur'+n).title=_vote*100
		star.revert();
	},
	update:function(e,o, _web_id) { 
		var n=star.num, v=parseInt(star.starSelector('starUser'+n).innerHTML);
	
		n=o.id.substr(4);
		star.starSelector('starCur'+n).title=v;
		
        v = v / 100;
		$('#website_score').val(v);

	},
	revert:function() { var n=star.num, v=parseInt(star.starSelector('starCur'+n).title);

		star.starSelectorS('starCur'+n).width=Math.round(v*84/100)+'px';
		star.starSelector('starUser'+n).innerHTML=(v>0?Math.round(v)+'%':'');
		star.starSelector('starUser'+n).style.color='#888';
		
		document.onmousemove='';

	}
}
var star = new Star_class();
