// JavaScript Document

jQuery(document).ready(function(){
	
	jQuery('#contact').ajaxForm(function(data) {
	 if (data==1){
		 jQuery('#email-ok').fadeIn("slow");
		 jQuery('#email-bad').fadeOut("slow");
		 jQuery('#server-bad').fadeOut("slow");
		 jQuery('#contact').resetForm();
		 }
	 else if (data==2){
			 jQuery('#server-bad').fadeIn("slow");
		  }
	 else if (data==3)
		{
		 jQuery('#email-bad').fadeIn("slow");
		}
	});

	jQuery('.menu > li ul').mouseover(function(){
	
	    if(! jQuery(this).parent().hasClass('fake-hover')){
	    	jQuery(this).parent().addClass('fake-hover');
	    }
	    
	});
	jQuery('.menu > li ul').mouseleave(function(){
	
	    if(jQuery(this).parent().hasClass('fake-hover')){
	    	jQuery(this).parent().removeClass('fake-hover');
	    }
	});
    jQuery('ul.menu').superfish();
    
    jQuery("#project-switch a:first").addClass('active');     
    jQuery(".project-panel").hide(); 
	jQuery(".project-panel:first").show();
	
	showProjects = function(data) {
		if (data==1){
    		jQuery("#project-switch a").removeClass('active');     		
			jQuery(".project-panel").hide();		
			jQuery("#all").fadeIn("slow");
    		jQuery("#project-switch .a1").addClass('active');     		
			}
		else if (data==2){
    		jQuery("#project-switch a").removeClass('active');     				
			jQuery(".project-panel").hide();		
			jQuery("#webdesign").fadeIn("slow");		
    		jQuery("#project-switch .a2").addClass('active');     		
		}
		else if (data==3) {
    		jQuery("#project-switch a").removeClass('active');     				
			jQuery(".project-panel").hide();		
			jQuery("#appdesign").fadeIn("slow");					
    		jQuery("#project-switch .a3").addClass('active');     		
		}
		else if (data==4) {
    		jQuery("#project-switch a").removeClass('active');     				
			jQuery(".project-panel").hide();		
			jQuery("#printdesign").fadeIn("slow");					
    		jQuery("#project-switch .a4").addClass('active');     		
		}
		else if (data==5) {
    		jQuery("#project-switch a").removeClass('active');     				
			jQuery(".project-panel").hide();		
			jQuery("#sonstige").fadeIn("slow");					
    		jQuery("#project-switch .a5").addClass('active');     		
		}	};
});
