$(document).ready(function() {

	/*
		IE6 specific
		Adds a class focus to elements on which fix is applied when focused
	*/

	function focusfix(selector, className) {
		$(selector).focus(function() {
			$(this).addClass(className);
		});
		// Removes class when focus is lost
		$(selector).blur(function() {
			$(this).removeClass(className);
		});
	}

	focusfix('input.input-text', 'focus');
	focusfix('input.input-password', 'focus');
	focusfix('textarea', 'focus');

	// Some extras needed to make the dropdowns work
	$('#navigation li a').each(function(i) { $(this).html('<b>' + $(this).html() + '</b>'); });
	$('#navigation ul ul li:last-child').parent().append('<li class="ender"><div class="clearfix"><div class="first">&nbsp;</div><div class="middle">&nbsp;</div><div class="last">&nbsp;</div></li>')

	/*
		Searchform
		Once text is entered, keep focus class "on"
	*/

	$('#searchForm input').change(function() {
		if ($('#searchForm input.input-text').attr('value').length > 0) {
			$('#searchForm input.input-text').addClass('keepFocus');
		} else {
			$('#searchForm input.input-text').removeClass('keepFocus');
		}
	});

});

