

$(document).ready(function(){
	
$(".menu li").hover(function() {   
    $(this).find(".dropdown").delay(300).animate({height: "show"},300);
	},function(){
    	$(this).find(".dropdown").delay(300).stop(true, true).animate({height: "hide"},300);
});

$(".menu > li > a" ).click(function() { 
	$(".menu > li > a").removeClass("selected");
	$(".dropdown > li > a").removeClass("selected-sub");
	$(this).addClass("selected");
});

$(".dropdown > li > a").click(function() { 
	$(this).parent().parent().parent().parent().find("li > a").removeClass("selected");
	$(this).parent().parent().parent().find("> a").addClass("selected");
	
	$(".dropdown > li > a").removeClass("selected-sub");
	$(this).addClass("selected-sub");

});


	$(function() {$(".screen img").autoMouseOver();});    
	$(function() {$(".coffee img").autoMouseOver();}); 
	$(function() {$(".iphone img").autoMouseOver();}); 
	$(function() {$(".ipad img").autoMouseOver();}); 
	$(function() {$(".mouse img").autoMouseOver();}); 

	$(".mouse").stop(true,true).mouseover(function(){
		  $(this).animate({'rotate': 40});
		  $(this).animate({
			  marginTop: "350px",
			  marginLeft: "650px"
		  }, 1500 );
	});
	
	$(".mouse").stop(true,true).mouseover(function(){
		  $(this).animate({'rotate':0});
		  $(this).animate({
			  marginTop: "330px",
			  marginLeft: "630px;"
		  },1500);
	});
	
	$(".ipad").stop(true,true).mouseover(function(){
		  $(this).animate({'rotate': -42}, 500);
	});
	
	$(".ipad").stop(true,true).mouseover(function(){
		  $(this).delay(1000).animate({'rotate':0} ,1500);
	});
	
	$(".iphone").stop(true,true).mouseover(function(){
		  $(this).animate({
			  marginTop: "370px",
			  marginLeft: "78px",
		  }, 1500 );
		  $(this).animate({'rotate':-38});
	});
	
	$(".iphone").stop(true,true).mouseover(function(){
		  $(this).delay(1000).animate({'rotate':0});
		  $(this).animate({
			  marginTop: "350px",
			  marginLeft: "90px",
		  }, 1500 );
	});
	
	$("img.hover").hover(function(){
	  $(this).animate({"opacity": "0.8"}, "medium");
	},
	function(){
	  $(this).animate({"opacity": "1"}, "medium");
	});

	$(".navigation-item").hover(function(){  $(this).stop().animate({"padding-top": "15"}, "fast");},
								function(){  $(this).stop().animate({"padding-top": "7"}, "medium");
	});
	
	$(".category").hover(function(){
		$(this).find('.filtrable-text').stop(true,true).fadeIn("slow");
	  	$(this).find('.zoom-project').stop(true,true).fadeIn("slow");
	  	$(this).find('.href-project').stop(true,true).fadeIn("slow");
	},
	function(){
	  	$(this).find('.filtrable-text').stop(true,true).fadeOut("slow");
	  	$(this).find('.zoom-project').stop(true,true).fadeOut("slow");
	  	$(this).find('.href-project').stop(true,true).fadeOut("slow");
	});
	
	$(".portfolio-one-item").hover(function(){
		$(this).find('.picture-one-text').stop(true,true).fadeIn("slow");
	  	$(this).find('.zoom-project-one').stop(true,true).fadeIn("slow");
	  	$(this).find('.href-project-one').stop(true,true).fadeIn("slow");
	},
	function(){
		$(this).find('.picture-one-text').stop(true,true).fadeOut("slow");
	  	$(this).find('.zoom-project-one').stop(true,true).fadeOut("slow");
	  	$(this).find('.href-project-one').stop(true,true).fadeOut("slow");
	});
	
	
	
	

	$(".scrollto").click(function() {
		$.scrollTo($($(this).attr("href")), {
			duration: 1000,
			axis:'y',
			easing: 'easeOutCubic'
		});
		window.location.hash = $(this).attr("href");
		return false;
	});
	
	$('a.top').click(function(){
		 $('html, body').animate({scrollTop: '0px'}, 1000);
		 return false;
	})
	
});


$(window).load(function() {
	
		$('.filtrable-titles li a').click(function() {
				
					$('.filtrable-titles li').removeClass('selected-filtrable');
					$(this).parent('li').addClass('selected-filtrable');
					
					thisItem 			= $(this).attr('id');
					
					if(thisItem != "all") {
					
						$('.filtrable-items li[class='+thisItem+']').stop(true, true).show('slow')																	
						$('.filtrable-items li[class!='+thisItem+']').stop(true, true).hide('medium')
					} else {
						$('.filtrable-items li').stop().show('slow');
					}
				});
				
				$('img.filtrable-image').animate({'opacity' : 0.95}).hover(function() {
					$(this).animate({'opacity' : 1});
				}, function() {
					$(this).animate({'opacity' : 0.95});
				});	
});


$(document).ready(function(){
	$(".group1").colorbox();
});

