// Andi Priambodo, ENMEDS 2008
// Execute this after the site is loaded.

$(document).ready(function() {

	// em top navigation
	$("div.navigation li").hover(function() {
		$(this).children("ul").css('display', 'block');
		$(this).children("a").toggleClass('active');
	}, function() {
		$(this).children("ul").css('display', 'none');
		$(this).children("a").removeClass('active');
	});
	
	// side menu sub menu
	$("div.side-menu li ul").hide();	
	$("div.side-menu li").click(	
        function () {
			if ((this.childNodes.length) > 1 ){
				$(this).children("ul").slideToggle(500);
				$(this).children("a").toggleClass("down");
			}
			return false;
		}
	);
	
	//hide message_body after the first one
	$(".box-list .head:first").addClass('down');
	$(".box-list .detail:not(:first)").hide();
	
	//toggle message_body
	$(".box-list .head").click(function(){
		$(this).next(".detail").slideToggle(500)
		$(this).toggleClass('down')
		return false;
	});
	
	
	
	/*$(".table-view td").click(function(){
		if ($("this > a")){
			window.location=$(this).find("a").attr("href");
		}
		return false;
	});*/
});



