if (typeof isScreenBlocked == 'undefined') { var isScreenBlocked = false; } function blockScreen() { if (!isScreenBlocked) { isScreenBlocked = true; $.blockUI( { message: '
Please wait ...
', css: { backgroundColor: '#fff',border: '4px solid #000', width: '200px', left: (jQuery(window).width() - 200) /2 + 'px' }, overlayCSS: { backgroundColor: '#000' }, fadeIn:0, baseZ: 10000 }); } } function unblockScreen() { $.unblockUI({fadeOut:0}); isScreenBlocked = false; } var isSwitchingTheme = false; var shakeThumb = true; function scrollToAnker(anker, offset) { var target = $("a[name='"+anker+"']"); var top = target.offset().top; if ($.browser.opera) { var target = 'html'; }else{ var target = 'html,body'; } var offset = 0; var maskHeight = $(".container_mask").height(); if (maskHeight > 0) offset = maskHeight; $(target).animate({scrollTop: top-offset}, 500); } function scrollToTop() { $('html,body').animate({scrollTop: 0}, 500); } function setTheme(themeName) { if (!isSwitchingTheme) { isSwitchingTheme = true; $.post( "/homepage/ajax/ajax.php", { type: "SET_BACKGROUND", themeName: themeName }, function(data) { if (data != "") { $("body").attr("class","kima_"+data); $("div.container_mask").attr("id","mask_"+data); if (data == "red") { $(".theme_red_font").addClass("theme_font_white"); $("a.link_left").addClass("theme_font_white"); } else { $(".theme_red_font").removeClass("theme_font_white"); $("a.link_left").removeClass("theme_font_white"); } } isSwitchingTheme = false; }); } } function shakeThumbs() { if (shakeThumb) { var thumbs = $(".thumb img"); var position = Math.ceil(Math.random()* thumbs.length); $(thumbs[position-1]).animate({"top":"2px"},20,function(){ $(thumbs[position-1]).animate({"left":"2px"}, 20, function(){ $(thumbs[position-1]).animate({"top":"-2px"}, 20, function(){ $(thumbs[position-1]).animate({"left":"-2px"}, 20, function(){ $(thumbs[position-1]).animate({"top":"0px"}, 20, function(){ $(thumbs[position-1]).animate({"left":"0px"}, 20, function(){ }); }); }); }); }); }); } } function fadeAnmeldung() { $("a.color_fade").animate({'color': "#DF3737"},1000, function(){ $("a.color_fade").animate({'color': "#fff"},1000); }); } $(document).ready( function() { $('ul.sf-menu').supersubs({ minWidth: 12, // minimum width of sub-menus in em units maxWidth: 27, // maximum width of sub-menus in em units extraWidth: 2 // extra width can ensure lines don't sometimes turn over // due to slight rounding differences and font-family }).superfish({ delay: 0 }); $("body").noContext(); if ($('.fade img').length > 1) { $('.fade').innerfade({ speed: 500, timeout: 7000, containerheight: '170px' }); } $("._blank").attr("target", "_blank"); $(".kima_tooltip").hover(function() { var left = Math.floor($(this).position().left + ($(".kima_tooltip").width()/2)-100); $(this).next("em").css({"left":left}); $(this).next("em").animate({opacity: "show", top: "-75"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-85"}, "fast"); }); $("div.ticker").wrapInner(''); $('div.ticker marquee').after("
"); $('div.ticker marquee').marquee().mouseover(function () { $(this).trigger('stop'); }).mouseout(function () { $(this).trigger('start'); }).mousemove(function (event) { if ($(this).data('drag') == true) { this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX); } }).mousedown(function (event) { $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft); }).mouseup(function () { $(this).data('drag', false); }); $("div.ticker").show(); if ($("a.color_fade.current").length == 0) { setInterval("fadeAnmeldung()", 5000); } }); function openLegalInfo(title, showTextWithID) { blockScreen(); $("#dialog").html(""); $("#dialog").load("/homepage/dialog_legal_info.php?showTextWithID="+showTextWithID).dialog({ close: function(event, ui) { $('#dialog').dialog('destroy'); }, resizable: false, height: 470, width: 700, modal: true, bgiframe: true, title: title }); } function sendNewsletter() { if ($('#newsletterForm').valid()) { blockScreen(); $.post( "/homepage/ajax/ajax.php", { type: "SEND_NEWSLETTER", inputNewsletterEMail: $('#inputNewsletterEMail').val() }, function(data) { unblockScreen(); if (data == 0) { infoDialog("INFORMATION","
Your now subscribed to the KIMA newsletter
Thank you
",150); $('#inputNewsletterEMail').val(""); } else { infoDialog("ERROR","
"+data+"
",150); } } ); } else { infoDialog("ERROR","
Please fill in the red form fields correctly!
",150); } } function openMediaplayer() { fenster = window.open("/homepage/mediaplayer.php", "Mediaplayer", "width=650,height=491,resizable=no"); fenster.focus(); } function getSpecials(silent) { blockScreen(); var special = $('#inputOnlineBuchungTermin').val(); $.post( "/homepage/ajax/ajax.php", { type: "GET_UNTERKUNFT", special: special }, function(unterkunft) { $('#obUnterbringung').html(unterkunft); $.post( "/homepage/ajax/ajax.php", { type: "GET_SPECIALS", special: special }, function(specials) { $('#specials_select').html(specials); initBuchung(); unblockScreen(); if (!silent) infoDialog("INFORMATION","
Specials and accomodation changed to match your chosen Surfari ...
",150); }); }); }