<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.emframe.dev.config.SystemConfig,
                                                                             com.novell.emframe.fw.LookAndFeelDefaults" %>
<!-- //File:.../default/HomePage.jsp -->
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%
   com.novell.emframe.dev.MContext context = com.novell.emframe.fw.FwUtils.getMContext(request);
   SystemConfig configuration = SystemConfig.getSystemConfig(context);

   String orgName = LookAndFeelDefaults.OrganizationName;

   if(configuration.getSetting("LookAndFeel_OrganizationName") != null)
      orgName = configuration.getSetting("LookAndFeel_OrganizationName");

%>

<iman:stringtable bundle="DevResources"/>
<iman:stringtable bundle="FwResources"/>
<iman:stringtable bundle="com.novell.emframe.version"/>
<c:set var="GeneralMsg.Title" scope="request" value="Message Test"/>
<c:set var="GeneralMsg.Body" scope="request" value="Test Message"/>
<HTML>
<HEAD>
<LINK href="<c:out value='${ModulesPath}' />/dev/css/hf_style.css" rel="styleSheet" type="text/css">
<LINK href="<c:out value='${ModulesPath}' />/dev/css/hf_message.css" rel="styleSheet" type="text/css">
<iman:eMFrameScripts/>


<script>
   function openHiddenTaskWindow()
   {
      var strUrl = "webacc?taskId=fw.HiddenPluginsInfo&merge=fw.HiddenPluginsInfo&User.context=<iman:toScript><c:out value='${User.context}'/></iman:toScript>";
      var winOptions = "toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,width=650,height=650";
      win = window.open(strUrl, "HiddenPluginsInfo", winOptions);
      win.focus();
   }

   function checkTop()
   {
      if(_top != self)
      {
         alert("not at top");
         _top.location = "webacc?taskId=fw.HomePage";
      }
   }

   function checkLevel()
   {
      var w = self;
      if(w.parent.parent != top)
      {
         while(w.parent.parent != top)
         {
            w = w.parent;
         }
         w.location = "webacc?taskId=fw.HomePage";
      }
      else
      {
         if(top.Branding && top.Branding.setCollectionModeText)
         {
            top.Branding.setCollectionModeText('<iman:toScript><c:out value="${modeWithAccess}" /></iman:toScript>');
         }
      }
   }

   function toggleDivDisplay(id)
   {
      var el = document.getElementById(id).style;
      if (el.display=="none") el.display = "block";
      else el.display = "none";
   }

   function launchModulesToInstall()
   {
      var strUrl = "webacc?NPService=fw.LaunchService&NPAction=Delegate&delegate=fw.ModulesToInstall" +
                   "&launcher=fw.HomePage&lifecycle=Recreate" +
                   "&merge=fw.ModulesToInstall";
//  This state is costly                 "&moduleaction=Refresh";
      window.location.href = strUrl;
   }

   function refreshTasksView()
   {
   	top.Mainscreen.location.href = "webacc?taskId=dev.Empty&merge=fw.Body&view=Tasks";
   }
</script>

</HEAD>
<c:set var="refreshTasksView"><%=com.novell.emframe.fw.FwAttr.getFwRequestAttribute("refreshTasksView", request) %></c:set>
<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF" 
	onload="javascript:checkLevel()<c:if test="${refreshTasksView}">;refreshTasksView()</c:if>
				<c:if test="${sessionScope.DeviceType == 'browser' && firstTime=='true'}">; if (top.Mainscreen && top.Mainscreen.Nav && top.Mainscreen.Nav.menu) {top.Mainscreen.Nav.menu.doBold(0);}</c:if>
			"
>

<c:if test="${LookAndFeel_ShowHomeImage == 'true'}">
	<div id="Layer2" style="position:absolute; left:10px; top:5px; width:533px; height:46px; z-index:2">
		<img src="<c:out value="${ContextPath}" /><c:out value="${LookAndFeel_HomeImage}" />" 
			width="563" height="37" alt="" border="0">
	</div>
	<div class=smalltext id="Layer3" style="position:absolute; left:15px; top:31px; width:495px; height:15px; z-index:3"><iman:string key="Application.verString" />&nbsp;&nbsp;<iman:string key="displayversion" /></div>
	<br>
</c:if>
<c:if test="${LookAndFeel_ShowHomeImage == 'false'}">
		<div class="head1bldotline"><%= orgName %></div>
		<div class="allcaps"><iman:string key="Application.verString" />&nbsp;&nbsp;<iman:string key="displayversion" /></div>
