$(document).ready(function() {
	var sg = 2;
	
	// Bei Klick auf Gr?sser Button 
	$("#FontLarge").click(function() {
		if (sg==1) {
			$("img#Schriftgroesse").attr("src", "fileadmin/templates/images/schriftgr_2.gif" );
			//$('body').addClass('medium');
			$('body').animate({fontSize: '15px',},	'slow');
			$("div#content_wrap").css("background", "#fff none");
			$("div#content_main").css("margin", "0 17em 0 237px");
			$("div#content").css("background", "url('fileadmin/templates/images/baum.gif') no-repeat scroll left bottom transparent");
			sg++;
			return false;
		} else if (sg==2) {
			$("img#Schriftgroesse").attr("src", "fileadmin/templates/images/schriftgr_3.gif" );
			//$('body').removeClass('medium').addClass('large');
			$('body').animate({fontSize: '17px',},	'slow');
			$("div#content_wrap").css("background", "#fff none");
//			$("div#content_main").css("margin", "0 18em");
			$("div#content_main").css("margin", "0 18em 0 272px");
			$("div#content_main").css("padding-left", "20px");
			$("div#content").css("background", "url('fileadmin/templates/images/baum.gif') no-repeat scroll 38px bottom transparent");
			sg++;
			return false;
		}
		 return false;
	 });
	 
	 // Bei Klick auf Kleiner Button 
	 $("#FontSmall").click(function() {
		 if (sg==3) {
			$("img#Schriftgroesse").attr("src", "fileadmin/templates/images/schriftgr_2.gif" );
			//$('body').removeClass('large').addClass('medium');
			$('body').animate({fontSize: '15px',},	'slow');
			$("div#content_wrap").css("background", "#fff none");
			$("div#content_main").css("margin", "0 17em 0 237px");
			$("div#content_main").css("padding-left", "20px");
			$("div#content").css("background", "url('fileadmin/templates/images/baum.gif') no-repeat scroll left bottom transparent");
			sg--;
			return false;
		} else if (sg==2) {
			$("img#Schriftgroesse").attr("src", "fileadmin/templates/images/schriftgr_1.gif" );
			//$('body').removeClass('medium').removeClass('large');
			$('body').animate({fontSize: '13px',},	'slow');
//			$("div#content_wrap").css("background", "#fff url('fileadmin/templates/images/bg_content.gif') repeat-y");
			$("div#content_wrap").css("background", "#fff");
			$("div#content_main").css("margin","0 20em 0 240px");
			$("div#content_main").css("padding-left", "20px");
			sg--;
			return false;
		}
		 return false;
	 });
	 
	 // Hover f?r Kleiner Button
	$("#FontSmall img").hover(
		function (){
			$("#FontSmall img").attr("src", "fileadmin/templates/images/button_schriftgr_kl_m.gif" );
		},
		function () {
			$("#FontSmall img").attr("src", "fileadmin/templates/images/button_schriftgr_kl_i.gif" );
		}
	);
	 // Hover f?r Gr?sser Button
	$("#FontLarge img").hover(
		function (){
			$("#FontLarge img").attr("src", "fileadmin/templates/images/button_schriftgr_gr_m.gif" );
		},
		function () {
			$("#FontLarge img").attr("src", "fileadmin/templates/images/button_schriftgr_gr_i.gif" );
		}
	);
	
	// Skalierung s?mlicher Bilder bzw. Umwandlung von px in em
	/*$("#content_main img, #start_content_main img").each(function () {
		var imgheight = $(this).attr("height") / 13 +"em";
		var imgwidth = $(this).attr("width") / 13 +"em";
		$(this).removeAttr("height");
		$(this).removeAttr("width");
		$(this).css({"height":imgheight,"width":imgwidth});
	});*/
	
	// Bildaustausch f?r Vorlesefunktion
	$("img.vrweb_img").attr("src", "fileadmin/templates/images/button_sound.gif");
	
	// Anchor Tag vor Tabausgabe und in jedem Tablink setzen
	$(".tx-sbtab-pi1").before("<a href='#sbtab'></a>");
	$("#sbtab a").each(function() {
		var link = $(this).attr("href");
		$(this).attr("href", link + "#sbtab");
	});
	
	// Landingpage Siegel
	$("div#one").hover(function() {
		$(this).children("a").hide();
		$(this).children("span").show();
		
	}, function() {
		$(this).children("span").hide();
		$(this).children("a").show();
	});
	
	$("div#two").hover(function() {
		$(this).children("a").hide();
		$(this).children("span").show();
		
	}, function() {
		$(this).children("span").hide();
		$(this).children("a").show();
	});
	
	$("div#three").hover(function() {
		$(this).children("a").hide();
		$(this).children("span").show();
		
	}, function() {
		$(this).children("span").hide();
		$(this).children("a").show();
	});
	
	$("table.landingpage_formular input").focus(function() {
		$(this).css("background-color", "#eee");
	});

	$("table.landingpage_formular input").blur(function() {
		$(this).css("background-color", "#fff");
	});
	
});

function reinit() {
	jwplayer('player71326759dd2cba95f78232b601880eed').remove(); 
	jwplayer("player71326759dd2cba95f78232b601880eed").setup({ 
		flashplayer: "http://www.immokasse.de/typo3conf/ext/rgmediaimages/res/player-licensed.swf", 
		streamer: "rtmp://streaming.immokasse.de/cfx/st",
		file: "mp4:ntvfilm.mp4", 
		provider: "rtmp",
		height: 370, 
		width: 395,
		autostart: false
		

	}); 
}

function reinit2() {
jwplayer("player2ad3a4f934d5e4975f43646eec55844f").remove();
jwplayer("player2ad3a4f934d5e4975f43646eec55844f").setup({ 
		flashplayer: "http://www.immokasse.de/typo3conf/ext/rgmediaimages/res/player-licensed.swf", 
		streamer: "rtmp://streaming.immokasse.de/cfx/st",
		file: "mp4:ImmoKasse-Videofilm.flv", 
		provider: "rtmp",
		height: 370, 
		width: 395,
		autostart: false
	}); 
}

