function $(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); }
function $S(o) { return((typeof(o)=='object'?o:$(o)).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function abPos(o) { var o=(typeof(o)=='object'?o:$(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); }
function XY(e,v) { var o=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); }

star={};

star.mouse=function(e,o) { if(star.stop || isNaN(star.stop)) { star.stop=0;

	document.onmousemove=function(e) { var n=0;
	
		var p=abPos($('star'+n)), x=XY(e), oX=x.X-p.X, oY=x.Y-p.Y;

		if(oX<1 || oX>84 || oY<0 || oY>19) { star.stop=1; star.revert(); }
		else {
			$S('starCur'+n).width=oX+'px';
		}
	};
} };

star.update=function(e,o) { var n=0, v=parseInt($S('starCur'+n).width), s=Math.ceil(v/0.84);
  n=o.id.substr(4); $('starCur'+n).title=s;

  jx.load('/rate.php?eid='+entryId+'&s='+s, function(data){ var elm = document.getElementById("starUser0"); if(elm != null) elm.innerHTML=data;}, 'text', 'get');
};

star.revert=function() { var n=0, v=parseInt($('starCur'+n).title);

	$S('starCur'+n).width=Math.round(v*84/100)+'px';
	
	document.onmousemove='';

};
