/* Cause all of the inputs of type submit to add a CSS class of "button" 
 * to their existing classes. */
Event.observe(window, "load", function() {
	$A($$("input[type=submit]")).each(function(e) {
		e.className = e.className + ' jt_button';
	});
	$A($$("input[type=button]")).each(function(e) {
		e.className = e.className + ' jt_button';
	});
});

/**
 * fixRightHeight()
 *
 * If the nav panel (jt_content_left) gets taller than the right side, the line
 * between them won't go all the way down to the footer (because it's jt_content_right's
 * left border and jt_content_right doesn't have enough content to fill the extra
 * space. This function explicitly sets the height of jt_content_right to fix
 * that problem.
 *
 * @@@ This part doesn't work in IE:
 * If, however, there is enough content in jt_content_right to meet or exceed
 * the height of jt_content_left, the height style element is nulled out and the
 * browser defines its height.
 *
 * This function is also called from navpanel.js::greenArrowToggle() so that expanding
 * and contracting the sections in the navpanel also correct this problem.
 */
function fixRightHeight() {
	if($('jt_content_right') && $('jt_content_left')) {
		var contentLeft		= $('jt_content_left').getDimensions();
		var contentRight	= $('jt_content_right').getDimensions();

		if(contentRight.height < contentLeft.height) {
			$('jt_content_right').style.height = (contentLeft.height + 10) + 'px';
		} else {
			$('jt_content_right').style.height = null;
		}
	}
}

/* Call fixRightHeight() on window load. */
Event.observe(window, "load", function() { fixRightHeight(); });
