Corrected RegExp to account for protocol-relative, path-absolute href

When using one or more scheme-relative (a.k.a. protocol-relative + path-absolute) URLs one may encounter security errors in the console that look similar to the one below (from Chrome):

> XMLHttpRequest cannot load (my file).css. No 'Access-Control-Allow-Origin' header is
> present on the requested resource. Origin '(origin of my file)' is therefore not allowed
> access. 

This appears to be because the code in $.fn.parsecss identifies these as relative since they do not include a scheme. However, they may refer to a different host, so they can still potentially trigger same-origin security violation errors. 

One solution is to change the regular expression used such that any URL that begins with two slashes, optionally preceded by non-slash characters (e.g. http: or https:) should be considered absolute and thus ignored. The following code demonstrates this pattern:

// Simple demo showing the difference between these regular expressions
var urls = ["/about/",
	"http://www.example.com/about/",
	"https://www.example.com/about/",
	"//www.example.com/about/"
];
var oldPattern = /^\w+:/;
var newPattern = /^[^\/]*\/\//;
for (var i=0; i < urls.length; i++) {
	var oldResult = oldPattern.test(urls[i]);
	var newResult = newPattern.test(urls[i]);
	console.log("Old: " + oldResult + ", New: " + newResult);
	if (oldResult != newResult)
		console.log("Patterns yield different results for URL: " + urls[i]);
}

/* Console output

	Old: false, New: false
	Old: true, New: true
	Old: true, New: true
	Old: false, New: true
	Patterns yield different results for URL: //www.example.com/about/ 

*/


However, it is also possible that the URL actually does refer to the same domain, in which case it would not trigger a security error. I have written a boolean function called hasSameOrigin that takes 1 argument (a URL string) and compares its protocol, hostname, and port number with window.location. It returns false if the origins differ and true otherwise. 
See http://jsfiddle.net/35Jku/35/ for a demonstration/test of this function.

Finally, I replaced the previous RegExp test for absolute URLs in $.fn.parsecss with a call to this function.