function check_Agreement() {
 if (document.getElementById('Agreement').checked == false) { 
   alert("Bitte Einverstaendniserklaerung abgeben!");
   return false;
 }
 else return true;

}



//jQuery.noConflict();
var jq = jQuery.noConflict();


/*
 * clearingInput: a jQuery plugin
 *
 * clearingInput is a simple jQuery plugin that provides example/label text
 * inside text inputs that automatically clears when the input is focused.
 * Common uses are for a hint/example, or as a label when space is limited.
 *
 * For usage and examples, visit:
 * http://github.com/alexrabarts/jquery-clearinginput
 *
 * Licensed under the MIT:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Copyright (c) 2008 Stateless Systems (http://statelesssystems.com)
 *
 * @author   Alex Rabarts (alexrabarts -at- gmail -dawt- com)
 * @requires jQuery v1.2 or later
 * @version  0.1.1
 */

(function (jq) {
  jq.extend(jq.fn, {
    clearingInput: function (options) {
      var defaults = {blurClass: 'blur'};

      options = jq.extend(defaults, options);

      return this.each(function () {
        var input = jq(this).addClass(options.blurClass);
        var form  = input.parents('form:first');
        var label, text;

        text = options.text || textFromLabel() || input.val();

        if (text) {
          input.val(text);

          input.blur(function () {
            if (input.val() === '') {
              input.val(text).addClass(options.blurClass);
            }
          }).focus(function () {
            if (input.val() === text) {
              input.val('');
            }
            input.removeClass(options.blurClass);
          });

          form.submit(function() {
            if (input.hasClass(options.blurClass)) {
              input.val('');
            }
          });

          input.blur();
        }

        function textFromLabel() {
          label = form.find('label[for=' + input.attr('id') + ']');
          // Position label off screen and use it for the input text
          return label ? label.css({position: 'absolute', left: '-9999px'}).text() : '';
        }
      });
    }
  });
})(jQuery);


(function (jq) {
  jq.extend(jq.fn, {
    clearingInputpower: function (options) {
      var defaults = {blurClass: 'blurpower'};

      options = jq.extend(defaults, options);

      return this.each(function () {
        var input = jq(this).addClass(options.blurClass);
        var form  = input.parents('form:first');
        var label, text;

        text = options.text || textFromLabel() || input.val();

        if (text) {
          input.val(text);

          input.blur(function () {
            if (input.val() === '') {
              input.val(text).addClass(options.blurClass);
            }
          }).focus(function () {
            if (input.val() === text) {
              input.val('');
            }
            input.removeClass(options.blurClass);
          });

          form.submit(function() {
            if (input.hasClass(options.blurClass)) {
              input.val('');
            }
          });

          input.blur();
        }

        function textFromLabel() {
          label = form.find('label[for=' + input.attr('id') + ']');
          // Position label off screen and use it for the input text
          return label ? label.css({position: 'absolute', left: '-9999px'}).addClass('blurpower').text() : '';
        }
      });
    }
  });
})(jQuery);


(function (jq) {
  jq.extend(jq.fn, {
    clearingInputNewsletterForm: function (options) {
      var defaults = {blurClass: 'blurNewsletterForm'};

      options = jq.extend(defaults, options);

      return this.each(function () {
        var input = jq(this).addClass(options.blurClass);
        var form  = input.parents('form:first');
        var label, text;

        text = options.text || textFromLabel() || input.val();

        if (text) {
          input.val(text);

          input.blur(function () {
            if (input.val() === '') {
              input.val(text).addClass(options.blurClass);
            }
          }).focus(function () {
            if (input.val() === text) {
              input.val('');
            }
            input.removeClass(options.blurClass);
          });

          form.submit(function() {
            if (input.hasClass(options.blurClass)) {
              input.val('');
            }
          });

          input.blur();
        }

        function textFromLabel() {
          label = form.find('label[for=' + input.attr('id') + ']');
          // Position label off screen and use it for the input text
          return label ? label.css({position: 'absolute', left: '-9999px'}).addClass('blurNewsletterForm').text() : '';
        }
      });
    }
  });
})(jQuery);


