<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

<div class=" row-fluid navbar navbar-fixed-top header-nav">
	<div class="logo span5"><img src="${ctx}/resources/images/header-logo.png" />${courseType}卷库管理</div>
	<div class="span5"></div>
	<div class="span2">
		<a class="useinfo" href="javascript:void(0)" onclick="switchRole()"><i class="icon-user icon-white"></i> <i>${web_session_role.name } ${web_session_user.name }</i></a>
		<a class="logout" href="${ctx }/j_spring_security_logout"><i class="icon-off icon-white"></i> <i>退出</i></a>
  	</div>
</div>

<script type="text/javascript">

//二级菜单控制
$('.headNav-link').mouseenter(function(){
	var self = $(this);
	var classNames = self.parent().attr('class').split(/\s+/);
		if($.inArray('current',classNames) == -1){
		$('.headNav-link').removeClass('hover');
		self.addClass('hover');
		$('.sub-menu').hide();
		self.next().css('top',46+"px").css('left',(self.offset().left)+"px").show();
	}
});

$('.sub-menu').mouseleave(function(){
	$('.sub-menu').hide();
	$('.headNav-link').removeClass('hover');
});

$(document).click(function(e){
	if(e.target.className != 'sub-menu-link'){
		$('.sub-menu').hide();
		$('.headNav-link').removeClass('hover');
	}
});

function changMenu(headMenu, subMenu, url){
	window.location.href="${ctx}/menu/changeMenu?headMenu="+headMenu+"&subMenu="+subMenu+"&url="+url;
}
if($(".current").length==0){
	$("#headMenu li:first-child").addClass("current");
}

function switchRole(){
	window.location.href="${ctx}/selectRole";
}
</script>
