<#assign sec=JspTaglibs["http://www.springframework.org/security/tags"]>
<div id="headDiv">	
	<div id="logoa">
		<img class="logo1" src="${ctx}/assets/images/datacross.png">		
		<img class="logo2" src="${ctx}/assets/images/cut-off-rule.png">		
		<img class="logo3" src="${ctx}/assets/images/wificross.png">	
	</div>	
	<ul id="menu">
		<li><a href="${ctx}/advertiser/main/dashboard"><span>首页</span></a></li>
		
		<#if role == "agent">
		<@sec.authorize access="hasAnyRole('ROLE_agent_adgroup,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/ad/advertiser/list"><span>广告主管理</span></a></li>
		</@sec.authorize>
		<#elseif role == "advertiser">
		<@sec.authorize access="hasAnyRole('ROLE_agent_adgroup,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/ad/order/list?advertiserId=${userSession.advertiserId}"><span>订单管理</span></a></li>
		</@sec.authorize>
		</#if>
		
		<@sec.authorize access="hasAnyRole('ROLE_agent_rpt,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/ad/report/advertiser-report"><span>数据报表</span></a></li>
		</@sec.authorize>
		
		<@sec.authorize access="hasAnyRole('ROLE_agent_banner,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/ad/banner-template/list"><span>创意中心</span></a></li>
		</@sec.authorize>
		
		<@sec.authorize access="hasAnyRole('ROLE_agent_finance,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/finance/adv-balance/list"><span>财务管理</span></a></li>
		</@sec.authorize>
		
		<@sec.authorize access="hasAnyRole('ROLE_agent_authority,ROLE_MANAGER')">
			<li><a href="${ctx}/advertiser/main/authority/list"><span>账号管理</span></a></li>
		</@sec.authorize>  			
	</ul>	
	<div id="divselect">
		<div id="currentOpa">
			<cite><li>${userSession.description}</li><li>${userSession.accountName}</li></cite>
		</div>
		<ul>
			<li><a href="${ctx}/advertiser/main/authority/loginperson" selectid="1">修改个人信息</a></li>
			<li><a href="${ctx}/logout" selectid="2">退出登录</a></li>       
		</ul>
		<input type="hidden" value="${ctx!}" id="ctx"/>
		<input type="hidden" id="role" value="${role!}"/>
		<input type="hidden" id="sessionagentId" value="${userSession.agentId!}"/>
		<input type="hidden" id="sessionadvertiserId" value="${userSession.advertiserId!}"/>
		<input type="hidden" id="sessionadvertiserName" value="${advertiserName!}"/>
		<input type="hidden" id="sessionoperatorId" value="${userSession.operatorId!}"/>
	</div>    		
</div>	
<script type="text/javascript">
	$(function(){
	
		var path = window.location.pathname;
		if(path.indexOf("dashboard") != -1){
			$("#menu a:first").addClass("menu_change");
		};
		if((path.indexOf("ad/advertiser") != -1)
				||(path.indexOf("ad/order") != -1)
				||(path.indexOf("ad/target") != -1)){
			$("#menu a:eq(1)").addClass("menu_change");
		};
		if(path.indexOf("report") != -1){
			$("#menu a:eq(2)").addClass("menu_change");
		};
		if(path.indexOf("banner-template") != -1){
			$("#menu a:eq(3)").addClass("menu_change");
		};
		if(path.indexOf("adv-balance") != -1){
			$("#menu a:eq(4)").addClass("menu_change");
		};
		if(path.indexOf("authority") != -1){
			$("#menu a:eq(5)").addClass("menu_change");
		};
		
	});
	
</script>