$(document).ready(function() {

/* oeffnet markierte Links statt im neuen Fenster in einem IFrame */

	var ua = $.browser;
	if (!((ua.msie) && (ua.version.slice(0,1) == 6))) {
		var diashow = $('a[rel="loader_iframe"]');
		if (diashow.length != 0) {
			$("body").prepend('<div id="overlay"></div><div id="container"></div>');
			diashow.click(function(e) {
				e.preventDefault();
				var url = $(this).attr("href");
				var title = $(this).attr("title");
				var height = $(window).height() - 30;
				var poswidth = Math.round(($(window).width() - 960) / 2);
				$("#overlay").fadeIn("slow").click(function(e) {
					$(this).fadeOut("slow");
					$("#container").empty().css("display", "none");
				});
				$("#container").css("left", poswidth).fadeIn("slow").prepend('<div id="loader_title">'+title+'</div><div id="loader_close">Fenster schließen</div><iframe id="loader_iframe" src="'+url+'" frameborder="0" width="960" height="'+height+'"/>');
				$("#loader_close").click(function(e) {
					$("#overlay").fadeOut("slow");
					$("#container").empty().fadeOut("slow");
				});
			});
			$(window).resize(function() {
				if ($("#loader_iframe").length == 1) {
					height = $(window).height() - 30;
					$("#loader_iframe").attr("height", height);
					poswidth = Math.round(($(window).width() - 960) / 2);
					$("#container").css("left", poswidth);
				}
			});
		}
	}
});

