// JavaScript Document

jQuery.noConflict();

jQuery(document).ready(function(){
	
	//Kontaktformular Textfelder leeren
	jQuery('#lastname').focus(function() {
		if(jQuery(this).val()=="Name *"){
			jQuery(this).val("");
		}
	});
	
	jQuery('#lastname').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("Name *");
		}
	});
	
	jQuery('#firstname').focus(function() {
		if(jQuery(this).val()=="Vorname "){
			jQuery(this).val("");
		}
	});
	
	jQuery('#firstname').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("Vorname ");
		}
	});
	
	jQuery('#fon').focus(function() {
		if(jQuery(this).val()=="Telefon "){
			jQuery(this).val("");
		}
	});
	
	jQuery('#fon').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("Telefon ");
		}
	});
	
	jQuery('#email').focus(function() {
		if(jQuery(this).val()=="E-Mail *"){
			jQuery(this).val("");
		}
	});
	
	jQuery('#email').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("E-Mail *");
		}
	});
	
	jQuery('#betreff').focus(function() {
		if(jQuery(this).val()=="Betreff "){
			jQuery(this).val("");
		}
	});
	
	jQuery('#betreff').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("Betreff ");
		}
	});
		
	jQuery('#nachricht').focus(function() {
		if(jQuery(this).val()=="Ihre Nachricht *"){
			jQuery(this).val("");
		}
	});
	
	jQuery('#nachricht').blur(function() {
		if(jQuery(this).val()==""){
			jQuery(this).val("Ihre Nachricht *");
		}
	});
	
	
	//Formular Pflichtfelder
	jQuery('.error_formular').hide();
	jQuery(".submitbutton").click(function() {
		var anrede = jQuery("#anrede").val();
		if (anrede == "Anrede *") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
		
		var name = jQuery("input#lastname").val();
		if (name == "") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
		
		if (name == "Name *") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
				
		var email = jQuery("input#email").val();
		if (email == "") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
		
		if (email == "E-Mail *") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
				
		var nachricht = jQuery("input#nachricht").val();
		if (nachricht == "") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
		
		if (nachricht == "Ihre Nachricht *") {
		  jQuery('.error_formular').slideDown("slow");
		  return false;
		}
	});

	//Startseite
	jQuery('.over_facebook,.over_bestellung,.over_leidenschaft,.over_kontakt,.over_verkauf,.over_lecker').hide();
	
	jQuery(".plus_fb").mouseover(function() {
		jQuery(".over_facebook").fadeIn("fast");
		jQuery(".start_facebook").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_facebook").fadeOut("fast");
		jQuery(".start_facebook").css( "backgroundPosition","left top" );
	});
		
	jQuery(".plus_leidenschaft").mouseover(function() {
		jQuery(".over_leidenschaft").fadeIn("fast");
		jQuery(".start_leidenschaft").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_leidenschaft").fadeOut("fast");
		jQuery(".start_leidenschaft").css( "backgroundPosition","left top" );
	});
	
	jQuery(".plus_kontakt").mouseover(function() {
		jQuery(".over_kontakt").fadeIn("fast");
		jQuery(".start_kontakt").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_kontakt").fadeOut("fast");
		jQuery(".start_kontakt").css( "backgroundPosition","left top" );
	});
	
	jQuery(".plus_lecker").mouseover(function() {
		jQuery(".over_lecker").fadeIn("fast");
		jQuery(".start_lecker").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_lecker").fadeOut("fast");
		jQuery(".start_lecker").css( "backgroundPosition","left top" );
	});
	
	jQuery(".plus_verkauf").mouseover(function() {
		jQuery(".over_verkauf").fadeIn("fast");
		jQuery(".start_verkauf").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_verkauf").fadeOut("fast");
		jQuery(".start_verkauf").css( "backgroundPosition","left top" );
	});
	
	jQuery(".plus_bestellung").mouseover(function() {
		jQuery(".over_bestellung").fadeIn("fast");
		jQuery(".start_bestellung").css( "backgroundPosition","left bottom" );
	}).mouseout(function(){
		jQuery(".over_bestellung").fadeOut("fast");
		jQuery(".start_bestellung").css( "backgroundPosition","left top" );
	});
	
		
	jQuery("#imagevideo_link").click(function() {
	jQuery.fancybox({
			'padding'		: 0,
			'autoScale'		: false,
			'transitionIn'	: 'none',
			'transitionOut'	: 'none',
			'title'			: this.title,
			'width'		: 480,
			'height'		: 270,
			'href'			: this.href,
			'type'			: 'iframe'
		});

	return false;
});
	
	//jQuery("#stoerer").hover(function() {
   //var pos = 	jQuery(this).css("width");
   //if (pos == "50px") {
   //   	jQuery(this).animate({width: "226px"}, 1000);
   //} else {
   //   	jQuery(this).animate({width: "50px"}, 1000);
   //}
//});
	
	
});
