<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ taglib uri="/WEB-INF/taglib/fmt.tld" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<div data-options="region:'north',border:false">
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand"><img src="${ctx}/static/school_logo/${school_logo}" /></a>
				<div class="nav-collapse collapse navbar-responsive-collapse">
				<ul id="head-ul" class="nav">
						<c:if test="${web_user.roleMap['student']!=null }">
						<li id="top-ks-1" <c:if test="${fn:startsWith(request_uri, '/analysis/department')}">class="active"</c:if>>
							<a href="${ctx}/analysis/home/stu">教研室分析</a>
						</li>
						</c:if>
					</ul>
					<ul class="nav pull-right">
						<li class="mr-t"><img src="${ctx}/static/admin/images/logo-mini.png" /></li>
						<li><a href="#">${web_user.name}</a>
						</li>
						<li class="divider-vertical"></li>
						<li><a href="${ctx}/student-logout">退出</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	String.prototype.endWith = function(s) {
		if (s == null || s == "" || this.length == 0 || s.length > this.length)
			return false;
		if (this.substring(this.length - s.length) == s)
			return true;
		else
			return false;
		return true;
	}
	
	function validInfoInput(inputObj, dataObj){
		var name = inputObj.attr('name');
		var value = inputObj.val();
		var min = inputObj.attr('data-min');
		var max = inputObj.attr('data-max');
		var gt = inputObj.attr('data-gt');
		if(inputObj.hasClass('required-input') && value.length==0){
			inputObj.parent().parent().addClass('error');
			inputObj.parent().find('span.help-inline').html('输入内容不能为空');
			return false;
		}
		if(inputObj.hasClass('number-input')){
			if(!$.isNumeric(value)){
				inputObj.parent().parent().addClass('error');
				inputObj.parent().find('span.help-inline').html('输入内容必须为数字');
				return false;
			}
			if(max!=undefined && max.length>0 && value>max){
				inputObj.parent().parent().addClass('error');
				inputObj.parent().find('span.help-inline').html('输入内容必须不大于'+max);
				return false;
			}
			if(min!=undefined && min.length>0 && value<min){
				inputObj.parent().parent().addClass('error');
				inputObj.parent().find('span.help-inline').html('输入内容必须不小于'+min);
				return false;
			}
			if(gt!=undefined && gt.length>0 && value<=gt){
				inputObj.parent().parent().addClass('error');
				inputObj.parent().find('span.help-inline').html('输入内容必须不大于'+gt);
				return false;
			}
			if(dataObj!=undefined){
				eval('dataObj.'+name+'='+value);
			}
		}else{
			if(dataObj!=undefined){
				eval("dataObj."+name+"='"+value+"'");
			}
		}
		inputObj.parent().parent().removeClass('error');
		inputObj.parent().find('span.help-inline').html('');
		return true;
	}
</script>