jQuery.fn.extend({
	
	// Check if element is in the DOM
	inDOM: function() { return !!$(this).parents('html').length; }
	
});

jQuery.extend({

	// Return type of an object
	getType: function(value) {
	    var s = typeof value;
	    if (s === 'object') {
	        if (value) {
	            if (typeof value.length === 'number' &&
	                    !(value.propertyIsEnumerable('length')) &&
	                    typeof value.splice === 'function') {
	                s = 'array';
	            }
	        } else {
	            s = 'null';
	        }
	    }
	    return s;
	}

});