//for storing previous state of images
function stars(){}

function overStar(img, star){
  var idRoot = img.id;
  idRoot = idRoot.substring(0,idRoot.length-1);
  //store original stars
  stars.src1 = getElement(idRoot + '1').src;
  stars.src2 = getElement(idRoot + '2').src;
  stars.src3 = getElement(idRoot + '3').src;
  stars.src4 = getElement(idRoot + '4').src;
  stars.src5 = getElement(idRoot + '5').src;
  //show new stars
  for(i=1; i<=5; i++){
    curStar = getElement(idRoot + i);
    if(i <= star){
      curStar.src = '/resources/design/stars/starPer_10.gif';
    }else{
      curStar.src = '/resources/design/stars/starPer_0.gif';
    }
  }
}

function outStar(img, star){
  var idRoot = img.id;
  idRoot = idRoot.substring(0,idRoot.length-1);
  //restore stars stored from overStar call
  getElement(idRoot + '1').src = stars.src1;
  getElement(idRoot + '2').src = stars.src2;
  getElement(idRoot + '3').src = stars.src3;
  getElement(idRoot + '4').src = stars.src4;
  getElement(idRoot + '5').src = stars.src5;
}


