<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<%@ page import="org.deegree.i18n.Messages" %>
<%@ page import="java.util.Locale" %>
<%
Locale loc = request.getLocale();
%>
<div id="dialogContent" class="dialogContent" style="color: #1D68C6; font-family: Arial, sans-serif; font-size: 10pt; width: 450px;">
    <div id="dialogHeader">
        <a id="dialogTitle"></a>
        <img src="./images/page_close.gif" border="0" style="position:absolute; top:3px; left:430px; z-index:100" onclick="closeDialog(); fromTemplate = true;">
    </div>
    <div class="metadataSelectRoot">
        <b><%=Messages.get( loc, "CATMANAGE_AVAILABLE_TEMPLATES" ) %></b><br></br>
        <select id="templateList" class="metadataSelectSelectElement" onchange="selectMetadataSet( this )" size="18">
    <%
            List<String[]> titles = (List<String[]>)request.getAttribute(  "TEMPLATES" );
            Iterator<String[]> iter = titles.iterator();
            while ( iter.hasNext() ) {
                String[] value = iter.next();
                out.print( "<option value='" );
                out.print( value[0].trim() );
                out.print( "' " );
                if ( value[2] != null ) { 
	                out.print( " title='" );
	                out.print( value[2].trim() );
	                out.print( "' " );
                }
                out.print( ">" );
                out.print( value[1] + "</option>" );
            }
    %>        
        </select>
    </div>
    <div class="metadataSelectDescOutter">
        <b><%=Messages.get( loc, "CATMANAGE_TEMPLATE_DESCRIPTION" ) %></b><br></br>
        <div class="metadataSelectDescInner">
            <a id="DESC" class="metadataSelectDescContent"></a>
        </div>
    </div>
    <div class="metadataSelectButtonArea">
        <a href="#" onclick="loadTemplate()" class="button" ><%=Messages.get( loc, "CATMANAGE_TEMPLATE_TAKE" ) %></a>&nbsp;
        <a href="#" onclick="closeDialog(); fromTemplate = true;" class="button" ><%=Messages.get( loc, "CATMANAGE_TEMPLATE_CANCEL" ) %></a>
    </div>
</div>