$(function() {
    Shadowbox.init();
    $(".active").parents("ul").css("display","block");
/*
	$('.b-left-menu li a').click(function(e) {
		var parent = $(this).parent();
		if (parent.find('ul').length > 0) {
			e.preventDefault();
			parent.toggleClass('active');
		}
	});
*/


	/*Clock*/
	var checkTime = function(i) {
		return i < 10 ? "0" + i : i;
	}
	
	var sc = $('.g-super-clock');
	var sc_timer;
	if (sc.length > 0) { set_super_clock(); }
	
	function set_super_clock() {
		var today=new Date();
		var h=today.getHours();
		var m=today.getMinutes();
		var s=today.getSeconds();
		// add a zero in front of numbers<10
		m=checkTime(m);
		s=checkTime(s);

		sc.html(h+":"+m+":"+s);
		
		sc_timer = setTimeout(function() { set_super_clock() }, 500);
	} // set_super_clock
});

