$(document).ready(function() {
	
	//call some functions
	background_teaser();
	navi_separators();
	
	//add some css properties
	$("#mainnav li:first").addClass("li-first");
	$("#mainnav li:last").addClass("li-last");
	$(".subnav a:last").css("border", "none");
	
	//give subnav padding when children are present
	var subnav = $(".subnav");
	
	if (subnav.children().length > 0) {
		subnav.css("padding-top", "20px");
	}
	
	//mouseover effect in footer teaser
	$('.footer-teaser').hover(function(){
		$(".cover", this).stop().animate({top:'-200px'},{queue:false,duration:300});
	},
	function() {
		$(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300});
	});
	
});

/**
 * News teaser, same height as image
 */
var background_teaser = function() {
	$(".background-teaser").each(function() {
		
		var $this = $(this);
		
		var img = $this.children(".background-teaserimg");
		var con = $this.children(".background-teaser-content");
		
		var height_tmp = img.height();
		var height = height_tmp - 25;
		
		con.css("height", height);
	});
}

/**
 * Separator in navigation
 */
var navi_separators = function() {
	
		var li = $("#mainnav li");
		
		li.each(function() {
			
			$("<span></span>").appendTo(this);
			
		});
		
		$("#mainnav li:first span").remove();
}
