function rate(obj,oEvent){ 
//================== 
// 图片地址设置  
//================== 
var imgSrc = '/images/huistar.gif'; //没有填色的星星
var imgSrc_2 = '/images/huastar.gif'; //打分后有颜色的星星
//--------------------------------------------------------------------------- 
var e = oEvent || window.event; 
var target = e.target || e.srcElement;  
var imgArray = obj.getElementsByTagName("img"); 
for(var i=0;i<imgArray.length;i++){ 
   imgArray[i]._num = i; 
   imgArray[i].onclick=function(){ 
    obj.rateFlag=true; 
    document.getElementById("sStar").value=this._num+1; //this._num+1这个数字写入到数据库中,作为评分的依据
   }; 
} 
if(target.tagName=="IMG"){ 
document.getElementById("spNote").innerHTML=target.title;
   for(var j=0;j<imgArray.length;j++){ 
    
    if(j<=target._num){ 
     imgArray[j].src=imgSrc_2; 
    } else { 
     imgArray[j].src=imgSrc; 
    } 
   } 
} else { 
   for(var k=0;k<imgArray.length;k++){ 
    var num=document.getElementById("sStar").value;
    if(num!="0"){
       document.getElementById("spNote").innerHTML=imgArray[num-1].title;
    }else{
     document.getElementById("spNote").innerHTML="";
    }
    if(k<num){
    imgArray[k].src=imgSrc_2; 
    }else{
    imgArray[k].src=imgSrc; 
    }
   } 
} 
}

