var callbacks=new Object();

function getJSONP(url,cb) {
  var i;
  do
    i='c'+Math.floor(Math.random() * 99999);
  while(callbacks[i]);

  callbacks[i] = function(obj) {
                      cb(obj);
                      delete callbacks[i];
                    };

  var script=document.createElement('script');
  script.src=url+(url.indexOf('?')>=0?'&':'?')+'callback=callbacks.'+i;
  script.type='text/javascript';
  document.body.appendChild(script);
}

