﻿
// Hintergrundbild prozentual skalieren

$(document).ready(function() {
	setBackground();
	
	$(window).bind('resize', function() {
		setBackground();
	});
	
});

function setBackground(){
	
	var winHeight = $(window).height();
	var winWidth = $(window).width();
	
	var imgHeight = $('#background img').height();
	var imgWidth = $('#background img').width();
	var ratio = winHeight/winWidth;
	var newHeight = 0;
	var newWidth = 0;
	
	if(winHeight >= winWidth){
		newHeight = winHeight;
		newWidth = winWidth  * ratio;
	}else{
		ratio = winWidth/winHeight;
		newHeight = winHeight * ratio;
		newWidth = winWidth;
	}
	
	$('#background img').css({'height':newHeight + "px", 'width': newWidth + "px"});
}

// Pulldown-Menus

$(document).ready(function(){
	$('#navmenu-h li').hover(
		function() { $('ul', this).css('display', 'block'); },
		function() { $('ul', this).css('display', 'none'); });
	
	$('#navmenu-h li ul li').hover(function(){
		
	});
});
