(function($) {$.mediaconceptulm = function(src, options, callback) {var settings = {centeredX: true,centeredY: true,speed: 0},rootElement = ("onorientationchange" in window) ? $(document) : $(window),imgRatio, bgImg, bgWidth, bgHeight, bgOffset, bgCSS;if(options && typeof options == "object") $.extend(settings, options);$(document).ready(_init);return this;function _init() {if(src) {var container = $("<div />").attr("id", "mediaconceptulm").css({left: 0, top: 0, position: "fixed", overflow: "hidden", zIndex: -9999}),img = $("<img />").css({position: "relative", display: "none"}).bind("load", function(e) {var self = $(this);imgRatio = $(e.target).width() / $(e.target).height();_adjustBG(function() {self.fadeIn(settings.speed, function(){if(typeof callback == "function") callback();});});}).appendTo(container);$("body").prepend(container);img.attr("src", src);$(window).resize(_adjustBG);}}function _adjustBG(fn) {try {bgCSS = {left: 0, top: 0};bgWidth = rootElement.width();bgHeight = bgWidth / imgRatio;if(bgHeight >= rootElement.height()) {bgOffset = (bgHeight - rootElement.height()) /2;if(settings.centeredY) $.extend(bgCSS, {top: "-" + bgOffset + "px"});} else {bgHeight = rootElement.height();bgWidth = bgHeight * imgRatio;bgOffset = (bgWidth - rootElement.width()) / 2;if(settings.centeredX) $.extend(bgCSS, {left: "-" + bgOffset + "px"});};$("#mediaconceptulm img").width( bgWidth ).height( bgHeight ).css(bgCSS);} catch(err) {};if (typeof fn == "function") fn();}};})(jQuery);
$(document).ready(function() {$('div.head-container').append("<div class='live-chat'></div>");$('div.live-chat').load("include/live-chat.php");$.fn.swapImg = function( src, alt ) {var $img = this;var actions = 2;var img = $('<img src="' + src + '" />').load(next);$img.fadeTo(300, 0.0, next);function next() {if(--actions) return;$img.attr({ src: src, alt: alt }).fadeTo( 800, 1.0 );}};$('div.content').hide();$('div.content').delay(800).slideToggle('normal');$('.content-button').hide();
var container = $('#additional');container.hide();$('.footer-navigation a').click(function(event){if($(this).hasClass("active")){$('.footer-navigation a').removeClass("active");container.slideUp('slow',function(){container.load('include/empty.php');});}else{$('.footer-navigation a').removeClass("active");$(this).addClass("active");if(container.is(':visible')){container.slideUp('slow',function(){container.load('include/empty.php',function(){container.load('include/' + event.target.id + '.php #content',function(){$.getScript('js/buchung.js',function(){container.slideDown('slow');});})});});}else{container.load('include/' + event.target.id + '.php #content',function(){$.getScript('js/buchung.js',function(){container.slideDown('slow');});})}}});$('div.content-button a.content-slide').click(function(){$('div.content-button').slideToggle('slow',function(){$('div.content').slideToggle('slow');});});$('div.content-slide a.content-slide').click(function(){$('div.content').slideToggle('slow',function(){$('div.content-button').slideToggle();});});
$.fn.mediaconceptulmBg = function(meineDaten){var imageIdx = 0;var images = meineDaten;function whichSide(e){var side = "";var imagePos = $('#mediaconceptulm img').offset();var imageWidth = $('#mediaconceptulm img').width();var imageCenter = imageWidth / 2;var mouseRelX = e.pageX - imagePos.left;var mouseRelY = e.pageY - imagePos.top;if(mouseRelX < imageCenter){side = 'left';$('.image-navigation span').removeClass('right-active');$('.image-navigation span.left').addClass('left-active');$('#mediaconceptulm img').css({'cursor': 'w-resize'});}else{side = 'right';$('.image-navigation span').removeClass('left-active');$('.image-navigation span.right').addClass('right-active');$('#mediaconceptulm img').css({'cursor': 'e-resize'});}return side;}$('#mediaconceptulm img').mousemove(function(e){whichSide(e);});
$('#mediaconceptulm img').click(function(e){switch(whichSide(e)){case "left": imageIdx--; break;case "right": imageIdx++; break;default:}if(imageIdx < 0){imageIdx = images.length - 1;}if(imageIdx >= images.length){imageIdx = 0;}$('#mediaconceptulm img').swapImg("images/" + images[imageIdx]);});$('.image-navigation span.left').click(function(e){imageIdx--;if(imageIdx < 0){imageIdx = images.length - 1;}if(imageIdx >= images.length){imageIdx = 0;}$('#mediaconceptulm img').swapImg("images/" + images[imageIdx]);});$('.image-navigation span.right').click(function(e){imageIdx++;if(imageIdx < 0){imageIdx = images.length - 1;}if(imageIdx >= images.length){imageIdx = 0;}$('#mediaconceptulm img').swapImg("images/" + images[imageIdx]);});};});
