// JavaScript Document
jQuery.noConflict(); 

jQuery(function(){
	 jQuery(".sub_nav_content a, .content_main  a, .main_nav  a, .description a, .news_gfx, .c_right a, .pics_data a").hover(function(){
		 	jQuery(this).children(".active").show();
			jQuery(this).children(".default").hide();
	
		},
		function () {
			jQuery(this).children(".active").hide();
			jQuery(this).children(".default").show();
		}
	);
	 
	jQuery(".scissor").hover(function(){
			jQuery(this).css({'left' : '852px'});					 
		 	jQuery(this).children(".active").show();
			jQuery(this).children(".default").hide();
	
		},
		function () {
			jQuery(this).css({'left' : '862px'});
			jQuery(this).children(".active").hide();
			jQuery(this).children(".default").show();
		}
	);	

	jQuery("#movies").click(function(){
		jQuery(".cat_movies").show();
		jQuery("table a:not(.cat_movies)").hide();
		return false;
	});
	
	jQuery("#opera").click(function(){
		jQuery(".cat_opera").show();
		jQuery("table a:not(.cat_opera)").hide();
		return false;
	});
	
	jQuery("#productiondesign").click(function(){
		jQuery(".cat_productiondesign").show();
		jQuery("table a:not(.cat_productiondesign)").hide();
		return false;
	});
	
	jQuery("#show").click(function(){
		jQuery(".cat_show").show();
		jQuery("table a:not(.cat_show)").hide();
		return false;
	});
	
	jQuery("#illus").click(function(){
		jQuery(".cat_illus").show();
		jQuery("table a:not(.cat_illus)").hide();
		return false;
	});
	
	jQuery("#all").click(function(){
		jQuery(".cat_movies, .cat_opera, .cat_illus, .cat_show, .cat_productiondesign").show();
		return false;
	});
	
	jQuery(".pics").click(function(){
		jQuery(".me_detail").show();
		jQuery(".me_data").hide();
		return false;
	});
	
	jQuery(".data").click(function(){
		jQuery(".me_data").show();
		jQuery(".me_detail").hide();
		return false;
	});
	 
	jQuery(".contact a").toggle(
		function() {
	 		jQuery(".contact_main").slideDown("slow");
			myTimer = jQuery.timer(1200,function(){
	 		jQuery(".contact_content").fadeIn("slow");
	 	});
	},
	function() {
		jQuery(".contact_content").fadeOut("slow");
		myTimer = jQuery.timer(400,function(){
		jQuery(".contact_main").slideUp("slow");
	});
	}
	); 
});

jQuery(function(){
	jQuery("#send").click(function(){
		var name = jQuery("#name").val();
		var email = jQuery("#email").val();
		var message = jQuery("#message").val();
		function urlencode(s) {
		 s = encodeURIComponent(s);
		 return s.replace(/~/g,'%7E').replace(/%20/g,'+');
		 }
		
		
		jQuery.ajax({
			url: "kontakt.php",
			type: "POST",
			data: "name=" + name + "&email=" + email + "&message=" + urlencode(message),

			success: function(response){
				jQuery("#antwort").remove();
				jQuery(".c_right").append("<span id='antwort'>" + response + "</p>");
			}
		});
		return false;
	});
	
	jQuery("#clear").click(function() {
    	jQuery("form").each(function() {
      		this.reset();
     	});
	return false;
   });

});
