jQuery.extend(jQuery.fn, {
	css: function( key, value ) {
		return (key.constructor == Array) ?			
			jQuery.curCSS(this.get(0), key):
			this.attr( key, value, "curCSS" );
	}
});
jQuery.extend(jQuery, {
	curCSS: function(elem, props, force) {
	
		if(!elem) return;
	
		if(props.constructor == String) props = [props];
	
		if(document.defaultView && document.defaultView.getComputedStyle)
			var cur = document.defaultView.getComputedStyle(elem, null);
	
		var camel, hyphen, prop, r = { 
			toString: function() {
				var r = [];
				for(var prop in this) {
					if(this[prop].constructor == Function) continue;
					r.push(prop.replace(/([A-Z])/g ,"-$1").toLowerCase());
					r.push(': ', this[prop], '; ');
				}
				return r.join('');
			}
		};
		
		for(var i = 0; props[i]; i++) {
			prop = props[i];
			hyphen = prop.replace(/([A-Z])/g ,"-$1").toLowerCase();
			camel = prop.replace(/\-(\w)/g, function(m, n) { return n.toUpperCase(); });
			if(!force && elem.style[camel]) {
				r[camel] = elem.style[camel];
			} else if(camel == 'height' || camel == 'width') {
				r[camel] = jQuery.css(elem, camel) + 'px';
			} else if(document.defaultView && document.defaultView.getComputedStyle) {
				switch(prop) {
				case 'float':
				case 'styleFloat':
					camel = 'cssFloat';
				default:
					if (cur) {
						r[camel] = cur.getPropertyValue(hyphen);
					} else if(camel == 'display') {
						r[camel] = 'none';
					} else {
						jQuery.swap(elem, { display: 'block' }, function() {
							r[camel] = document.defaultView.getComputedStyle(this,null).getPropertyValue(hyphen);
						});						
					}
					break;
				}
			} else if(elem.currentStyle && !window.opera) {
				switch(camel) {
				case 'opacity':
					r[camel] = jQuery.attr(elem.style, 'opacity');
					break;
				case 'float':
				case 'cssFloat':
					camel = 'styleFloat';
				case 'default':
					r[camel] = elem.currentStyle[camel];
					break;
				}
			} 
		}		
		if(props.length == 1) return r[camel];
		return r;	
	}
});
