
         $(document).ready(function () {
                        $("#weiterempfehlen").fancybox({
                                'opacity' : true,
                                'overlayShow' : true,
                                'overlayColor' : '#000',
                                'overlayOpacity' : 0.8,
                                'transitionIn' : 'elastic',
                                'transitionOut' : 'elastic'
                        });
                        
                        if($("#onlineReservieren").length > 0){
                            $("#onlineReservieren").fancybox({
                                'opacity' : true,
                                'overlayShow' : true,
                                'overlayColor' : '#000',
                                'overlayOpacity' : 0.8,
                                'transitionIn' : 'elastic',
                                'transitionOut' : 'elastic'
                            });
                        }
                        
                        var emailR = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

                        $('#onlineReservierenContent').find('.lbBtn').click(function(){ orcP = true;
                            if ($('#onresName').val() == "") { $('#onresName').css({'background':'#FF9999'}).parent().find('div').css({'color':'#a00'}); orcP = false;}
                            if ($('#onresTel').val() == "") { $('#onresTel').css({'background':'#FF9999'}).parent().find('div').css({'color':'#a00'}); orcP = false;}
                            if (($('#onresIli2').val() == "") || (!emailR.test($('#onresIli2').val()))) { $('#onresIli2').css({'background':'#FF9999'}).parent().find('div').css({'color':'#a00'}); orcP = false;}
                            if(orcP == false) {return false;}
                        });

                        $('#weiterempfehlenContent').find('.lbBtn').click(function(){ orcP = true;
                            if ($('#empfName').val() == "") { $('#empfName').css({'background':'#FF9999'}).parent().find('div').css({'color':'#a00'}); orcP = false;}
                            if (($('#empfIli').val() == "") || (!emailR.test($('#empfIli').val()))) { $('#empfIli').css({'background':'#FF9999'}).parent().find('div').css({'color':'#a00'}); orcP = false;}
                            if(orcP == false) {return false;}
                        });

                        $('#onlineReservierenContent input').not('input.lbBtn').focus(function(){ $(this).css({'background':'#eee'}); $(this).parent().find('div').css({'color':'#333'}); }).blur(function(){$(this).css({'background':'#fff'});});
                        $('#weiterempfehlenContent input').not('input.lbBtn').focus(function(){ $(this).css({'background':'#eee'}); $(this).parent().find('div').css({'color':'#333'}); }).blur(function(){$(this).css({'background':'#fff'});});
                        
                        
                        
                        /*
                        $('#empfName').blur(function(){
                            if ($(this).val() == "") {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                        }).focus(function(){
                                $(this).css({'background':'#eee'});
                                $(this).parent().find('div').css({'color':'#333'});
                        });

                        $('#onresName').blur(function(){
                            if ($(this).val() == "") {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                        }).focus(function(){
                                $(this).css({'background':'#eee'});
                                $(this).parent().find('div').css({'color':'#333'});
                        });

                        $('#onresTel').blur(function(){
                            if ($(this).val() == "") {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                        }).focus(function(){
                                $(this).css({'background':'#eee'});
                                $(this).parent().find('div').css({'color':'#333'});
                        });
                        
                        var emailR = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

                        $('#empfIli').blur(function(){
                            if ($(this).val() == "") {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                            if(!emailR.test($(this).val())) {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                        }).focus(function(){
                                $(this).css({'background':'#eee'});
                                $(this).parent().find('div').css({'color':'#333'});
                        });

                        $('#onresIli2').blur(function(){
                            if ($(this).val() == "") {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                            if(!emailR.test($(this).val())) {
                                $(this).css({'background':'#FF9999'});
                                $(this).parent().find('div').css({'color':'#a00'});
                                return false;
                            }
                        }).focus(function(){
                                $(this).css({'background':'#eee'});
                                $(this).parent().find('div').css({'color':'#333'});
                        });
                        */
             var style = 'easeOutExpo';
             var default_left = Math.round($('#mainNavi li.selected').offset().left - $('#mainNavi').offset().left);
             var default_width = $('#mainNavi li.selected').width();
             $('#box').css({left: default_left});
             $('#box .head').css({width: default_width});
             $('#mainNavi li').hover(function () {
                 left = Math.round($(this).offset().left - $('#mainNavi').offset().left);
                 width = $(this).width();
                 $('#box').stop(false, true).animate({left: left},{duration:500, easing: style});
                 $('#box .head').stop(false, true).animate({width:width},{duration:500, easing: style});
             //if user click on the menu
             }).click(function () {
                 $('#mainNavi li').removeClass('selected');
                 $(this).addClass('selected');
             });
             $('#mainNavi').mouseleave(function () {
                 //Retrieve the selected item position and width
                 default_left = Math.round($('#mainNavi li.selected').offset().left - $('#mainNavi').offset().left);
                 default_width = $('#mainNavi li.selected').width();
                 //Set the floating bar position, width and transition
                 $('#box').stop(false, true).animate({left: default_left},{duration:1500, easing: style});
                 $('#box .head').stop(false, true).animate({width:default_width},{duration:1500, easing: style});
             });


             $('#inpBoxBtn').click(function(){$('#categoryBox').toggle(); catIs = true; $('#categoryBox li.active').css({'background':'#333'});});
             $('#categoryBox').mouseleave(function(){ if(catIs == true) sBox = setTimeout(function(){$('#categoryBox').toggle();}, 1000); catIs = false; });
             $('#categoryBox').mouseover(function(){ clearTimeout(sBox); catIs = true; });

             $('#categoryBox li').hover(function(){
                 $(this).css({'background':'#333'});
             }, function() {
                 $(this).css({'background':'#800'});
                 $('#categoryBox li.active').css({'background':'#333'});
             });

             $('#categoryBox li').click(function(){
                 catIs = false;
                 $(this).css({'background':'#333'});
                 $('#categoryBox li.active').css({'background':'#800'}).removeClass('active');
                 $('#suchCat').attr('value',$(this).html());
                 $('#inpBoxBtn').attr('title',$('#suchCat').val());
                 $(this).addClass('active');
                 $(this).parent().toggle();
             });

             $('#suchen').focus(function(){if ($(this).attr('value') == 'Suchbegriff') $(this).attr('value',''); });
             $('#suchen').blur(function(){if ($(this).attr('value') == '') $(this).attr('value','Suchbegriff');});

             $('#unterMenu li.bgBlack').children('ul').slideDown(0, function(){$(this).addClass('subSubActive');});

             $('#unterMenu li').click(function(){
                 if ($(this).children('ul').is(':hidden')) {
                     $('li.bgBlack').removeClass('bgBlack');
                     $('ul.subSubActive').slideUp(0, function(){$(this).removeClass('subSubActive');});
                     $(this).children('ul').slideDown(0, function(){$(this).addClass('subSubActive');});
                     $(this).addClass('bgBlack');
                 } else if ($(this).children().size() == 0) {
                     $('li.bgBlack').removeClass('bgBlack');
                     $(this).addClass('bgBlack');
                     $('ul.subSubActive').slideUp(0, function(){
                         $(this).removeClass('subSubActive');
                         $(this).parent().removeClass('bgBlack');
                     });
                 }
             });

             //$('.subSubMenu li a').click(function(){$(this).addClass('sslinkActive');});
             
                $('#nwWrapper').nwGalerie({
                    autoPlayDelay: 4500,
                    arrowsNavigation: true,
                    navigation: false,
                    autoPlayFn: true,
                    wechselEffect: 2,
                    effectTime: 1000
                });
         });
         


                    function textEdit(){
                        var myText = document.getElementById('einleitungPrimary').innerHTML;
                        var myTextLength = myText.length;
                        var myTextCenter = 0;
                        lzStop();
                        function lzStop(){
                          if (myTextCenter < myTextLength) {
                            myTextCenter = myTextCenter + 1;
                            nextItem = myText.slice(myTextCenter, myTextCenter+2);
                            if(nextItem != "$$") { lzStop(); } else { myTextCenter = myTextCenter + 2; }
                          }
                        }
                        myTextTeilA = myText.slice(0, myTextCenter-2);
                        myTextTeilB = myText.slice(myTextCenter, myTextLength);
                        $(document).ready(function(){
                            //alert(' cgjdtzjdtz ');
                            $('#einleitungPrimary').toggle();
                            if (myTextCenter < myTextLength) {
                            $('#einleitungSlave').append('<div style="width:315px; float:left; padding:10px; font: 12px/140% Tahoma, Arial, Helvetica, sans-serif; background:#ddd;">' + myTextTeilA + '</div><div style="width:315px; float:left; font: 12px/140% Tahoma, Arial, Helvetica, sans-serif; padding:10px; background:#ddd;">' + myTextTeilB + '</div><div class="clear"></div>').delay(200).css({'background':'#ddd'});
                            } else {
                            $('#einleitungSlave').append('<div style="width:650px; padding:10px; font: 12px/140% Tahoma, Arial, Helvetica, sans-serif;">' + myText + '</div><div class="clear"></div>').delay(200).css({'background':'#ddd'});
                            }
                        });
                    }


                

    var map; var geocoder;

    function initialize() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(52.382595,9.745411), 15);
      geocoder = new GClientGeocoder();
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
    }

    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        //alert("Sorry, we were unable to geocode that address");
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        map.setCenter(point,15);
        GEvent.addListener(marker, 'mouseover', function(){marker.openInfoWindowHtml('<div style="padding-top:8px;padding-left:10px;text-align:left;font-family:Arial,Sans-Serif;font-size:12px;">' + infotext + '</div>');});
      }
    }

    function showLocation(address, fName) {
      infotext = fName;
      geocoder.getLocations(address, addAddressToMap);
    }
    
    


    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
