$ (function () {

	if ($.browser.msie && $.browser.version < 7) {
		$ ("input").each (function () {
			$ (this).addClass ($ (this).attr ("type"));
		});
	}

	$ ("img.hover").each (function () {
		(new Image).src = this.src.replace (/\.(gif|jpg)$/, "_hover." + "$1");
	});
	$ ("img.hover").parents ("a").hover (function () {
		$ ("img.hover", this).each (function () {
			this.src = this.src.replace (/\.(gif|jpg)$/, "_hover." + "$1");
		});
	}, function () {
		$ ("img.hover", this).each (function () {
			this.src = this.src.replace (/_hover\.(gif|jpg)$/, "." + "$1");
		});
	});

	$ ("input.hover").each (function () {
		(new Image).src = this.src.replace (/\.(gif|jpg)$/, "_hover." + "$1");
	});
	$ ("input.hover").parents ("span").hover (function () {
		$ ("input.hover", this).each (function () {
			this.src = this.src.replace (/\.(gif|jpg)$/, "_hover." + "$1");
		});
	}, function () {
		$ ("input.hover", this).each (function () {
			this.src = this.src.replace (/_hover\.(gif|jpg)$/, "." + "$1");
		});
	});

	$ ("form div.field").each (function () {
		if (! $ (this).find (":button, :image, :password, :reset, :submit, :text, select, textarea").size ()) {
			$ (this).addClass ("compact-field");
		}
	});

});