$(document).ready(function(){
	$('#text').height($(window).height() - 176);
	$('#content').height($(window).height() - 176);
	$('select[name="lg"]').hide();
	$('.left_part .form select[name="mod"]').hide();
	$('.form input[type="submit"]').css('background-image', 'url(/images/search.jpg)');
	$('.form input[type="submit"]').css('height', '22px');
	$('.form input[type="submit"]').css('width', '22px');
	$('.form input[type="submit"]').attr('value', '');
	$('.form input[type="submit"]').css('cursor', 'pointer');
	$('.form input[type="submit"]').css('border', 'none');
	
	$('.form input[name="keywords"]').css('width', '110px');
	if (window.location.pathname.substr(1, 2) == 'fr' ) {
		$('.form input[name="keywords"]').attr('value', 'Insérer un mot clé');
		$('.form input[name="keywords"]').click(function() {
			if ($(this).attr('value') == 'Insérer un mot clé')
				$(this).attr('value', '');
		});
		$('.form input[name="keywords"]').blur(function() {
			if ($(this).attr('value') == '')
				$(this).attr('value', 'Insérer un mot clé');
		});
	} else {
		$('.form input[name="keywords"]').attr('value', 'Suchbegriff');
		$('.form input[name="keywords"]').click(function() {
			if ($(this).attr('value') == 'Suchbegriff')
				$(this).attr('value', '');
		});
		$('.form input[name="keywords"]').blur(function() {
			if ($(this).attr('value') == '')
				$(this).attr('value', 'Suchbegriff');
		});
	}
	
	$("#menu li").hover(function(){
		$('>ul', this).fadeIn('fast');
	}, function(){
		$('>ul', this).fadeOut('slow');
	});

	$(window).resize(function(){
		$('#text').height($(window).height() - 176);
		$('#content').height($(window).height() - 176);
	});
	
	$('#top').click(function(){
		$("#text").scrollTop(0);
	});
	
	if (window.location.pathname.substr(3, 5) != 'print' ) {
		$("#text").hover(function () {
			if ( $(this).css("z-index") == "9999" )
			$(this).css("overflow","visible");
		},
		function () {
			if ( $(this).css("z-index") != "9999" )
			$(this).css("overflow","auto");
		});
	}
});