var jsonloader = {};
jsonloader.count = 0;
jsonloader.load = function(u,cb){
  jsonloader.count++;
  var id = 'id'+this.count;
  jsonloader[id] = function(json){
    try{
      document.getElementsByTagName('head')[0].removeChild(document.getElementById(id));
      eval('delete '+id);
    }catch(e){}
    cb(json);
  }
  eval(id+'=jsonloader[id]');
  toScript(u.replace(/{callback}/,id),id);

  function toScript(url,id){
    var script  = document.createElement('script');
    script.type = 'text/javascript';
    script.src  = url;
    script.id   = id;
    document.getElementsByTagName('head')[0].appendChild(script);
  }
}
