function initForm()
{
	//alert('Inside initForm()');
	
	$('input, select, textarea').focus(function() {
		$(this).addClass('focus').parents('label').addClass('focus');
		$(this).addClass('focus').parents('tr').addClass('rowhover').addClass('activeRow');
	}).blur(function() {
		$(this).removeClass('focus').parents('label').removeClass('focus');
		$(this).removeClass('focus').parents('tr').removeClass('rowhover').removeClass('activeRow');
	});
	
	//Add support for row highlighting in pre-IE7 browsers
	if ($.browser.msie && $.browser.version < 7) {
		$('tr').hover(function() {
			$(this).addClass('rowhover');
		}, function() {
			/* The 'activeRow' class is only used to fixup IE6 behavior */
			if (!$(this).hasClass('activeRow')) {
				$(this).removeClass('rowhover');
			}
		});
	}
	
	//Override the default e-mail validation because it's lousy
	jQuery.validator.methods.email = function(value, element) {
		//https://www.intheround.net/wiki/Regular_Expressions#E-mail
		return this.optional(element) || /^([a-zA-Z0-9\_\.\-]){2,}\@(([a-zA-Z0-9\-]){2,}\.)+([a-zA-Z0-9]{2,4})$/i.test(element.value);
	};
}

$(document).ready(function() {
	initForm();
});
