$(document).ready( function() {
	var track_home_middle = '';  
	var switch_off;
	var switch_on;
	$ec('#home_middle div').mouseenter(
		function(){ 
			if(track_home_middle == '$' + this.id){
				clearTimeout(switch_off);
				return;
			}else{
				track_home_middle = '$' + this.id;
			}

			var $that = '#' + this.id;
			switch_on =	setTimeout(function(){ $($that).stop().animate({ top: '-' +  $($that).height() + 'px' }); }, 100); 
		}).mouseleave(
		function(){
			if(track_home_middle == '$' + this.id){
				clearTimeout(switch_on);
				track_home_middle = '';
			}else{
				track_home_middle = '$' + this.id;
			}

			var $that = '#' + this.id;
			switch_off = setTimeout(function(){ $($that).stop().animate({ top: 0 }); }, 100)
	});
	var track_home_bottom = '';  
	var turn_off;
	var turn_on;
	$ec('#home_bottom > div').hover(
		function(){
			var $this = '#' + this.id + ' ul';
			if(track_home_bottom == $this){
				clearTimeout(turn_off);
				return;
			}else{
				track_home_bottom = $this;
			}

			turn_on = setTimeout(function(){ $($this).stop().animate({top: '0'}); }, 100)
		},
		function(){
			var $this = '#' + this.id + ' ul';
			if(track_home_bottom == $this){
				clearTimeout(turn_on);
				track_home_bottom = '';
			}else{
				track_home_bottom = $this;
			}
			
			turn_off = setTimeout(function(){ $($this).stop().animate({top: '148px'}); }, 100);
		});
});
