function Rating(divId,data,ratingDivNo){			       
					this.body=document.getElementById(divId);					
					this.title=data;
					this.rating=1;		
					this.ratedivno = ratingDivNo;			 
					this.updateUI();
					 }
			
			Rating.prototype={
					updateUI:function(delta){
					   
						if (!delta){ delta=0; }
						if (delta>0){
							this.rating++;							
						}
						
					
					var inner="<table border='0'><tbody><tr><td width='42'>"+"<span class='tableText'><nobr>"+this.title+"</nobr></span></td>";
					inner+="<td><div id='rateStars' style='width:180'>";
					for (var i=0;i<this.rating;i++){
						inner+="<img src='/apps/jcrdev/skins/default/images/star.png' "	+" id='ratingstar_"+i+"'/>"
						
						}
					for (var j=this.rating;j<10;j++){
						inner+="<img src='/apps/jcrdev/skins/default/images/star_small_none.gif' "	+" id='norating"+j+"'/>"
						}
						
						inner+="</div></td><td><div id='controls'>"
											+"<img src='/apps/jcrdev/skins/default/images/up.gif' id='plus_"+this.title+"' height='25px' width='25px'/>"
						                    +"<img src='/apps/jcrdev/skins/default/images/spacer.gif' width='4' height=''>"
											+"<img src='/apps/jcrdev/skins/default/images/down.gif' id='minus_"+this.title+"'  height='25px' width='25px'/>"
											+"<img src='/apps/jcrdev/skins/default/images/spacer.gif' width='4' height=''>"
											+ "<input style='margin-bottom: 15px;' type='button' class='buttonS' id='saverate' value='rate' onclick = 'tellServer("+this.ratedivno+");' />" 
											+"<img src='/apps/jcrdev/skins/default/images/spacer.gif' width='4' height=''>"
											+"</div></td><td><input type='hidden'  value='' id='rating"+this.ratedivno+"'/><div id='message' class='tableText' ></div>"
											+"</td></tr></tbody></table>";
					
					this.body.innerHTML=inner;
					var rating=this;
					this.plusButton=$("plus_"+this.title);
					this.minusButton=$("minus_"+this.title);
					Event.observe(this.body, "click",this.clickHandler.bindAsEventListener(this));
					
						if (delta<0){						    
							new Effect.Fade("ratingstar_0");
							this.rating--;
							
							
							var ratedivId = "rating"+this.ratedivno;
							$(ratedivId).value=this.rating;							
							
						}else if (delta>0){
							new Effect.Pulsate
							("ratingstar_"+(this.rating-1),{ pulses: 2, duration: .5 });
							var ratedivId = "rating"+this.ratedivno;
							$(ratedivId).value=this.rating;
						}
					 },
					 clickHandler:function(event){
							var target=Event.element(event);
							if (target==this.plusButton	&& this.rating<10){
							this.updateUI(1);
							}else if (target==this.minusButton && this.rating>1){
							
							this.updateUI(-1);
							}
							
							}
					}
					