$(document).ready(function() {
	
	/* eMail-Formular - Inhalt checken */
	$("#emailform").submit(function() {
	
		if ($("#absender").val() == "" || $("#message").val() == "")
		{
			$("#formfehler").html("<p>Bitte &uuml;berpr&uuml;fen Sie Ihre eingegebenen Daten im Formular</p>");
			$("#formfehler").fadeIn("slow");

			return false;
		}		
	});
	
	
	/* Neuheiten: Hersteller wählen */
	$("#neuheiten_container").load("check.php?wert=");
	
	$("#hersteller").change(function() {
		
		var wert = $(this).val();
		$("#neuheiten_container").load("check.php?wert=" + wert);
		
	});
	
	/* Bücher: Hersteller wählen */
	$("#buecher_container").load("check_books.php?wert=");
	
	$("#hersteller_buecher").change(function() {
		
		var wert = $(this).val();
		$("#buecher_container").load("check_books.php?wert=" + wert);
		
	});
	
	
	/* Fancybox - Fotos */
	$("a.fancyfoto").fancybox({
		'overlayShow': true,
		'transitionIn'	: 'fade',
		'transitionOut'	: 'fade',
		'showCloseButton': true,
		'overlayColor': '#C5DAF1',
		'overlayOpacity': '0.7',
		'hideOnContentClick': true,
		'titlePosition': 'inside'
	});
	
	/* Fancybox - Externer Content */
    $("a.infowindow").fancybox({
    	'hideOnContentClick': false,
    	'overlayShow': true,
    	'transitionIn'	: 'elastic',
    	'transitionOut'	: 'elastic',
    	'easingIn'      : 'easeOutBack',
    	'easingOut'     : 'easeInBack',
    	'showCloseButton': true,
    	'overlayColor': '#C5DAF1',
    	'overlayOpacity': '0.7',
    	'height': 500,
    	'width': 400,
    	'autoScale': false,
    	'autoDimensions': false,
    	'scrolling': 'yes'
  });
    
    /* Fancybox - Externer Content */
    $("a.infowindowsmall").fancybox({
    	'hideOnContentClick': false,
    	'overlayShow': true,
    	'transitionIn'	: 'elastic',
    	'transitionOut'	: 'elastic',
    	'easingIn'      : 'easeOutBack',
    	'easingOut'     : 'easeInBack',
    	'showCloseButton': true,
    	'overlayColor': '#C5DAF1',
    	'overlayOpacity': '0.7',
    	'height': 190,
    	'width': 400,
    	'autoScale': false,
    	'autoDimensions': false,
    	'scrolling': 'yes'
  });
    
    $("a.closeinfowindow").click(function() {
    	
    	$.fancybox.close();
    	
    });
        	
});