</c:if>
   <div style="font-size: 0.9em; margin-left:5px;">
      <!-- general message -->
		<c:if test="${!empty requestScope['GeneralMsg.MsgBody']}">
      	<iman:include page="dev/Messagebar_inc.jsp" />
   	</c:if>

      <!-- login information -->
		<c:if test="${User.disconnected != 'true'}" >
         <br>
         <c:out value="${loginMessage}" escapeXml="false"/>
		</c:if>
      <!-- security warning -->
		<c:if test="${warnNonSecure == 'true'}">
         <br><b><iman:string key="HomePage.Warn.nonSecure" /></b>
		</c:if>
		<c:if test="${hiddenTasks == 'true'}">
         <br>
         <br>
         <c:set var="link"><a href="javascript:openHiddenTaskWindow();"><iman:string key="HomePage.HiddenTasks.Link" /></a></c:set>
<!-- Old Hidden Task Message Section
         <div>
            <table border=0 cellpadding=0 cellspacing=0 width=400>
               <tr class="head4">
               <td><IMG height="32" width="32" src="<c:out value='${ModulesPath}' />/dev/images/notice32.gif" align="top"></td>
               <td><span class="typegold1"><iman:string key="HomePage.HiddenTasks.Notice" /></span>&nbsp;&nbsp;<iman:string key="HomePage.HiddenTasks.Title" /></td>
               </tr>
               <tr style="font-size: 0.81em;">
               <td>&nbsp;</td>
               <td><iman:string key="HomePage.HiddenTasks.Msg" param="${link}" /></td>
               </tr>
            </table>
         </div>
-->
<!-- Start New Hidden Task Message Section -->

		<div id="errormessage" class="message" style="display: block">
			<b class="messagebox">
				<b class="messagebox1"><b></b></b>
				<b class="messagebox2"><b></b></b>
				<b class="messagebox3"></b>
				<b class="messagebox4"></b>
				<b class="messagebox5"></b>
			</b>

			<div class="messagebox_content">
				<!-- Message content Goes Here -->
				<c:if test="${sessionScope.DeviceType == 'browser'}">
					<img style="position:absolute; left:0px; top:0px; width:32px; height:32px; z-index:3" src="<c:out value='${ModulesPath}' />/dev/images/info_icon32.gif" align="absmiddle">
				</c:if>
				<c:if test="${sessionScope.DeviceType != 'browser'}">
					<img style="position:absolute; left:6px; top:0px; width:32px; height:32px; z-index:3" src="<c:out value='${ModulesPath}' />/dev/images/info_icon32.gif" align="absmiddle">
				</c:if>
				<div class="messagetext" style="margin-left: 20px">
					<span class="infotype"><iman:string key="HomePage.HiddenTasks.Notice" /></span>&nbsp;&nbsp;<b><iman:string key="HomePage.HiddenTasks.Title" /></b>
				</div>
				<div class="subtext"><iman:string key="HomePage.HiddenTasks.Msg" param="${link}" /></div>
			</div>
			
			<b class="messagebox">
				<b class="messagebox5"></b>
				<b class="messagebox4"></b>
				<b class="messagebox3"></b>
				<b class="messagebox2"><b></b></b>
				<b class="messagebox1"><b></b></b>
			</b>
		</div>

<!-- End New Hidden Task Message Section -->
      </c:if>

   <c:if test="${showModuleInstall}">
   	<c:set var="NPMlink"><a href="#" onClick="javascript:launchModulesToInstall();" ><iman:string key="HomePage.NPMLinkForTitle" /></a></c:set>
<!-- Old NPM Install URL Section
   	<div style="display: block">
      	<table border=0 cellpadding=0 cellspacing=0 width=400>
         	<tr class="head4">
         	<td><IMG height="32" width="32" src="<c:out value='${ModulesPath}' />/dev/images/notice32.gif" align="top"></td>
         	<td><span class="typegold1"><iman:string key="HomePage.HiddenTasks.Notice" /></span>&nbsp;&nbsp;<b><iman:string key="HomePage.NPMTitle" param="${NPMlink}" /></b></td>
	         </tr>
   	      <tr style="font-size: 0.81em;">
      	   <td>&nbsp;</td>
         	<td><iman:string key="HomePage.NPMBody" /></td>
         	</tr>
      	</table>
	   </div>
 -->
