// JavaScript Document

var handle;

function close_all(){
	$(".body").each(function(i){
		if($(this).attr("expand")=="true"){
		}else{
			var min_height = ($(this).children(0).height())+(5);
			$(this).animate({height: min_height+"px"}, "fast");
		}
	});
}
function clear_all(){
	$(".body").each(function(i){
		$(this).attr("expand","false");
	});
}

function shut_down(){
	clear_all();
	close_all();
}

//$(document).ready(function(){
							 
window.onload = function (){ 						   
	$('.category').hover(function(){
		if($(this).children(".body").attr("expand")=="true"){
			clearTimeout(handle);
		}else{
			clearTimeout(handle);
			clear_all(handle);
			$(this).children(".body").attr("expand","true");
			$(this).children(".body").animate({height: "200px"}, "fast", "", function(){close_all();});
		}
	},function(){
		handle=setTimeout("shut_down()", 1000);
		//shut_down();
	});
	
	shut_down();
}
//});