$(document).ready(function () {
	$("html").fadeIn();
	$(".text").hide();
	$(".link").click(function() {
		var item = $(this).next();
		if (item.css("display") == "none") {
			$(".text:visible").slideUp(100).parent().css("z-index",0);
			item.parent().css("z-index",1);
			item.slideDown(100);
		} else {
			item.slideUp(100);
			item.parent().css("z-index",0);
		}
	});
	
	$("#close").click(function() {
		$("#close").fadeOut(500);
		$("#player").fadeOut(500,function () {
			$("#navigation").animate({
				width: "100%"
			},500,"swing");
			$("#content").animate({
				width: "0%"
			},500,"swing")
		});
	});
	
	$("#x-achse").hover(
		function() { $(this).animate({height: "50px"})},
		function() { $(this).animate({height: "10px"})}
	);
	
});


function film_laden(url,img) {

	$("#navigation").animate({
		width: "60%"
	},500,"swing");
	$("#content").animate({
		width: "40%"
	},500,"swing",function() {
	
		if(s1) {
			s1.destroy();
		}
		var s1 = new SWFObject("mediaplayer.swf","mediaplayer","300","240","8");
		s1.addParam("allowfullscreen","true");
		s1.addVariable("width","300");
		s1.addVariable("height","240");
		s1.addVariable("file",url);
		s1.addVariable("image","img/"+img);
		s1.addVariable("autostart",true);
		s1.write("player");
		
		$("#player").fadeIn(500);
		$("#close").fadeIn(500);
	});
}
