+if ( !window.$ )
+ var $ = jQuery;
+
+/*
+ * Handle support for overriding other $() functions. Way too many libraries
+ * provide this function to simply ignore it and overwrite it.
+ */
+else
+ var $ = function(a,c) {
+ // Check to see if this is a possible collision case
+ if ( !c && a.constructor == String &&
+
+ // Make sure that the expression is a colliding one
+ !/[^a-zA-Z0-9_-]/.test(a) &&
+
+ // and that there are no elements that match it
+ // (this is the one truly ambiguous case)
+ !document.getElementsByTagName(a).length ) {
+
+ // Only return the element if it's found
+ var obj = document.getElementById(a);
+ if ( obj ) return obj;
+
+ }
+
+ return jQuery(a,c);
+ };