$(function() {
	// Add menu functionality
	$('ul#menu li ul').hide();
	$('ul#menu li.selected > ul').show();
	$('ul#menu li').hover(
		function() {
			$(this).parent('ul').children('li').children('ul').hide();
			$(this).children('ul').show();
		},
		function() {
			$(this).children('ul').hide();
		}
	);
	$('ul#menu').hover(
		function() {},
		function() {
			$('ul#menu li.selected > ul').show();
		}
	);
	
	// Add classes for odd and even table rows
	$('table tr:even').addClass('even');
	$('table tr:odd').addClass('odd');
	
	// Add interactive domain search field
	var str = 'dittdomene.no';
	$('#domainQuery').val(str);
	$('#domainQuery').focus(function() {
		if ($(this).val() == str) {
			$(this).val('');
		}
	});
	$('#domainQuery').blur(function() {
		if ($(this).val() == '') {
			$(this).val(str);
		}
	});
	
	// Have form messages appear before the form
	var fm = $('.form_messages');
	fm.parent().prepend(fm);
});

