$(document).ready(function() {
    
      $('a[href^="http://"]').filter(function() {
        return this.hostname && this.hostname !== location.hostname;
      }).attr('target', '_blank');
    
    	$("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({
    		'transitionIn'	:	'elastic',
    		'transitionOut'	:	'elastic',
    		'speedIn'		:	500, 
    		'speedOut'		:	500, 
    		'titleShow'	:	false
    	});

      $("a[href^=http://www.youtube.com/watch?v=],a[href^=http://youtube.com/watch?v=]").click(function() {
    	$.fancybox({
    			'padding'		: 0,
        	'transitionIn'	:	'fade',
        	'transitionOut'	:	'none',
        	'speedIn'		:	500, 
        	'speedOut'		:	500, 
        	'titleShow'	:	false,
    			'width'		: 560,
    			'height'		: 349,
    			'href'			: this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
    			'type'			: 'swf',
    			'swf'			: {
    			   	 'wmode'		: 'transparent',
    				'allowfullscreen'	: 'true'
    			}
    		});
    		return false;
      });
      
      $('#header ul li a, #footer ul li a').hover(function() {
          $(this).animate({ opacity : "0.7" }, 400);            
      }, function() {
          $(this).animate({ opacity : "1" }, 400);
      });
      
      $('#comment').autoResize({
        extraSpace : 0
      });
      
      $('#comment-hide').hide();
      
      $('#comment').focus(function(){
        $('#comment-hide').show();  
      });
    	
});
