Shadowbox.loadSkin('shadowbox', '/NEU/style/');
window.onload = Shadowbox.init;


$(document).ready(function() {

	//Eingabe wird ausgeblendet
	$('#pickerfield').css({'color': '#fff'});

	//Eingabe wird eingeblendet
	$(".pick").click(function () {
		$('.check').val(1);
		$('#pickerfield').css({'color': '#000'});

	});

	//Prüfen ob Datum und Zeit gesetzt
	$(".check_date").click(function () {
		var check = $('.check').val();

		if(check ==""){

			$('#pickerfield').css({'background-color': '#E6B0BA','color': '#E6B0BA'});
		}

	});


	//Radio Buttons Prospekt bestellen ein ausblenden
	$(".radio").click(function () {

		if($(".ja:checked").val() =="ja"){

			$(".prospekt").fadeIn();

		}else{

			$(".prospekt").fadeOut();

		}

	});


	// Header Image
 	$('.slideshow').cycle({
		fx: 'fade',
		timeout: 5000,
		speed: 2000
	});



	//Mouse Over and Out
	$("#meta_a img").hover(
		function () {

			$(this).attr("src", $(this).parent("a").attr("rel_up"));

		},
		function () {
			$(this).attr("src", $(this).parent("a").attr("rel_do"));

		}
	);

	//Mouse Over and Out
	$("#meta_b img").hover(
		function () {

			$(this).attr("src", $(this).parent("a").attr("rel_up"));

		},
		function () {
			$(this).attr("src", $(this).parent("a").attr("rel_do"));

		}
	);
////////////////////////////////////////////////////////////////////////////

    //drucken
    $("#drucken").click(function () {
    	window.print();
    });

    //bookmark
    $("#bookmark").click(function () {

		var url = $(this).attr("rel_url");
		var title = $(this).attr("rel_title");

		if (window.sidebar) { // Mozilla Firefox
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite(url, title);
		} else if(window.opera) { // Opera 7+
			var elem = document.createElement('a');
		    elem.setAttribute('href',url);
		    elem.setAttribute('title',title);
		    elem.setAttribute('rel','sidebar');
		    elem.click();
		} else {
			alert('Ihr Browser unterstützt diese Aktion leider nicht. Bitte fügen Sie diese Seite manuell zu Ihren Favoriten hinzu.');
		}

    });


	//Prüfung ob alle Pflichtfelder ausgefüllt sind.
	$(".validate").validate();

	// Captcha
	$("#captcha").click(function(){
		var random = Math.floor(Math.random()*25600);

		$("#captcha img").attr("src", "../../captcha/image.php?new_captcha=true&" + random);

	});




});