/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.2, 09.03.2009
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Changelog:
 *    09.03.2009 Version 1.2
 *    - Update for jQuery 1.3.x, removed @ from selectors
 *    11.09.2007 Version 1.1
 *    - removed noConflict
 *    - added png-support for input type=image
 *    - 01.08.2007 CSS background-image support extension added by Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
 *    31.05.2007 initial Version 1.0
 * --------------------------------------------------------------------
 * @example $(function(){$(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready
 *
 * jQuery(function(){jQuery(document).pngFix();});
 * @desc Fixes all PNG's in the document on document.ready when using noConflict
 *
 * @example $(function(){$('div.examples').pngFix();});
 * @desc Fixes all PNG's within div with class examples
 *
 * @example $(function(){$('div.examples').pngFix( { blankgif:'ext.gif' } );});
 * @desc Fixes all PNG's within div with class examples, provides blank gif for input with png
 * --------------------------------------------------------------------
 */

(function(jq) {

jQuery.fn.pngFix = function(settings) {
	// Settings
	settings = jQuery.extend({
		blankgif: 'fileadmin/templates/_htc/blank.gif'
	}, settings);

	var ie55 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 5.5") != -1);
	var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

	if (jQuery.browser.msie && (ie55 || ie6)) {
		//fix images with png-source
		jQuery(this).find("img[src$=.png]").each(function() {

			jQuery(this).attr('width',jQuery(this).width());
			jQuery(this).attr('height',jQuery(this).height());

			var prevStyle = '';
			var strNewHTML = '';
			var imgId = (jQuery(this).attr('id')) ? 'id="' + jQuery(this).attr('id') + '" ' : '';
			var imgClass = (jQuery(this).attr('class')) ? 'class="' + jQuery(this).attr('class') + '" ' : '';
			var imgTitle = (jQuery(this).attr('title')) ? 'title="' + jQuery(this).attr('title') + '" ' : '';
			var imgAlt = (jQuery(this).attr('alt')) ? 'alt="' + jQuery(this).attr('alt') + '" ' : '';
			var imgAlign = (jQuery(this).attr('align')) ? 'float:' + jQuery(this).attr('align') + ';' : '';
			var imgHand = (jQuery(this).parent().attr('href')) ? 'cursor:hand;' : '';
			if (this.style.border) {
				prevStyle += 'border:'+this.style.border+';';
				this.style.border = '';
			}
			if (this.style.padding) {
				prevStyle += 'padding:'+this.style.padding+';';
				this.style.padding = '';
			}
			if (this.style.margin) {
				prevStyle += 'margin:'+this.style.margin+';';
				this.style.margin = '';
			}
			var imgStyle = (this.style.cssText);

			strNewHTML += '<span '+imgId+imgClass+imgTitle+imgAlt;
			strNewHTML += 'style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;
			strNewHTML += 'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;';
			strNewHTML += 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + jQuery(this).attr('src') + '\', sizingMethod=\'scale\');';
			strNewHTML += imgStyle+'"></span>';
			if (prevStyle != ''){
				strNewHTML = '<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:' + jQuery(this).width() + 'px;' + 'height:' + jQuery(this).height() + 'px;'+'">' + strNewHTML + '</span>';
			}

			jQuery(this).hide();
			jQuery(this).after(strNewHTML);

		});

		//fix css background pngs
		jQuery(this).find("*").each(function(){
			var bgIMG = jQuery(this).css('background-image');
        if(bgIMG.indexOf(".png")!=-1 && bgIMG.indexOf("fancy_")!=-1){
  				var iebg = bgIMG.split('url("')[1].split('")')[0];
  				jQuery(this).css('background-image', 'none');
  				jQuery(this).get(0).runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + iebg + "',sizingMethod='scale')";
  			}
		});
		
		//fix input with png-source
		jQuery(this).find("input[src$=.png]").each(function() {
			var bgIMG = jQuery(this).attr('src');
			jQuery(this).get(0).runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader' + '(src=\'' + bgIMG + '\', sizingMethod=\'scale\');';
   		jQuery(this).attr('src', settings.blankgif)
		});
	
	}
	
	return jQuery;

};

})(jQuery);

function isIE6(){
  if(jq.browser.msie && jq.browser.version.substr(0,1)<7){
    return true;
  }else{
    return false;
  }
}
function isIE(){
  if(jq.browser.msie){
    return true;
  }else{
    return false;
  }
}

// top navigation
function toggleZindex(navElement){
 if (navigator.appName.indexOf("Explorer") != -1) {
    obj = navElement.parentNode;
  	childs = obj.childNodes;
  	for( var i=0; i<childs.length; i++){
  	   if (childs[i].nodeValue == null) /*Check if nodeValue an element node*/
  			childs[i].style.zIndex=0;
  	  }
  	navElement.style.zIndex=-1;
	}
}

// select visable web2 gadget
function showLayerWeb20(layer, link){
  jq("#iTunes").fadeOut();
  jq("#twitter").fadeOut();
  jq("#flickr").fadeOut();
  jq("#facebook").fadeOut();
  jq("#youtube").fadeOut();
  // youtube content cannot be faded in IE6
  if ((jq.browser.msie && jq.browser.version.substr(0,1)<7) && (layer == 'youtube')) {
    jq("#"+layer).fadeIn();
  }else{
    jq("#"+layer).show();
  }
  jq("div.web20_header a").css('background-image', "");
  jq("a."+link).css('background-image', "url(/fileadmin/templates/image/web20/"+layer+"Act.png)");
}



//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
(function(jq) { jq(document).ready(function(){
//(function(jq) { jQuery(document).ready(function(){
  jq("DIV#headerImage").pngFix();
//  jq("DIV#rightCol-layer-top").pngFix();
//  jq("DIV#rightCol-layer-middle").pngFix();
//  jq("DIV#rightCol-layer-bottom").pngFix();

  // fix for header navigation

jq("#container_main_nav").hover(
  function(){
      jq("#current").addClass("neo");
      jq("#current").removeAttr("id")
    },
  function(){
      jq(".neo").attr("id", "current");
      jq(".neo").removeClass("neo");
    }

  );
  
  //detect resolution and load a other pageWrap bg image
if ((screen.width<=1326)) {
    jq("div#pageWrap").css("background","none");
    jq("div#pageWrap").css("width","1002px");
 }
 
 //extend fancybox with zoom picture
 
jq("DIV#leftCol-content P .jqfancybox img").after('<img src="fileadmin/templates/image/lupe.png" class="zoom_lupe" width="40" height="40" />');
jq("DIV#leftCol-content P .jqfancybox").wrap('<div class="zoom_image"></div>');

 
  
if(document.getElementById("iTunes")) showLayerWeb20("iTunes", 'web20-map1');

//comment layer show after load

jq("#leftCol-upperLayer-bottom-toggleLayer").show();

  // show / hide comments
	jq("#leftCol-upperLayer-bottom-commentsButton").click(function(){
    if(!isIE6()){
  	  jq("#leftCol-upperLayer-bottom-toggleLayer").slideToggle('slow');
  	  /*jq("#leftCol-upperLayer-bottom-commentLayer").slideToggle('slow');*/
	  }else{
  	  jq("#leftCol-upperLayer-bottom-toggleLayer").toggle();
  	  /*jq("#leftCol-upperLayer-bottom-commentLayer").slideToggle('slow');*/
    }
	});

	if (isIE()){
          // toggle indexed search form
    	jq("A#toggleSearch").click(function(){
    		jq("#topNav-quicksearchLayer").show();
    	});
    	jq("A#closeSearchLayer").click(function(){
    		jq("#topNav-quicksearchLayer").hide();
    	});
    } else  {
          // toggle indexed search form
    	jq("A#toggleSearch").click(function(){
    		jq("#topNav-quicksearchLayer").show("slow");
    	});
    	jq("A#closeSearchLayer").click(function(){
    		jq("#topNav-quicksearchLayer").hide("fast");
    	});  
    }

	
  //////////////////////////////////////////////////////////////////////////////
	// toggle weather / events
  //////////////////////////////////////////////////////////////////////////////
  
  //init
  
  jq(".box_eventTeaser").hide();
  
  if (isIE()) {
    jq(".box_weatherButton").click(function(){
      jq(".box_weather").css('z-index', '30');
      jq(".box_eventTeaser").css('z-index', '20');
      jq(".box_weather").show();
      jq(".box_eventTeaser").show();
      jq(".box_eventTeaserLong").hide();
      jq(".box_eventTeaserLong").css('z-index', '10');
      
      jq("#weather-and-events").height(230);
    });
  	jq(".box_eventTeaserButton").click(function(){
      jq("#weather-and-events").height(300);
  
      jq(".box_weather").css('z-index', '10');
      jq(".box_eventTeaser").css('z-index', '20');
      jq(".box_eventTeaserLong").css('z-index', '30');
      jq(".box_weather").show();
      jq(".box_eventTeaser").hide();
      jq(".box_eventTeaserLong").show();
    });
  }else{
    jq(".box_weatherButton").click(function(){
      jq(".box_weather").css('z-index', '30');
      jq(".box_eventTeaser").css('z-index', '20');
      jq(".box_weather").fadeIn();
      jq(".box_eventTeaser").fadeIn();
      jq(".box_eventTeaserLong").fadeOut();
      jq(".box_eventTeaserLong").css('z-index', '10');
      
      jq("#weather-and-events").height(300);
    });
  	jq(".box_eventTeaserButton").click(function(){
      jq("#weather-and-events").height(300);
  
      jq(".box_weather").css('z-index', '10');
      jq(".box_eventTeaser").css('z-index', '20');
      jq(".box_eventTeaserLong").css('z-index', '30');
      jq(".box_weather").fadeIn();
      jq(".box_eventTeaser").fadeOut();
      jq(".box_eventTeaserLong").fadeIn();
    });
  }

  //////////////////////////////////////////////////////////////////////////////
  // load WEB2.0 content
  //////////////////////////////////////////////////////////////////////////////
  // load Flickr
  
  if(typeof(window.tx_neoflickr_pi1processFlickrData) == "function") {
   tx_neoflickr_pi1processFlickrData();
}

//rss image hover 
jq("#rsslink img").hover(
 function()
 {
  this.src = "fileadmin/templates/image/topNav_rss_hover.jpg";
 },
 function()
 {
  this.src = "fileadmin/templates/image/topNav_rss.jpg";
 }
);  

jq(".newsletter-check label").hover(
 function()
 {
  jq(".newsletter-hint").show();
 },
 function()
 {
  jq(".newsletter-hint").hide();
 }
);  
  
  
  // modify facebook
  //jq(".connect_top").remove();
  
  jq('.newNewsletterForm-element-error-03 br').remove();
   

  //////////////////////////////////////////////////////////////////////////////
	// Locations
  //////////////////////////////////////////////////////////////////////////////
  
  // functions to toggle profile tabs
	jq(".box_accommodationsProfile_summerButton a").click(function(){
  //  jq(".box_accommodationsProfile_summer").css('z-index', '100');
    jq(".box_accommodationsProfile_summer").toggle();
    jq(".box_accommodationsProfile_winter").hide();
  //  jq(".box_accommodationsProfile_winter").css('z-index', '-1');
    
    if (jq(".box_accommodationsProfile_summer").is(':hidden')) 
       jq(".box_accommodationsProfile_info").show();
    else
      jq(".box_accommodationsProfile_info").hide();
  //  jq(".box_accommodationsProfile_info").css('z-index', '-1');
  });
	jq(".box_accommodationsProfile_winterButton a").click(function(){
  //  jq(".box_accommodationsProfile_winter").css('z-index', '100');
    jq(".box_accommodationsProfile_winter").toggle();
    jq(".box_accommodationsProfile_summer").hide();
  //  jq(".box_accommodationsProfile_summer").css('z-index', '-1');
    if (jq(".box_accommodationsProfile_winter").is(':hidden')) 
       jq(".box_accommodationsProfile_info").show();
    else
      jq(".box_accommodationsProfile_info").hide();
  //  jq(".box_accommodationsProfile_info").css('z-index', '-1');
  });
	jq(".box_accommodationsProfile_infoButton a").click(function(){
  //  jq(".box_accommodationsProfile_info").css('z-index', '100');
    jq(".box_accommodationsProfile_info").show();
    jq(".box_accommodationsProfile_summer").hide();
  //  jq(".box_accommodationsProfile_summer").css('z-index', '-1');
    jq(".box_accommodationsProfile_winter").hide();
  //  jq(".box_accommodationsProfile_winter").css('z-index', '-1');
  });
  
  // Locations Profile: last values in list need to have a different class
  jq('.profile_summerValue:last').addClass('profile_summerLastValue').removeClass('profile_summerValue');
  jq('.profile_winterValue:last').addClass('profile_winterLastValue').removeClass('profile_winterValue');
  jq('.profile_infoValue:last').addClass('profile_infoLastValue').removeClass('profile_infoValue');
  
/*
  jq(".box_accommodationsProfile_header").pngFix();
  
  jq(".box_accommodationsProfile_summer_borderTop").pngFix();
  jq(".box_accommodationsProfile_summerContent").pngFix();
  jq(".box_accommodationsProfile_summer_borderBottom").pngFix();
  jq(".box_accommodationsProfile_winter_borderTop").pngFix();
  jq(".box_accommodationsProfile_winterContent").pngFix();
  jq(".box_accommodationsProfile_winter_borderBottom").pngFix();
*/
  // activate Info tab
  jq(".box_accommodationsProfile_infoButton a").click();
  
  //////////////////////////////////////////////////////////////////////////////
  // apply clearingInput to forms  
  //////////////////////////////////////////////////////////////////////////////
//  if(!isIE6()) {
    jq('.tx-comments-comment-input').clearingInput();
    jq('#tx_comments_pi1_content').clearingInput();
    
    jq('#uid8').clearingInputpower();  
    jq('#uid9').clearingInputpower();  
    jq('#uid10').clearingInputpower();
    jq('#uid11').clearingInputpower();  
    jq('#uid12').clearingInputpower();  
    jq('#uid13').clearingInputpower();
    jq('#uid14').clearingInputpower();  
    jq('#uid15').clearingInputpower();  
    jq('#uid16').clearingInputpower();
    jq('#uid17').clearingInputpower();  
    jq('#uid18').clearingInputpower();  
    jq('#uid19').clearingInputpower();
    jq('#uid20').clearingInputpower();   
    jq('#uid21').clearingInputpower();       
    
   //englisch Unterkunftanfrage
    
    jq('#uid386').clearingInputpower();  
    jq('#uid387').clearingInputpower();
    jq('#uid388').clearingInputpower();     
    jq('#uid389').clearingInputpower();  
    jq('#uid390').clearingInputpower();  
    jq('#uid391').clearingInputpower();
    jq('#uid392').clearingInputpower();  
    jq('#uid393').clearingInputpower();  
    jq('#uid394').clearingInputpower();
    jq('#uid395').clearingInputpower();   
    jq('#uid396').clearingInputpower();  
    jq('#uid397').clearingInputpower();
    jq('#uid398').clearingInputpower();   
    jq('#uid399').clearingInputpower(); 
    jq('#uid400').clearingInputpower();    
    
     //cz Unterkunftanfrage
     
    jq('#uid370').clearingInputpower();  
    jq('#uid371').clearingInputpower();
    jq('#uid372').clearingInputpower();     
    jq('#uid373').clearingInputpower();  
    jq('#uid374').clearingInputpower();  
    jq('#uid375').clearingInputpower();
    jq('#uid376').clearingInputpower();  
    jq('#uid377').clearingInputpower();  
    jq('#uid378').clearingInputpower();
    jq('#uid379').clearingInputpower();   
    jq('#uid380').clearingInputpower();  
    jq('#uid381').clearingInputpower();
    jq('#uid382').clearingInputpower();   
    jq('#uid383').clearingInputpower(); 
    jq('#uid384').clearingInputpower();      
     

    
    
    jq('.pm_vorname').clearingInputpower();  
    jq('.pm_nachname').clearingInputpower();
    jq('.pm_name').clearingInputpower();  
    jq('.pm_strasse').clearingInputpower();
    jq('.pm_plz').clearingInputpower();  
    jq('.pm_ort').clearingInputpower();  
    jq('.pm_telefon').clearingInputpower();
    jq('.pm_email').clearingInputpower();  
    jq('.pm_kommentar').clearingInputpower();      
    jq('.powermail_uid2').clearingInputpower();  
    jq('.powermail_uid3').clearingInputpower();
    jq('.powermail_uid4').clearingInputpower();  
    jq('.powermail_uid5').clearingInputpower();
    jq('.powermail_uid6').clearingInputpower(); 
    
    //en Kontakt
    
    jq('.powermail_uid364').clearingInputpower();  
    jq('.powermail_uid365').clearingInputpower();
    jq('.powermail_uid366').clearingInputpower();  
    jq('.powermail_uid367').clearingInputpower();
    jq('.powermail_uid368').clearingInputpower();     
    
    //cz Kontakt
    
    jq('.powermail_uid358').clearingInputpower();  
    jq('.powermail_uid359').clearingInputpower();
    jq('.powermail_uid360').clearingInputpower();  
    jq('.powermail_uid361').clearingInputpower();
    jq('.powermail_uid362').clearingInputpower();     
    
      
    
    jq('.newNewsletterForm-element-input-01').clearingInputNewsletterForm();  
    jq('.newNewsletterForm-element-input-02').clearingInputNewsletterForm();
    jq('.newNewsletterForm-element-input-03').clearingInputNewsletterForm();
    jq('.newsletterEmailRequestForm-element-input-01').clearingInputNewsletterForm();      
      
    
//  }

});})(jQuery);