var Styler = Class.create({
	initialize: function(styles) {
		this.style;
		this.styles = styles;
		
		this._setStyle();
		this.appendStyles();
	},
	_setStyle: function() {
		var b = Prototype.Browser;
		var s = this.styles;
		if (b.IE6) {
			this.style = s.ie6 || {};
		} else if (b.IE7) {
			this.style = s.ie7 || {};
		} else if (b.IE8) {
			this.style = s.ie8;
		} else if (b.Gecko) {
			this.style = s.firefox;
		} else if (b.Opera) {
			this.style = s.opera;
		} else if (b.WebKit) {
			this.style = s.safari;
		} else if (b.MobileSafari) {
			this.style = s.iphone;
		}
	},
	appendStyles: function() {
		for (var key in this.style) {
			this.appendStyle(key, this.style[key]);
		}
	},
	appendStyle: function(element, style) {
		element = (typeof(element) == 'object') ? element : $(element);
		element.setStyle(style);
	}
});

Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
Prototype.Browser.IE7 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 7;
Prototype.Browser.IE8 = Prototype.Browser.IE && !Prototype.Browser.IE6 && !Prototype.Browser.IE7;