$(document).ready(function() {
   /*Frontpage*/
	$("#box-first").css ({"width": "535px"});
	$("#box-second").css ({"left": "535px", "display": "block"});
	$("a#box-click-first img#active").stop(true).css({opacity: 1},400);
	$("a#box-click-second img#active").stop(true).css({opacity: 0},400);

   	
   $("a#box-click-first").mouseover(function(){
	$("#box-first").stop(true).animate({"width": "535px"},400);
	$("#box-second").stop(true).animate({"left": "535px"},400);
	$("a#box-click-first img#normal").stop(true).animate({opacity: 0},400);
	$("a#box-click-first img#active").stop(true).animate({opacity: 1},400);
		$("a#box-click-second img#normal").stop(true).animate({opacity: 1},400);
		$("a#box-click-second img#active").stop(true).animate({opacity: 0},400);
   });
   
   $("a#box-click-second").mouseover (function(){
	$("#box-second").stop(true).animate({"width": "535px", "left": "203px"},400);
	$("#box-first").stop(true).animate({"width": "203px"},400);
	$("a#box-click-second #normal").stop(true).animate({opacity: 0},400);
	$("a#box-click-second #active").stop(true).animate({opacity: 1},400);	
		$("a#box-click-first #normal").stop(true).animate({opacity: 1},400);
		$("a#box-click-first #active").stop(true).animate({opacity: 0},400);
   });
   /*end*/
   
   
  /*Formular Felder Select Function*/
  $('a.totop').click(function(){
    $('html, body').animate({scrollTop: '0px'}, 600);
    return false;
  });
  /*end*/



  /*Formular Felder Select Function*/
    $('input, #kontaktform textarea').click(function(){
        $(this).addClass('inpstyle');
    });
    $('input, #kontaktform textarea').blur(function(){
        $(this).removeClass('inpstyle');
    });
    $('input, #kontaktform textarea').bind('keyup', function(e) { 
      var keyCode = e.keyCode || e.which; 
      if (keyCode == 9) { 
        $(this).addClass('inpstyle');
      } 
    });
 /*end*/
 
  /*Img Alpha Function for Fancy*/
  $('a.zoom img').hover(function(){
	  $(this).stop().animate({ opacity: '0.7' } , '100');
  } , function(){
	  $(this).stop().animate({ opacity: '1'} , '100');
  });
 
 
 /*Formular Fancybox*/
 $(document).ready(function() {
			$("#sub-form").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'fade',
				'transitionOut'	: 'fade'
			});
			
	});
	/*end*/

  
});
