document.write ("<script type='text/javascript' src='/common/script/swfobject.js'></script>");

$ (function () {

	if ($.browser.msie) {
		$ ("body :last-child").addClass ("last-child");
		if ($.browser.version < 7) {
			$ (":first-child").addClass ("first-child");
			$ ("input").each (function () {
				$ (this).addClass ($ (this).attr ("type"));
			});
		}
	}

	$ (".external").attr ("target", "_blank");

	$ ("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 () {
		$ ("<img>").attr ("src", this.src.replace (/\.([^.]+)$/, "_hover." + "$1")).appendTo ("body").hide ();
		$ (this).hover (function () {
			this.src = this.src.replace (/\.([^.]+)$/, "_hover." + "$1");
		}, function () {
			this.src = this.src.replace (/_hover\.([^.]+)$/, "." + "$1");
		});
	});

	$ ("form div.field").each (function () {
		if (! $ (this).find (":button, :image, :password, :reset, :submit, :text, select, textarea").size ()) {
			$ (this).addClass ("compact-field");
		}
	});

	$ ("span.marker").parent ().parent ().each (function () {
		var marker = $ (this).children ().children ("span.marker");
		var width = 0;
			marker.each (function () {
			width = Math.max (width, $ (this).css ("display", "inline").width () - parseInt ($ (this).css ("text-indent")));
		});
		var margin = (parseInt ($ (marker [0]).css ("margin-right")) + width) + "px";
		$ (this).css ("margin-left", margin);
		marker.width (width).css ("margin-left", "-" + margin);
	});


});
