function imageRoll(imgName, aWindow) {
  var i;
    
  images = aWindow.document.images;
  for (i=0; i < images.length; i++) {
      var img = images[i].src.split('/').reverse();
  
      if (img[0].indexOf(imgName + '.') > -1) {
	  if (img[0].indexOf('.sel.') > -1) { return; }
	  
	  target = images[i].src;
	  target = target.substr(pathStub.length);
	  target = target.split('/');
	  target = target[target.length - 1];
	  target = target.split('.');
	    
	  var isSelected = aWindow.parent.main.location.pathname.toString();

	  //alert(isSelected+ ' ' + isSelected.indexOf(imgName + '.') + ' ' + imgName);

	  if (isSelected.indexOf(imgName + '.') > -1) {
	      isSelected = 'sel';
	  } else {
	      isSelected = 'def';
	  }
        
        
        
	  if (target[1] == 'rol') {
		      images[i].src = '_common.images/' + target[0] + '.' + isSelected + '.' + target[target.length - 1];
	  } else {
	      // if (isSelected != 'sel') {
	      images[i].src = '_common.images/' + target[0] + '.rol.' + target[target.length - 1];
	      //}
	  }
      }
      // debugWindow(false);
  }
}


function imageRollMap(imgName, aWindow) {
  images = aWindow.document.images;
  for (i=0; i < images.length; i++) {
    if (images[i].src.indexOf(imgName + '.') > 1) {
      target = images[i].src;
      target = target.split('/');
      target = target[target.length - 1];
      target = target.split('.');
      if (target[1] == 'def') {
        images[i].src = 'images/' + target[0] + '.rol.jpg';  
      } else {
        images[i].src = 'images/' + target[0] + '.def.jpg';  
      }      
    }
  }
}



