
/**
 * Written by Marco Franchini for site odde2.com v2.0
 * Creation date: 21/05/2009
 *
 * Version: 1.0
 *
 **/


$(function(){
		
		/* Logo and menu fade */
		
		$("#logo").click(function() {
			$("#menu").fadeIn();
			$("#arrow").hide();
		});
		
		/* Arrow-boing boing..! */
		
		$("#arrow").everyTime( 10, function (){
		$("#arrow").animate({top:"10px"},400).animate ({top:" "},300);	
		});


		/* Opacity menuHeader */
		
		$("#menuWeb").animate({"opacity": .6},800);
		$("#menuDesign").animate({"opacity": .6},800);
		$("#menuVideo").animate({"opacity": .6},800);
		$("#menuContacts").animate({"opacity": .6},800);
		
	
		$("#menuWeb").hover(function() { 
		$(this).stop().animate({"opacity": 1},200);
		}, function(){
		$(this).stop().animate({"opacity": .6},800);
		});
		
		$("#menuDesign").hover(function() { 
		$(this).stop().animate({"opacity": 1},200);
		}, function(){
		$(this).stop().animate({"opacity": .6},800);
		});
			
		$("#menuVideo").hover(function() { 
		$(this).stop().animate({"opacity": 1},200);
		}, function(){
		$(this).stop().animate({"opacity": .6},800);
		});
		
		$("#menuContacts").hover(function() { 
		$(this).stop().animate({"opacity": 1},200);
		}, function(){
		$(this).stop().animate({"opacity": .6},800);
		});
		
		
		
		/* Menu linking */
		
		$("#menuWeb").click(function() {
			
			$("#web").fadeToggle("fast");
			$("#design").hide();
			$("#video").hide();
			$("#contacts").hide();
	
		});
		
		$("#menuDesign").click(function() {
			$("#design").fadeToggle("fast");
			$("#web").hide();
			$("#video").hide();
			$("#contacts").hide();
		});
	
	
		$("#menuVideo").click(function() {
			$("#video").fadeToggle("fast");
			$("#web").hide();
			$("#design").hide();
			$("#contacts").hide();
		});

		$("#menuContacts").click(function() {
			$("#contacts").fadeToggle("fast");
			$("#web").hide();
			$("#design").hide();
			$("#video").hide();
		}); 

	
	
		/* Contacts Tooltip */
		
		jQuery.fn.fadeToggle = function(speed, easing, callback) {
   	  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
		};
		
	/*	$("#menuContacts").click(function() {
			$("#menuContactsBox").fadeToggle("slow");
			$("#menuContacts").fadeOut(300);
			$(this).hide();
		});		

			$("#menuContactsBox").click(function() {
			$("#menuContacts").fadeIn("slow");
			$("#menuContactsBox").fadeOut("slow");
	
		});		*/



		/* SlideUp Hover "Video" */
	
		
		$('.imageWorkVideoImage').hover(function(){
			$(".imageWorkVideoImageSlide").fadeIn("slow");				 
			$(".imageWorkVideoImageSlide", this).stop().animate({bottom:'310px'},{queue:false,duration:160});
		}, function() {
			$(".imageWorkVideoImageSlide", this).stop().animate({bottom:'0px'},{queue:false,duration:160});
		});





		/* Opacity Content Contacts */
		

		$("#ContactsContentEmail").animate({"opacity": .6},800);
		$("#ContactsContentFacebookLink").animate({"opacity": .6},800);
		$("#ContactsContentLinkedinLink").animate({"opacity": .6},800);
		$("#ContactsContentSkypeLink").animate({"opacity": .6},800);


		$("#ContactsContentEmail").hover(function() { 
			$(this).stop().animate({"opacity": 1},200);
			}, function(){
			$(this).stop().animate({"opacity": .7},200);
			});

		$("#ContactsContentFacebookLink").hover(function() { 
			$(this).stop().animate({"opacity": 1},200);
			}, function(){
			$(this).stop().animate({"opacity": .7},200);
			});

		$("#ContactsContentLinkedinLink").hover(function() { 
			$(this).stop().animate({"opacity": 1},200);
			}, function(){
			$(this).stop().animate({"opacity": .7},200);
			});
	
		$("#ContactsContentSkypeLink").hover(function() { 
			$(this).stop().animate({"opacity": 1},200);
			}, function(){
			$(this).stop().animate({"opacity": .7},200);
			});



		/* Ajax/Jquery ContactsForm */


	 $('#myForm').ajaxForm(function(data) {
            if (data==1){
                $('#success').fadeIn("slow");
                $('#myForm').resetForm();
				$('#bademail').hide();
            }
            else if (data==2){
                $('#badserver').fadeIn("slow");
            }
            else if (data==3)
            {
                $('#bademail').fadeIn("slow");
            }
        });





});