;(function($) {
	
	$.extend($.expr[":"], {
		"containsNC": function(elem, i, match, array) {
			return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3]).toLowerCase()) >= 0;
		},
		"containsExactly": function(elem, i, match, array) {
			return (elem.textContent || elem.innerText || "").indexOf(match[3]) == 0 && (elem.textContent || elem.innerText || "").length == match[3].length;
		},
		"containsExactlyNC": function(elem, i, match, array) {
			return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3]).toLowerCase()) == 0 && (elem.textContent || elem.innerText || "").length == match[3].length;
		}
	});
	
	$.extend({
		isInt: function(x) {
			var y = parseInt(x);
			if (isNaN(y)) return false;
			return x == y && x.toString() == y.toString();
		},
		dump: function(obj) {
			var msg = "";
			
			var undefinedList = "";
			var functionsList = "";
			var objectsList = "";
			
			// Go through all the properties of the passed-in object
			for (var i in obj) {
				if (typeof obj[i] == 'undefinedList') {
					if (undefinedList != '') undefinedList += ', ';
					undefinedList += i;
				}
				else if (typeof obj[i] == 'function') {
					if (functionsList != '') functionsList += ', ';
					functionsList += i;
				}
				else if (typeof obj[i] == 'object') {
					if (objectsList != '') objectsList += ', ';
					objectsList += i;
				}
				else {
					msg += i + ": " + obj[i] + "\n";
				}
			}
			msg += "\nFunctions: " + functionsList;
			msg += "\n\nObjects: " + objectsList;
			msg += "\n\nUndefined: " + undefinedList;
			return msg;
		}
	});
	
})(jQuery);