// the magic emotioon touch :)


$(function(){
		   
    //------------------------------ home magic ------------------------------	   
		   
	$('.home_block a').hover(function(){	
									  
			$(this).children('.grey').stop().animate({ "opacity" : 0, }, 200);
			
	}, function(){
			$(this).children('.grey').stop().animate({ "opacity" : 1, }, 200);			
					  
	});	   
	
	
	$('.home_block a').click(function(){			  
	
			$(this).children('.grey').stop().animate({ "opacity" : 1, }, 200);
		    
			  
	});
	
		   
    
	//------------------------------ navigation magic -----------------------
	
	
	$('.portfolio').hover(function(){					
			$('#open_drop').css('display', 'block');			
					  
	});
    
	$('#open_drop').mouseleave(function(){					
			$(this).css('display', 'none');			
					  
	});
		
	
	//------------------------------ portfolio magic ------------------------
	
	$('.portfolio_block').hover(function(){			  

			
			$(this).children('.grey').stop().animate({ "opacity" : 0, }, 200);
			$(this).children('.desc').stop().animate({ "bottom" : 1, "width" : 265, "height" : 65, "opacity" : 1 }, 200);	

			
	}, function(){
			$(this).children('.grey').stop().animate({ "opacity" : 1, }, 200);
		    $(this).children('.desc').stop().animate({ "bottom" : 0,  "height" :0, "opacity" : 0}, 500);
			 
			  
	});
	
	
	$('.portfolio_block').click(function(){			  
	
			$(this).children('.grey').stop().animate({ "opacity" : 1, }, 200);
		    $(this).children('.desc').stop().animate({ "bottom" : 0,  "height" :0, "opacity" : 0}, 500);
			 
			  
	});
	
	
	
	//------------------------------  active buttons (toate in afara de single-uri) -----------------------
	
	var a = window.location.pathname.split("/")[1];
	if (a == "projects")
	{
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});	
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}
	
	if (a == "fresh-events")
	{
	jQuery(".news").css({backgroundPosition: 'left bottom'});
	jQuery(".news_footer").css({color: '#434343'});	
	}
	
	if (a == "releases")
	{
	jQuery(".news").css({backgroundPosition: 'left bottom'});
	jQuery(".news_footer").css({color: '#434343'});	
	}
	
    //alert(a); 

	var pathname = window.location.pathname;
  
	
	if(pathname=='/')
	{    
	jQuery(".home").css({backgroundPosition: 'left bottom'});	
	jQuery(".home_footer").css({color: '#434343'});	
	}	 
	
	if(pathname=="/news/") 
	{    
	jQuery(".news").css({backgroundPosition: 'left bottom'});
	jQuery(".general").css({backgroundPosition: 'left bottom'});	
	jQuery(".news_footer").css({color: '#434343'});	
	}	
	
	if(pathname=="/news/fresh-events/")
	{
	jQuery(".news").css({backgroundPosition: 'left bottom'});	
	jQuery(".fresh_events").css({backgroundPosition: 'left bottom'});
	jQuery(".news_footer").css({color: '#434343'});		
	}		
	
	if(pathname=="/news/releases/")
	{
	jQuery(".news").css({backgroundPosition: 'left bottom'});	
	jQuery(".releases").css({backgroundPosition: 'left bottom'});
	jQuery(".news_footer").css({color: '#434343'});		
	}	
	
	if(pathname=="/news/archive/")
	{
	jQuery(".news").css({backgroundPosition: 'left bottom'});	
	jQuery(".archive").css({backgroundPosition: 'left bottom'});
	jQuery(".news_footer").css({color: '#434343'});		
	}		
	
	
	if(pathname=="/portfolio/") 
	{    
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});
	jQuery(".all").css({backgroundPosition: 'left bottom'});	
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}
	
	
	
	if(pathname=="/portfolio/websites/")
	{
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});	
	jQuery(".websites").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	
	}		
	
	if(pathname=="/portfolio/applications/")
	{    
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});
	jQuery(".applications").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}	 
	
	if(pathname=="/portfolio/graphics/")
	{
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});	
	jQuery(".graphics").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}	 
	
	
	
	if(pathname=="/about/")
	{    
	jQuery(".about").css({backgroundPosition: 'left bottom'});	
	jQuery(".about_footer").css({color: '#434343'});	
	}	 
	
	if(pathname=="/contact/") 
	{   
    jQuery(".contact").css({backgroundPosition: 'left bottom'});	
	jQuery(".contact_footer").css({color: '#434343'});	
	}	  
	 
	 
	// if is pagination
	 
	var b = window.location.pathname.split("/")[1];
	var c = window.location.pathname.split("/")[2];
	var tot=b + c;
	
	
	if(tot=="portfoliopage") 
	{    
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});
	jQuery(".all").css({backgroundPosition: 'left bottom'});	
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}
	
	
	
	if(tot=="portfoliowebsites")
	{
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});	
	jQuery(".websites").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	
	}		
	
	if(tot=="portfolioapplications")
	{    
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});
	jQuery(".applications").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}	 
	
	if(tot=="portfoliographics")
	{
	jQuery(".portfolio").css({backgroundPosition: 'left bottom'});	
	jQuery(".graphics").css({backgroundPosition: 'left bottom'});
	jQuery(".portfolio_footer").css({color: '#434343'});	
	}	 
 
 
    

});


                                       



