$(document).ready(function () {
	// set box slide
	var e_currentSlide;
	$('#e_navbar ul li').mouseover(function (){
		if(e_currentSlide == this)	return;
		
		if(e_currentSlide){
			var e_box = '#e_navbar_box li:eq(' + ($(e_currentSlide).index()) + ')';
			$(e_box).slideUp();
			e_currentSlide = '';
		} else {
			$('#e_navbar_hide').fadeIn('slow');
		}
		
		//var e_box = '#e_navbar_box_' + ($(this).index() + 1);
		var e_box = '#e_navbar_box li:eq(' + ($(this).index()) + ')';
		$(e_box).Hcenter();
		$(e_box).slideDown();
		e_currentSlide = this;
	});
	
	$('#e_navbar_hide').mouseover(function (){
		if(!e_currentSlide)	return;
		
		var e_box = '#e_navbar_box li:eq(' + ($(e_currentSlide).index()) + ')';
		$(e_box).slideUp();
		e_currentSlide = '';
		
		$('#e_navbar_hide').fadeOut('slow');
	});
});

jQuery.fn.Hcenter = function () {
	this.css("position","absolute");
	//this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
	this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
	return this;
}

