function makeJSONRequest() { 
  // This URL returns a JSON-encoded string that represents a JavaScript object
  var url = "http://examples.rangersheck.com/fake_game_json.php?user_login="+ escape(prefs.getString("player_login"));
  // here we call the iGoogle method that grabs the text from the url and passes it off to our responseHandler function
  // let's set the refreshInterval to tell it to grab the content every 10 minutes
  _IG_FetchContent(url, responseHandler, { refreshInterval: (60 * 10) }); 
}


function responseHandler(response) { 
  // display error if we got bad response
  if (response == null || typeof(response) != "string") {
    $("content_div").innerHTML = "<i>Invalid data. Response: " + response + " (" + typeof(response) + ")</i>";
    return;
  } 

  var player = JSON.parse(response);

  var pc_html = ''
  var hidden_pc_html = ''
  // loop through player characters
  for (var p = 0; p < player.pcs.length ; p++) {
    pc = player.pcs[p]
    pc_html += '<div class="char">';
    pc_html += '<strong>' + pc.name + '</strong><br/>';
    pc_html += 'Level ' + pc.level + '</div>';
    pc_html += "</div>";
    
    hidden_pc_html += '<div style="display:none" id="pc_detail_' + p + '">';
    hidden_pc_html += '<strong>' + pc.name + '</strong><br/>';
    hidden_pc_html += 'Health: ' + colored_number(pc.health) + '<br/>';
    hidden_pc_html += 'Strength: ' + pc.stats.Strength +'<br/>';
    hidden_pc_html += 'Wisdom: ' + pc.stats.Wisdom +'<br/>';
    hidden_pc_html += 'Dexterity: ' + pc.stats.Dexterity +'<br/>';
    hidden_pc_html += 'Luck: ' + pc.stats.Luck +'<br/></div>';
  } // end player characters for loop
  
  // set login name header to our player's name
  $('login_name').innerHTML = player.name;
  // fill in the left side
  $('char_wrap').innerHTML = pc_html;
  // fill in the hidden blocks on the right side
  $('details').innerHTML = hidden_pc_html;
  // now that the new HTML is generated, we can add some onmouseover functionality
  setupRollovers();
}
