$(document).ready(function () { /* BannerList */ if ($('#bannerList').length != 0) { $("#bannerList").shuffle(); } /* Start testimonies */ function shuffleTestimonies(e) { var replace = $('
'); var rand = Math.floor(Math.random() * e.size()); var temp = e.get(rand); replace.append(temp); $('#shuffleStartTestimonies').html(replace.html() ); } shuffleTestimonies( $('#shuffleStartTestimonies div') ); if ($('.birthDate').length != 0) { $('.birthDate').blur(function() { var d = $(this).val(); var dateParts = new Date((Number(d.split("-")[0])), (Number(d.split("-")[1]) - 1), (Number(d.split("-")[2]))); var dateis = dateParts.getTime(); var dateTime = dateis; var dateTimeStart = dateis; $(this).next().val(dateis); }); } /* Gallery */ if ($('#objectUspSlideshow').length != 0) { Galleria.loadTheme('/fw2011/js/galleria/themes/classic/galleria.classic.min.js'); $("#objectUspSlideshow").galleria({ transition: 'fade', _toggleInfo: false, width: 940, height: 345 }); } /*if ($('#objectSlideshow').length != 0) { Galleria.loadTheme('/fw2011/js/galleria/themes/classic/galleria.classic.js'); $("#objectSlideshow").galleria({ transition: 'fade', _toggleInfo: true, width: 'auto', height: 525 }); }*/ /* Clear textboxes */ $('.clearTextBox').focus(function () { if ($(this).val() == $(this)[0].title) { $(this).addClass("clearTextBoxFocus"); $(this).val(""); } }).blur(function () { if ($(this).val() == '') { $(this).removeClass("clearTextBoxFocus"); $(this).val($(this)[0].title); } }); $(".searchForm").submit(function() { retValue = true; $(this).find('input[name="search.all.expression"]').each(function( index ) { if($(this).val() == "" || $(this).val() == $(this).attr("title")) { retValue = false; $(this).select(); } }); return retValue; }); if ($('a.fancy').length != 0) { $("a.fancy").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'cyclic' : true, 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return 'Bild ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '   ' + title : '') + ''; } }); } /* Google Maps */ var center = new google.maps.LatLng(58.5946794, 16.207095600000066); var pin = new google.maps.LatLng(58.5946794, 16.185095600000068); var myOptions = { zoom: 13, center: center, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false }; var map = new google.maps.Map(document.getElementById("gmap"), myOptions); var marker = new google.maps.Marker({ map: map, draggable: true, animation: google.maps.Animation.DROP, position: pin }); /* Product Webshop */ /* CHANGE MOVIE SIZE */ if ($('.container').length != 0) { $(".container").fitVids(); } $("[role='navigation']").flexNav({ 'breakpoint' : ' 52.75em', 'animationSpeed' : 'fast' }); }); function initCalendarChangeButton(){ /* MONTH CALENDAR */ $('.cn_button').click(function(){ $('#monthCalendarContent .wrap_calendar').fadeOut(); var hrefVal = $(this).attr('href'); hrefVal = hrefVal.replace("default.jsp", "/fw2011/3.0/calendar/monthCalendarAjax.jsp"); $('#monthCalendarContent').load(hrefVal, function() { initCalendarChangeButton(); $('#monthCalendarContent').fadeIn(); } ); return false; }); /* WEEK LINKS */ $('.cn-smallWeekbutton').click(function(){ $('#loading').fadeIn(); var hrefVal = $(this).attr('href'); hrefVal = hrefVal.replace("default.jsp", "/fw2011/3.0/calendar/calendarListAjax.jsp"); $('#weekCalendarContent').load(hrefVal, function() { initCalendarChangeWeekButton(); $('#weekCalendarContent').fadeIn(); $('html, body').animate({ scrollTop: $("#weekCalendarContent").offset().top }, 500); $('#loading').fadeOut(); } ); return false; }); } function initCalendarChangeWeekButton(){ /* WEEK CALENDAR */ $('.cn-Weekbutton').click(function(){ $('#loading').fadeIn(); var hrefVal = $(this).attr('href'); hrefVal = hrefVal.replace("default.jsp", "/fw2011/3.0/calendar/calendarListAjax.jsp"); $('#weekCalendarContent').load(hrefVal, function() { initCalendarChangeWeekButton(); $('#weekCalendarContent').fadeIn(); $('#loading').fadeOut(); } ); return false; }); } function initCalendar() { initCalendarChangeButton(); initCalendarChangeWeekButton(); }