// Make asynchronous call to enable cross domain data retrieval
// Requires a web service that returns the data wrapped in a (callback) function call  i.e. Google , Yahoo etc.
// Data can be anything as long as it has a function wrapper, but preferred is JSON
// This is known as JSON-P
// Phil Whitehurst
// November 2010


function makeRequest(sUrl) {
        
        var oScript = document.createElement("script");
        oScript.src = sUrl;
		oScript.async = true
		var done = false;
		oScript.onload = oScript.onreadystatechange = function() 
		  {
			if ( !done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") ) 
			{
		 	 done = true;
		  	 oScript.onload = oScript.onreadystatechange = null;
		  	 if ( oScript && oScript.parentNode ) 
			 {
				oScript.parentNode.removeChild( oScript );
		  		}
      }
    };
		document.body.appendChild(oScript);
      }     
