
$(function() {
	
	// Navigation bar
	$('.nav li').hover(function() {
		$(this).find('ul:first').css({
			opacity: 0, 
			visibility: 'visible'
		}).animate({
			opacity: 0.9
		}, 400);
	}, function(){
		$(this).find('ul:first').css({
			visibility: 'hidden'
		});
	});
	
	// PNG transparency fix for IE6
	if ($.browser.msie && $.browser.version === '6.0') {
		$('.search').supersleight({shim: '/img/empty.gif'});
	}
});

function adjustSidebarBorder() {
	var sidebar = $('.sidebar');
	var main_content = $('.main_content');
	if (sidebar.height() === null || main_content.height() === null) {
		return false;
	}
	if (sidebar.height() < main_content.height()) {
		sidebar.height(main_content.height());
	} else if (main_content.height() < sidebar.height()) {
		main_content.height(sidebar.height());
	}
}

$(window).load(function() { 
	if (appConfig.enable_adjust_sidebar_border) {
		adjustSidebarBorder();
	}
});

function d(v) {
	if (typeof console !== 'undefined') {
		console.log(v);
	} else {
		alert(v);
	}
}