<!-- Start New NPM Install URL Section -->

		<div id="errormessage" class="message" style="display: block">
			<b class="messagebox">
				<b class="messagebox1"><b></b></b>
				<b class="messagebox2"><b></b></b>
				<b class="messagebox3"></b>
				<b class="messagebox4"></b>
				<b class="messagebox5"></b>
			</b>

			<div class="messagebox_content">
				<!-- Message content Goes Here -->
				<c:if test="${sessionScope.DeviceType == 'browser'}">
					<img style="position:absolute; left:0px; top:0px; width:32px; height:32px; z-index:3" src="<c:out value='${ModulesPath}' />/dev/images/info_icon32.gif" align="absmiddle">
				</c:if>
				<c:if test="${sessionScope.DeviceType != 'browser'}">
					<img style="position:absolute; left:6px; top:0px; width:32px; height:32px; z-index:3" src="<c:out value='${ModulesPath}' />/dev/images/info_icon32.gif" align="absmiddle">
				</c:if>
				<div class="messagetext" style="margin-left: 20px">
					<span class="infotype"><iman:string key="HomePage.HiddenTasks.Notice" /></span>&nbsp;&nbsp;<b><iman:string key="HomePage.NPMTitle" param="${NPMlink}" /></b></div>
				<div class="subtext"><iman:string key="HomePage.NPMBody" /></div>
			</div>
			
			<b class="messagebox">
				<b class="messagebox5"></b>
				<b class="messagebox4"></b>
				<b class="messagebox3"></b>
				<b class="messagebox2"><b></b></b>
				<b class="messagebox1"><b></b></b>
			</b>
		</div>

<!-- End New NPM Install URL Section -->
	</c:if>

   	<c:choose>
   		<c:when test="${sessionScope.DeviceType == 'browser'}">
   			<c:set var="displaySetting" value="block" />
   		</c:when>
   		<c:otherwise>
	  			<c:set var="displaySetting" value="block" />
   		</c:otherwise>
   	</c:choose>
	   <div id="modeDetails" class="margintop3" style="display:<c:out value="${displaySetting}" />">
<!-- Begin Old Access mode definitions
	      <div class="mediumtext" style="margin-top: 0.8em; margin-left: 0.4em"><iman:string key="HomePage.UnrestrictedAccessWithAccess" /></div>
	      <div class="formdescriptext" style="width: 450px; margin-top: 0.3em"><iman:string key="HomePage.UnrestrictedAccessHelp" /></div>
	      <div class="mediumtext" style="margin-top: 0.8em; margin-left: 0.4em"><iman:string key="HomePage.AssignedAccessWithAccess" /></div>
	      <div class="formdescriptext" style="width: 450px; margin-top: 0.3em"><iman:string key="HomePage.AssignedAccessHelp" /></div>
	      <div class="mediumtext" style="margin-top: 0.8em; margin-left: 0.4em"><iman:string key="HomePage.CollectionOwnerAccessWithAccess" /></div>
	      <div class="formdescriptext" style="width: 450px; margin-top: 0.3em"><iman:string key="HomePage.CollectionOwnerAccessHelp" /></div>
	      <br />
End Old Access mode definitions -->


<!-- Begin New Access mode definitions -->
		<table width="90%" border="0" cellspacing="0" cellpadding="10">
			<tr class="tablesubhead1">
				<td valign="top" width="50%"><iman:string key="HomePage.WebAdministration" /></td>
				<td valign="top"><iman:string key="HomePage.AccessModes" /></td>
			</tr>
			<tr>

				<td class="formdescriptextml0" valign="top" width="50%"><iman:string key="HomePage.WebAdminText" /></td>
				<td valign="top">
					<div style="margin-bottom: 0.5em">
						<b><iman:string key="HomePage.UnrestrictedAccessWithAccess" /></b></div>
					<div class="formdescriptextml0">
						<iman:string key="HomePage.UnrestrictedAccessHelp" /></div>
					<div style="margin-top: 1em; margin-bottom: 0.5em">

						<b><iman:string key="HomePage.AssignedAccessWithAccess" /></b></div>
					<div class="formdescriptextml0">
						<iman:string key="HomePage.AssignedAccessHelp" /></div>
					<div style="margin-top: 1em; margin-bottom: 0.5em">
						<b><iman:string key="HomePage.CollectionOwnerAccessWithAccess" /></b></div>
					<div class="formdescriptextml0">
						<iman:string key="HomePage.CollectionOwnerAccessHelp" /></div>
<!-- 
					<div style="margin-top: 1em; margin-bottom: 0.5em">
						<b>Tree Down Access</b></div>
					<div class="formdescriptextml0">
						This troubleshooting mode is used to correct eDirectory availability problems on your network. Tomcat must be stopped and restarted to access this mode. See the iManager 2.0 Administration Guide for additional information.</div>
 -->
				</td>
			</tr>
		</table>
		<p></p>
<!-- End New Access mode definitions -->
		<c:if test="${sessionScope.DeviceType == 'browser'}">
	      <div class="mediumtext" style="width: 450px;" align=right><a href="#" onClick="javascript:getElementById('modeDetails').style.display='none'"><iman:string key="HomePage.CloseLink" /></a></div>
	   </c:if>

	   </div>
	</div>
</BODY>
</HTML>
