// Umschalter Anfrage
function schalter(vari) {
	if (vari=='n') {
	document.getElementById('reservierungsanfrage').style.display = 'none';
	document.getElementById('newsletter').style.display = 'inline';
	}
	if (vari=='a') {
	document.getElementById('reservierungsanfrage').style.display = 'inline';
	document.getElementById('newsletter').style.display = 'none';
	}
}


// LIGHTBOX
    $(document).ready(function() {
        $("a[rel='external']").click(function(event){
            window.open($(this).attr("href"));
            event.preventDefault();
        });
       
        $('a[@rel*=lightbox]').lightBox();
        
    });
    
// HOVER FUER MENU
	  $(document).ready(function(){
	  
			$("#nav-one li").hover(
			
				function(e){ 
				    $("ul", this).hide().fadeIn("slow");
				 }, 
				function() {  } 
			);
	  	if (document.all) {
				$("#nav-one li").hoverClass ("sfHover");
			}
	  });
	  
		$.fn.hoverClass = function(c) {
			return this.each(function(){
				$(this).hover( 
					function() { $(this).addClass(c);  },
					function() { $(this).removeClass(c); }
				);
			});
		};	  
// SLIDER FÜR PREISE

$(document).ready(function(){
	
	$(".accordion h5:first").addClass("true");
	$(".accordion div:not(:first)").hide();

	$(".accordion h5").click(function(){
		$(this).next("div").slideToggle("slow")
		.siblings("div:visible").slideUp("slow");
		$(this).toggleClass("true");
		$(this).siblings("h5").removeClass("true");
	});
/*$(document).ready(function(){
	
	$(".accordion h5:first").addClass("active");
	$(".accordion div:not(:first)").hide();

	$(".accordion h5").click(function(){
		$(this).next("div").slideToggle("slow")
		.siblings("div:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h5").removeClass("active");
	});*/
});





// newsletter
function checkNewsFormX5(){
         if(document.emailnlformX5.email.value == ""){
                         alert("Geben Sie bitte Ihre E-Mail Adresse an!");
                         document.emailnlformX5.email.focus();
                         return false;
         }

         if(document.emailnlformX5.name.value == ""){
                         alert("Geben Sie Ihren Namen bekannt!");
                         document.emailnlformX5.name.focus();
                         return false;
         }

         if (EMailVErifyX5(document.emailnlformX5.email.value)) {
         document.emailnlformX5.submit();
         }
         else
         {
         alert("Bitte geben Sie eine gültige E-Mail Adresse an!");
         }
}
function checkEmailX5(){
         if(document.emailnlformX5.email.value == ""){
                         document.emailnlformX5.email.value = "E-Mail Adresse";
         }
}
function EMailVErifyX5(s)
{
          var a = false;
          var res = false;
          if(typeof(RegExp) == "function")
          {
                         var b = new RegExp("abc");
                         if(b.test("abc") == true){a = true;}
                         }

          if(a == true)
          {
                         reg = new RegExp("^([a-zA-Z0-9\-\.\_]+)"+
                                                                                        "(\@)([a-zA-Z0-9\-\.]+)"+
                                                                                        "(\.)([a-zA-Z]{2,4})$");
                         res = (reg.test(s));
          }
          else
          {
                         res = (s.search("@") >= 1 &&
                                         s.lastIndexOf(".") > s.search("@") &&
                                         s.lastIndexOf(".") >= s.length-5)
          }
          return(res);
 }

