(function($){
	$(document).ready(function(){
		config = {
			over: function(){
				$(this).addClass('mhover');
				//$('ul', this).animate({height:'show'}, 125, 'linear', function(){ if ($.browser.msie) this.style.removeAttribute('filter');});
				$('ul', this).slideToggle(125, function(){ if ($.browser.msie) this.style.removeAttribute('filter');});
			},
			out: function(){
				$(this).removeClass('mhover');
				$('ul', this).animate({opacity:'hide'}, 250, 'linear', function(){if ($.browser.msie) this.style.removeAttribute('filter');});
			},
			timeout:500
		};
		//$('div#mainmenu > div#pmainmenu > ul > li > ul').each(function(){
			//$(this).css('bottom', ($(this).height() + 38).toString() + 'px');
		//});
		$('div#mainmenu > ul > li').hoverIntent(config);
		$('li.level_0.i9 a, .fancybox').fancybox({
				type:'iframe',
				width:800,
				height:700,
				centerOnScroll:true
		});
		$.datepicker.setDefaults($.extend(
			{	showMonthAfterYear: false,
				showOn:'both',
				buttonImageOnly: true,
				buttonImage: 'templates/system/images/calendar.png',
				minDate: '0d'
			}, $.datepicker.regional[langsc]));
		var prefix = 'jos_hubertussoelden_';
		var dates = $( "input#"+prefix+"fabrik_anfrage___anreise, input#"+prefix+"fabrik_anfrage___abreise" ).datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 2,
			onSelect: function( selectedDate ) {
				var option = $(this).attr('id') == prefix+"fabrik_anfrage___anreise" ? "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);
			}
		});
	});
})(jQuery);

