1. //Document Ready
  2. $(document).ready(function() {
  3.  
  4. var current = -1;
  5. var my_id = '';
  6. var id_len = -1;
  7.  
  8. $('#listBox a, #puzzleMap area').mouseenter(function(){
  9.  
  10. my_id = this.id;
  11. id_len = my_id.length
  12.  
  13. //store the last 2 characters from the id
  14. current = (my_id).substring( id_len-2, id_len );
  15.  
  16. //show content associated with this id
  17. $('#img'+current+', #roll'+current).show();
  18.  
  19. if(this.tagName == 'area')
  20. $('#list'+current).css({color: '#5e151c'});
  21.  
  22. }).mouseleave( function() {
  23.  
  24. $('#img'+current+', #roll'+current).hide();
  25.  
  26. if(this.tagName == 'area')
  27. $('#list'+current).removeAttr('style');
  28.  
  29. });
  30.  
  31.  
  32. });