$(document).ready(function(){
	var zurich=(function(){
		
		// sliding door effect for project images
		var img = $("#latest_projects .wp-post-image");
		var imgLen = img.length;
		
		for (i=0; i<imgLen; i++) {
			imgTitle = img.eq(i).attr("title");
			wrapper = img.eq(i).parents(".sliding_door_wrapper");
			wrapper.append("<span class='sliding_door'><span class='sliding_door_title'>"+imgTitle+"</span></span>");
			$(".sliding_door").css({opacity: "0"});
		}
		
		$(".sliding_door_wrapper").hover(function() {
			$(this).find(".sliding_door").stop().animate({
				opacity: "1",
			}, 300);
		}, function() {
			$(this).find(".sliding_door").stop().animate({
				opacity: "0"
			}, 300);
		});
		$(".sliding_door_wrapper").hover(function() {
			$(this).find(".sliding_door_title").stop().css({bottom: "-169px"}).animate({
				bottom: "-70px",
			}, 300);
		}, function() {
			$(this).find(".sliding_door_title").stop().animate({
				bottom: "169px"
			}, 300);
		});
		
		// remove the margin-right on the portfolio boxes
    	$('#latest_posts .box_right:nth-child(4n+4)').css("margin-right", "0px");
    	$('#latest_projects .box_right_2x2:nth-child(2n+2)').css("margin-right", "0px");
    	
    	// customize the nivo slider for the home page. 
	    $('#slider').nivoSlider({
	    	effect:'random',
	    	animSpeed:600,
	    	pauseTime:5000
	    });	
	    
		
	})();
	
});











