title: return an object once the callback is completed
body: <p>When this function is called, I would like that the function waits for the callback to finish before returning the object <code>r</code></p>
  
  <pre><code>    function getWmsLayers(oneServerState){
              reader = new GeoExt.data.WMSCapabilitiesReader();;
              var serverLayers = new Array();
              var store = new GeoExt.data.WMSCapabilitiesStore({
                      url: OpenLayers.ProxyHost + oneServerState.serverUrl,
                      reader: reader
              });
              var isCallBackCompleted = false;
              store.load({
                      callback: function (r) {
                              return r;
                      }
              });
              //Do something ??
              return r;
      };
  
  
      layers = getWMSLayers(oneServerState);
  </code></pre>