$(document).ready(function () {
  
  $('#slidebutton a').toggle(function(){
  	$('#content').hide("slide", { direction: "left" }, 1200);	
  	$(this).addClass('hiddens');
  },
  function(){
  	$('#content').show("slide", { direction: "left" }, 1200);
  	$(this).removeClass('hiddens');
  });
  
  $('#showmore').toggle(function(){
  	$('#moreinfowrap').show("slide", { direction: "up" }, 600);
  	$(this).html('Preisinformationen verstecken');	
  	return false;
  	//$(this).addClass('hiddens');
  },
  function(){
  	$('#moreinfowrap').hide("slide", { direction: "up" }, 600);
  	$(this).html('Alle Preise anzeigen');
  	return false;
  	//$(this).removeClass('hiddens');
  });
  
  $('#showform').toggle(function(){
  	$('#formwrap').show("slide", { direction: "up" }, 600);
  	$(this).html('Formular verstecken');	
  	return false;
  	//$(this).addClass('hiddens');
  },
  function(){
  	$('#formwrap').hide("slide", { direction: "up" }, 600);
  	$(this).html('Eine eigene Meinung schreiben ');
  	return false;
  	//$(this).removeClass('hiddens');
  });

  $('div.jimgMenu ul li a').hover(function() {  
    // if the element is currently being animated
    if ($(this).is(':animated')) {
      $(this).addClass("active").stop().animate({width: "310px"}, {duration: 450, easing: "easeOutQuad", complete: "callback"});
    } else {
      // ease in quickly
      $(this).addClass("active").stop().animate({width: "310px"}, {duration: 400, easing: "easeOutQuad", complete: "callback"});
    }
  }, function () {
    // on hovering out, ease the element out
    if ($(this).is(':animated')) {
      $(this).removeClass("active").stop().animate({width: "78px"}, {duration: 400, easing: "easeInOutQuad", complete: "callback"})
    } else {
      // ease out slowly
      $(this).removeClass("active").stop(':animated').animate({width: "78px"}, {duration: 450, easing: "easeInOutQuad", complete: "callback"});
    }
  });
  
  //homepage thumbnails
  
   var move = -15;
   var zoom = 1.2;
     $('.itemstart').hover(function() { 
        width = $('.itemstart').width() * zoom;
        height = $('.itemstart').height() * zoom;
        $(this).find('div.precap').fadeOut(200);
        $(this).find('img').stop(false,true).animate({'width':width, 'height':height, 'top':move, 'left':move}, {duration:200});
        $(this).find('div.caption').stop(false,true).fadeIn(200);
    },
    function() {
        $(this).find('img').stop(false,true).animate({'width':$('.itemstart').width(), 'height':$('.itemstart').height(), 'top':'0', 'left':'0'}, {duration:100});   
        $(this).find('div.caption').stop(false,true).fadeOut(200);
        $(this).find('div.precap').fadeIn(200);
    });
  
  
  //copy link from within to front
  
  
  var dates = $( "#reisedatum, #reisedatumb" ).datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 1,
			onSelect: function( selectedDate ) {
				var option = this.id == "reisedatum" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
			}
		});

	
	$.datepicker.regional['de'] = {clearText: 'löschen', clearStatus: 'aktuelles Datum löschen',
                closeText: 'schließen', closeStatus: 'ohne Änderungen schließen',
                prevText: '&#x3c;zurück', prevStatus: 'letzten Monat zeigen',
                nextText: 'Vor&#x3e;', nextStatus: 'nächsten Monat zeigen',
                currentText: 'heute', currentStatus: '',
                monthNames: ['Januar','Februar','März','April','Mai','Juni',
                'Juli','August','September','Oktober','November','Dezember'],
                monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
                'Jul','Aug','Sep','Okt','Nov','Dez'],
                monthStatus: 'anderen Monat anzeigen', yearStatus: 'anderes Jahr anzeigen',
                weekHeader: 'Wo', weekStatus: 'Woche des Monats',
                dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
                dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
                dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
                dayStatus: 'Setze DD als ersten Wochentag', dateStatus: 'Wähle D, M d',
                dateFormat: 'dd.mm.yy', firstDay: 1, 
                initStatus: 'Wähle ein Datum', isRTL: false};
        $.datepicker.setDefaults($.datepicker.regional['de']);

    
});

