jQuery.fn.log = function(msg) {
	msg = msg || "log";
	console.log("%s: %o", msg, this);

	this.each(function(n){
	id = this.id ? "ID: "+this.id : "";
		console.log("%d: %s.%s %s",n,this.tagName,this.className,id);
	});
	return this;
};

jQuery.fn.exists=function(){
	// if(typeof(this)=='object'){$.log('exists() is object')}
	return this.length>0};
jQuery.fn.isHidden=function(){return this.css('display')=='none'};
jQuery.fn.debug=function(){return this.each(function(){alert(this)})};
jQuery.fn.behaviour=function(c,d){return this.click(function(a){var b=a.target;if($(b).is(c)){return d.call(b)}})};
jQuery.create=function(element,attributes,children){var elem=$(document.createElement(element));if(typeof(attributes)=='object'){for(key in attributes){elem.attr(key,attributes[key]);}}if(typeof(children)=='string'){elem.text(children);}else if(typeof(children)=='object'){for(i=0;i<children.length;i++){elem.append(children[i]);}}return elem;};
jQuery.delegate=function(c){return function(e){var a=$(e.target);for(var b in c)if(a.is(b))return c[b].apply(this,$.makeArray(arguments))}};
