jQuery(function($){
	
	//dropdown menu
	$('.main-nav ul').superfish({
		speed: 'fast',
	    delay: 100,
	    animation:   {opacity:'show',height:'show'},
	    autoArrows:    false
	});
	
 
	// Featured posts
	$('#feature #slides').cycle({ 
	    fx:     'fade',
	    speed:  650, 
	    timeout: 7000, 
	    pager: '#pager' 
	});
	
	
	// IE last-child selectors
	$('.main-nav li:first-child').addClass('first');
	$('.main-nav li li:last-child').addClass('last');	  
	$('.main-nav li li li:first-child').addClass('first');
    $('#more-posts ul li:last-child').addClass('last');
    
    
    
    // fade images on hover
	$('#more-posts a img, #portfolio .post img').hover(function() {
		$(this).fadeTo("fast", 0.6);
	}, function() {
		$(this).fadeTo("fast", 1);
	});
	
	
	
	
	// Slide open/close more posts thumbnails
	$("#more-posts .toggle a").click(function(){
		$("#more-posts .thumbs").slideToggle(200);
	});
	
	// More posts toggle, add/remove class="open"
	$("#more-posts .toggle a").click(function(){
		if ($(this).parent().hasClass('open')) {
			$(this).parent().removeClass("open");
		} else {
			$(this).parent().addClass("open");
		}
	});
	

});