$(function(){
	
	var SI_roll = null; 
	
  $('#articles').masonry(
  		{ 
  			columnWidth: 115,
  			itemSelector: '.cs_item'
  		});
  	
  $('#articles .cs_item').delay(600).fadeTo('slow', 1);
  		
  //$('.cs_item').mouseover(function () {
  $('.cs_item').mouseenter(function () {
  	
  	$('.cs_item article:visible').hide();  	
  
  	var $this = this;
  	/*
  	
  	clearTimeout(SI_roll);
  	SI_roll = setTimeout(function () {
  	*/
  		$('article', $this).css('z-index', 2000).show();
  	
 	/*
 	  
 	 }, 500);
 	*/
  	
  });
  /*
  $('.cs_item').mouseleave(function () {
  	clearTimeout(SI_roll);
  });
  */
  $('.cs_item article').mouseleave(function () {
  	//clearTimeout(SI_roll);
  	$(this).hide();
  });
  
  //Related
   //$('.related-item').mouseover(function (e) {
   $('.related-item').mouseenter(function (e) {
  	
  	var elm = this;
  	var $ro = $('.related-rollover', elm);
   	var $div = $(this).parent().parent();
  		
  	$('.related-item .related-rollover').hide();
  	$('div.related').stop().animate({
	  			'margin-bottom': 30
	  		});
  	
	if ($div.css('margin-bottom') != '120px') {  	
	  	$div.clearQueue().animate({
	  		'margin-bottom': 200
	  		
	  	});
  	}
  	
  	//clearTimeout(SI_roll);
  	//SI_roll = setTimeout(function () {	
	  	$ro.css('z-index', 2000).show();	
  	//}, 500);
  
  	
  	//$ro.bind('mouseout', ff);
  	
  	
  });
  
  $('.related-item').mouseleave(function () {
  	//clearTimeout(SI_roll);
  	$('div.related').stop().animate({
	  			'margin-bottom': 30
	  		});
  });
  $('.related-item .related-rollover').mouseleave(function () {
  	clearTimeout(SI_roll);
  	$(this).hide();
  	$('div.related').stop().animate({
	  			'margin-bottom': 30
	  		});  	
  });
  

  /*
  $('#authors-list li a').hover(function () {
  	
  	var id = $(this).attr('rel');
  	
  	$('#author-'+id).fadeTo(1);
  	console.log($('div[id="author-'+id+'"] img').first());
  	
  	$('div[id="author-'+id+'"] img').stop().fadeTo('normal', 1);
  	$('div[id!="author-'+id+'"] img').stop().fadeTo('normal', .3);
  	

  	
  }, function () {
  	
  	$('div.cs_item img').stop().fadeTo('normal', 1);
  	
  });
  */
  

});
