$(document).ready(function() {
  
  // Mainmenu
  $('li[id*="mm-item"]').hover(
  function() {
  	if($(this).attr('class').search(/active/) == -1) {
	  	$(this).stop()
	  		.animate({'backgroundPosition':'0px 1px'}, 1000, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#646566'}, 500);
	}
  },
  function() {
  	if($(this).attr('class').search(/active/) == -1) {
	  	$(this).stop()
	  		.animate({'backgroundPosition':'0px 45px'}, 1000, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#999'}, 500);
  	}
  });
  
  // Submenu
  $('li[id*="sm-item"]').hover(
  function() {
  	if($(this).attr('class').search(/active/) == -1) {
	  	$(this).stop()
	  		.animate({'paddingLeft':'20px','backgroundPosition':'4px 5px'}, 800, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#9e1622'}, 500);
	}
  },
  function() {
  	if($(this).attr('class').search(/active/) == -1) {	  		
	  	$(this).stop()
	  		.animate({'paddingLeft':'0px','backgroundPosition':'-16px 5px'}, 800, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#646566'}, 500);
  	}
  });
  
  // Metamenu
  $('li[id*="am-item"]').hover(
  function() {
  	if($(this).attr('class').search(/active/) == -1) {
	  	$(this).stop()
	  		.animate({'paddingLeft':'15px','backgroundPosition':'4px 7px'}, 800, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#9e1622'}, 500);
	}
  },
  function() {
  	if($(this).attr('class').search(/active/) == -1) {
	  	$(this).stop()
	  		.animate({'paddingLeft':'0px','backgroundPosition':'-11px 7px'}, 800, 'easeOutCubic')
	  		.children('a').stop().animate({'color':'#999'}, 500);
  	}
  });
  
  // Weiterlesen-Buttons
  $('.readmore').hover(
  function() {
  	$(this).animate({'width':'85px'}, 800, 'easeOutCubic');
  },
  function() {
  	$(this).animate({'width':'65px'}, 800, 'easeOutCubic');
  });
  
  $('#core-slider').core_slideshow();

	if($('.core-textarea').val() == 'Falls Sie sonstige Fragen und Anregungen haben, verwenden Sie bitte dieses Textfeld ...')
	{
		$('.core-textarea').val('Falls Sie sonstige Fragen und Anregungen haben, verwenden Sie bitte dieses Textfeld ...').css({'color':'#ccc', 'font-style':'italic'});
	}

	$('.core-textarea').focus(function() {
		if($(this).val() == 'Falls Sie sonstige Fragen und Anregungen haben, verwenden Sie bitte dieses Textfeld ...')
		{
			$(this).val('').css({'color':'#646566', 'font-style':'normal'});
		}
		$('#coaching8').attr('checked', true);
	});
	
	
	$('.core-textarea').blur(function() {
		if($(this).val() == '')
		{
			$('#coaching8').attr('checked', false);
			$(this).val('Falls Sie sonstige Fragen und Anregungen haben, verwenden Sie bitte dieses Textfeld ...')
				   .css({'color':'#ccc', 'font-style':'italic'});
		}else{
			$('#coaching8').attr('checked', true);
		}
	});
  
});
