$(document).ready(function(){
	// Opens and closes the #about di
	$(".toggle_container").hide(); 
	$(".trigger").click(function(){
		$(".toggle_container").slideToggle("slow");
	});
	
	$('.workSpace').hide();
	
	// Opens the .workSpace div of the current clicked .port div
	$('.port, .closeButton').click(function(){
		
		if($(this).attr("contentID") != $('.workSpace:visible').attr("contentID") && $(".workSpace:animated").length == 0){ 
			var current = $(this);
			if($('.workSpace:visible').length > 0){
				$('.workSpace:visible').slideToggle(700, function() {
					$('.workSpace[contentID="'+$(current).attr('contentID')+'"]').slideToggle(700);
				});
			}else{
				$('.workSpace[contentID="'+$(current).attr('contentID')+'"]').slideToggle(700);
			}
		}
	});
			
	// toTop easeOutQuart Start.
	$().UItoTop({ easingType: 'easeOutQuart' });	
	
	// Portfolio hover effect
	$(".portStyle").hover(function(){
		$(this).find(".item-title").fadeTo("fast", 0.8); 
	},function(){
		$(this).find(".item-title").fadeTo("fast", 0.0);
	});
});

$(function(){
    $('a[href*=#]').click(function() {    
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
        && location.hostname == this.hostname) {        
            var $target = $(this.hash);            
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');            
            if ($target.length) {            
                var targetOffset = $target.offset().top;                
                $('html,body').animate({scrollTop: targetOffset}, 700);                    
                return false;                
            }            
        }        
    });    
});

	
	

