var commentsOpen = false;

$(document).ready(function() {
					   
	$("#content img").each(function() {					 
		$(this).attr('title', '\u00A9 2011 funnel : eric kass');	
		$(this).attr('alt', '\u00A9 2011 funnel : eric kass');	
	});	
	
	
	
	$("iframe").each(function() {					 
		$(this).attr('scrolling', 'no');		
	});	
	
	
 if ( location.hash.indexOf('comment') != -1) {
		commentsOpen = true;
		$("#comments").show();
		$(".comment_toggle a").html('Hide Comments');
	}
						   
	$(".comment_toggle a").click(function(event) {			   
		event.preventDefault();
			if (!commentsOpen) {
				commentsOpen = true;
				//$("#comment-wrapper").slideToggle('normal');
				$("#comments").show();
				$(".comment_toggle a").html('Hide Comments');
			} else {
				commentsOpen = false;
				//$("#comment-wrapper").slideToggle('normal');
				$("#comments").hide();
				$(".comment_toggle a").html('View Comments');
			}
	});	
	
	
	
	
	
	var delay = 400;
    
    function hideMenu() {
        if (!$('.custom_button').data('in') && !$('.hover_menu').data('in') && !$('.hover_menu').data('hidden')) {
            $('.hover_menu').fadeOut('fast');
            $('.custom_button').removeClass('active');
            $('.hover_menu').data('hidden', true);
        }
    }
    
    $('.custom_button, .hover_menu').mouseenter(function() {
        $('.hover_menu').fadeIn('fast');
        $('.custom_button').addClass('active');
        $(this).data('in', true);
        $('.hover_menu').data('hidden', false);
    }).mouseleave(function() {
        $(this).data('in', false);
        setTimeout(hideMenu, delay);
    }); 
						   
						   
});

