<%
exitstr="<script>top.location.replace('login.asp');</script>"
if UserType<>1 then response.write exitstr
if PassWord="eims" or PassWord=""  Then response.write exitstr
if Trim(Request.Cookies("PassWord"))<>PassWord Then response.write exitstr

function Mgt(Permis)
if Permis="" then exit function
if Permis="admin" then '管理员权限
	if instr(Permission,"a")<1 then
	response.write "<div align='center'><div style='margin:100px auto; width:300px; padding:20px 10px; background:#ffffee; border:#FF0000 solid 1px;text-align:center'>"
	response.write "<img src='img/note.gif' align='absmiddle'>你没有该项目的管理权限！</div></div>"
	response.End()
	end if
else
	if instr(Permission,Permis)<1 then
	if instr(Permission,"a")<1 then
	response.write "<div align='center'><div style='margin:100px auto; width:300px; padding:20px 10px; background:#ffffee; border:#FF0000 solid 1px;text-align:center'>"
	response.write "<img src='img/note.gif' align='absmiddle'>你没有该项目的管理权限！</div></div>"
	response.End()
	end if
	end if
end if
end function

if Trim(request.QueryString("action"))="exit" then ExitSystem()
function ExitSystem() 'LogOut / Exie
   Response.Cookies("UserID") = ""
   Response.Cookies("UserName") = ""
   Response.Cookies("PassWord") = ""
   Response.Cookies("Permission") = ""   
   Response.Cookies("UserID").Expires=now-1
   Response.Cookies("UserName").Expires=now-1
   Response.Cookies("PassWord").Expires=now-1
   Response.Cookies("Permission").Expires=now-1
   Response.Write "<script>top.location.replace('login.asp');</script>"
   Response.End
end function

%>
