<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" 
	import="java.util.Locale, com.novell.emframe.fw.FwUtils, com.novell.webaccess.common.JSPConduit2"%>
<%@ taglib uri="/WEB-INF/iman.tld" prefix="iman" %>
<% JSPConduit2 c = JSPConduit2.getJSPConduit(request); %>

   <iman:stringtable bundle="FwResources"/> 

<HTML>
<HEAD><TITLE><iman:string key="SelectLanguage.Title"/>></TITLE>
   <iman:stylesheet/> 
   <iman:eMFrameScripts/>
</HEAD>

<BODY TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" bgcolor="#FFFFFF">
<FORM name="SelectLanguage" method="post" action="webacc">
   <input type=hidden name="NPService" value="<%= c.var("taskId") %>">
   <input type=hidden name="moduleaction" value="SelectLanguageAction">
   <!-- End of hidden tags -->

    <iman:taskHeader titleKey="SelectLanguage.Title" 
                     iconUrl="dir/bullet_default_16.gif" helpFile="fw/prefs_language.html"/><BR>
                     
	 <div class="instructions"><iman:string key="SelectLanguage.Body"/><br><br>
	 </div>

    
<%  Locale userLocale = (Locale)request.getAttribute("UserLocale");
	 String[] saAvailableLangs = (String[])request.getAttribute("AvailableLanguages");
	 if (saAvailableLangs != null)
	 { %><div class="margintop3"><label><iman:string key="SelectLanguage.DisplayLanguageLabel"/></label>
	    <select name="AvailableLanguages">
<%		 for (int i = 0; i < saAvailableLangs.length; i++)
       {
   			String lang = userLocale.getLanguage();
   			String langCountry = lang + "_" + userLocale.getCountry();

   			if ((lang.equalsIgnoreCase(saAvailableLangs[i])) || (langCountry.equalsIgnoreCase(saAvailableLangs[i])))
  				{  %>
      			<option selected="true" value=<%= saAvailableLangs[i] %> ><%= FwUtils.getLocalLanguageSring(userLocale, saAvailableLangs[i]) %></option>
<% 	     } else  {  %>
      			<option value=<%= saAvailableLangs[i] %> ><%= FwUtils.getLocalLanguageSring(userLocale, saAvailableLangs[i]) %></option>
<%		    }
       } %>
       </select>
       </div>
<%	 } %>
 	 <div class="marginleft1 margintop1"><input type="checkbox" name="langCookie" id="langCookie"/><label for="langCookie"><iman:string key="SelectLanguage.SetCookieLabel"/></label></div>
	<br>
	<br> 	
	 
    <iman:bar/>
      
    <iman:button key="OK" onClick="document.SelectLanguage.submit()"/>
    <iman:cancelBtn/>
    </FORM>
    
</BODY></HTML>