code: function resolveUrl( url, contextUrl, ignoreSameOriginPolicy ) {
  
  		function getProtocol( url ) {
  			return url.substring(0, url.indexOf("//"));
  		}
  
  		function getProtocolAndHost( url ) {
  			return url.substring(0, url.indexOf("/", 8));
  		}
  
  		if (!contextUrl) {
  			contextUrl = baseUrl;
  		}
  
  		// protocol-relative path
  		if (url.substring(0,2)=="//") {
  			url = getProtocol(contextUrl) + url;
  		}
  
  		// absolute path
  		if (/^https?:\/\//i.test(url)) {
  			return !ignoreSameOriginPolicy && getProtocolAndHost(contextUrl) != getProtocolAndHost(url) ? null : url ;
  		}
  
  		// root-relative path
  		if (url.charAt(0)=="/")	{
  			return getProtocolAndHost(contextUrl) + url;
  		}
  
  		// relative path
  		var contextUrlPath = contextUrl.split(/[?#]/)[0]; // ignore query string in the contextUrl
  		if (url.charAt(0) != "?" && contextUrlPath.charAt(contextUrlPath.length - 1) != "/") {
  			contextUrlPath = contextUrlPath.substring(0, contextUrlPath.lastIndexOf("/") + 1);
  		}
  
  		return contextUrlPath + url;
  	}
docs: --[ resolveUrl() ]--------------------------------------------------- Converts a URL fragment to a fully qualified URL using the specified context URL. Returns null if same-origin policy is broken