$(document).ready(function(){
	
	$("a[rel=fancybox]").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayColor'	: '#000',
		'overlayOpacity': 0.9,
		'cyclic'		:	true
	});
	
	$("a.iframe").fancybox({
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true,
		'overlayColor'	: '#000',
		'overlayOpacity': 0.9,
		'scrolling'		: 'no',
		'width'			: 977,
		'height'		: 550
	});
	
	$("a.ext").click(function(){
		window.open($(this).attr('href'), '_blank'); return false;
	});

	if($("#dateInput").length){
		$.datepicker.setDefaults( $.datepicker.regional[ "de" ] );
		$("#dateInput").datepicker();
	}
	if($("#von").length){
		$.datepicker.setDefaults( $.datepicker.regional[ "de" ] );
		$("#von").datepicker();
	}
	
	$("#bigbackground-image").css({
		'width': $(window).width()+"px"
	});
	
	$(function() {
	    $("#bigbackground-image img").scaleImage({
	        center: true
	    });
	});
	
	/* IMAGE RESIZE */
	$(window).resize(function() {
		$('#bigbackground-image').css({
			'width': $(window).width()+"px"
		});
		$("#bigbackground-image img").scaleImage({
	        center: true
	    });
	});
	
	/*$(function() {
		var dates = $( "#dateInput" ).datepicker({
			defaultDate: "+1",
			changeMonth: true,
			numberOfMonths: 1
		});
	});
	
	$.datepicker.setDefaults( $.datepicker.regional[ "de" ] );
	
	$(function() {
		var dates = $( "#from, #to" ).datepicker({
			defaultDate: "+1",
			changeMonth: true,
			numberOfMonths: 2,
			showOptions: {direction: "up"},
			onSelect: function( selectedDate ) {
				var option = this.id == "from" ? "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 );
			}
		});
	});*/
		

		
});

