<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.Vector"%>
<%@ page import="java.util.Enumeration"%>
<%@ page import="com.fenalco.entities.Country"%>
<%@ page import="com.fenalco.entities.Province"%>
<%@ page import="com.fenalco.entities.City"%>
<%@ page import="com.fenalco.entities.Position"%>


<html>
<head>
<link rel='stylesheet' style='text/css' href='css/tablas.css'>
<title>Registro inicial</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style type="text/css">
<!--
body {
	background-image: url(images/sysmanager/fondo1.gif);
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: bold;
}
-->
</style>
<link href="css/fuentes.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #000000;
}
a:visited {
	text-decoration: none;
	color: #333300;
}
a:hover {
	text-decoration: none;
	color: #000000;
}
a:active {
	text-decoration: none;
	color: #000000;
}
body,td,th {
	color: #000000;
}
.style2 {font-size: 12px}
.style3 {font-size: 12}
.style4 {font-size: 10px}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style6 {font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style8 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 20px;
	font-weight: bold;
}
.Estilo2 {
	color: #FF0000;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.Estilo6 {font-size: 9px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
-->
</style>
<!-- 
	Esta página permite el registro inicial de una empresa en el sistema, aquí se solicitan los datos
	básicos de la empresa así como la información para el registro de un usuario principal.
	
	Para construir la función de validación de formularios se deben utilizar las funciones incluidas 
	en la libreria de funciones bajo el nombre libreriaJS.js del directorio js.
	
	Hay que verificar el atributo message que viene en el request, si existe hay que pintarlo pues
	contiene los mensajes de error
	
	Esta página recibe los parámetros del servlet cargarRegistro: 
	sectorList(sectores)
	companyTypes(tipos de empresa)
	countriesList(paises)
	citiesList(ciudades)
	provincesList(departamentos)
	neighbourhoodsList(barrios)
	zonesList(zonas )
	ciiuList(ciiu)
-->

<script type='text/javascript' language='javascript' src='js/md5.js'></script>
<script type='text/javascript' language='javascript' src='js/library.js'></script>
<script>
	
    function showMessage(message){
        if(message!=null && message!="" && message!="null"){
            window.alert(message);
        }
        return true;
    }
    function submitCombo(comboName){
            document.companyRegistry.combo.value=comboName;
            document.companyRegistry.action = "cargarregistro";
            document.companyRegistry.submit();
            return true;
    }


    function validateForm(formName){

            var message = "Han ocurrido los siguientes errores:\n";
            var flag = true;

/*            if(isEmpty(formName.socialName)){
                            message = message + "- El campo de razón social está vacío.\n";
                            flag = false;
            }*/
            if(isEmpty(formName.commercialName)){
                            message = message + "- El campo de nombre comercial está vacío.\n";
                            flag = false;
            }
            
            /*if(isEmpty(formName.description)){
                            message = message + "- El campo de descripción está vacío.\n";
                            flag = false;
            }*/
            
            if(isEmpty(formName.companyId)){
                            message = message + "- El campo de NIT está vacío.\n";
                            flag = false;
            }
            else{
                if(!isNumber(formName.companyId)){
                     message = message + "- El campo de NIT no es de tipo numérico.\n";
                     flag = false;
                }
            }
            
            if(isEmpty(formName.address)){
                            message = message + "- El campo de dirección está vacío.\n";
                            flag = false;
            }
            if(!isEmpty(formName.fax)){
                
                if(!isNumber(formName.fax)){
                     message = message + "- El campo fax no es de tipo numérico.\n";
                     flag = false;
                }
                
            }
            if(isEmpty(formName.phoneNumber1)){
                            message = message + "- El campo de telefono 1 está vacío.\n";
                            flag = false;
            }
            else{
                if(!isNumber(formName.phoneNumber1)){
                     message = message + "- El campo de telefono 1 no es de tipo numérico.\n";
                     flag = false;
                }
            }
            
            if(!isEmpty(formName.phoneNumber2)){
                if(!isNumber(formName.phoneNumber2)){
                     message = message + "- El campo de telefono 2 no es de tipo numérico.\n";
                     flag = false;
                }
            }
            if(isEmpty(formName.contact1)){
                            message = message + "- El campo de contacto 1 está vacío.\n";
                            flag = false;
            }
            if(isEmpty(formName.email)){
                            message = message + "- El campo de email está vacío.\n";
                            flag = false;
            }
            else{
                if(!validEmail(formName.email.value)){
                        message = message + "- La dirección de email no es válida.\n";
                        flag = false;
                }
           }
           /*if(isEmpty(formName.fenalcoNumber)){
                            message = message + "- El campo número de afiliación fenalco está vacío.\n";
                            flag = false;
           }*/
           
           if(formName.type.value==2){
           
                   if(isEmpty(formName.GLN)){
                        message = message + "- El campo GLN está vacío.\n";
                        flag = false;
                    }
                    else{
                        if(!isAllNumber(formName.GLN)){
                            message = message + "- El campo GLN debe ser numérico.\n";
                            flag = false;
                        }
                    }
           }
           
           if(isEmpty(formName.login)){
                            message = message + "- El campo login está vacío.\n";
                            flag = false;
           }
           if(isEmpty(formName.passwd)){
                            message = message + "- El campo contraseña  está vacío.\n";
                            flag = false;
           }
		   else{
		   		var size = formName.passwd.value+"";
				if(size.length < 6 ){
				            message = message + "- La contraseña debe tener  una longitud mayor o igual a 6 caracteres.\n";
                            flag = false;
				}
		   }
          
           
           if(isEmpty(formName.passwd2)){
                            message = message + "- El campo confirmación de contraseña  está vacío.\n";
                            flag = false;
           }
		   
		   if(formName.passwd.value  != formName.passwd2.value){
						   message = message + "- La confirmación de contraseña  debe ser igual a la contraseña.\n";
                            flag = false;	
		   }
		   
           if(isEmpty(formName.firstName)){
                            message = message + "- El campo nombre está vacío.\n";
                            flag = false;
           }
           if(isEmpty(formName.lastName)){
                            message = message + "- El campo apellido está vacío.\n";
                            flag = false;
           }
           
           if(isEmpty(formName.idNumber)){
                            message = message + "- El campo cédula está vacío.\n";
                            flag = false;
           }
           else{
                if(!isNumber(formName.idNumber)){
                     message = message + "- El campo cédula no es de tipo numérico.\n";
                     flag = false;
                }
            }
            if(isEmpty(formName.position)){
                            message = message + "- El campo cargo está vacío.\n";
                            flag = false;
           }
           if(isEmpty(formName.userEmail)){
                            message = message + "- El campo  email de usuario está vacío.\n";
                            flag = false;
            }
            else{
                if(!validEmail(formName.userEmail.value)){
                        message = message + "- La dirección de email del usuario no es válida.\n";
                        flag = false;
                }
           }

            if(!flag){
                    window.alert(message);
            }
            else{
                formName.passwd.value = hex_md5(formName.passwd.value);
                formName.passwd2.value = hex_md5(formName.passwd2.value);
                sendAndBlockForm("wait","Su solictud de registro est&aacute; siendo enviada, por favor espere un momento...","enviar")
                
            }
            return flag;
    }

	

    function showSpecialFields(companyType){
            if(companyType.value==2){
               
          
            }
            else{
                  
             
               
            }
            return true;
    }		
</script>
<body onload='showMessage("<%=request.getAttribute("message")%>")'>
<table width="776" height="180" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="4"><img src="images/sysmanager/cabezote1.jpg" width="580" height="99"></td>
    <td width="196" rowspan="3" valign="top"><img src="images/sysmanager/cabezote2.jpg" width="196" height="180"></td>
  </tr>
  <tr>
    <td width="300"><img src="images/sysmanager/barra1.jpg" width="300" height="28"></td>
    <td width="73">&nbsp;</td>
    <td width="113">&nbsp;</td>
    <td width="94">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4" height="53">&nbsp;</td>
  </tr>
</table>

<table align="left" cellpadding="0" cellspacing="0" width="760">
<tr align="center">
	<td align="center">
        <%
             String tittle = "REGISTRO INICIAL";
        %>
        <%@ include file="titulo.jsp" %>
	</td>
</tr>
<tr align="center">
	<td align="center">
		<!-- datos de la empresa -->
			<form name="companyRegistry" method="post" action="/registrarusuario" onSubmit='return validateForm(document.companyRegistry);'>
			<input type="hidden" name="combo">
			
                         
			 <table width="200" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FCF8D1">
                                  <tr valign="top"> 
                                    <td colspan="4"><img src="images/sysmanager/barra1form.gif" width="477" height="19"></td>
                                  </tr>
				
					<% 
						
                                                String showDesc  = ( String )request.getAttribute("showDesc"); 
						if(showDesc == null){
							showDesc = "false";
						}
						String showGLN  = ( String )request.getAttribute("showGLN"); 
						if(showGLN == null){
							showGLN = "false";
						}
						
					%>
					
		                 <tr> 
                                    <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
                                   <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Tipo de Empresa</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
                                  <td width="285" height="25" bgcolor="#FBF5C1"><select name="type" onChange="submitCombo(this.name);" >
					  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
					  <%
											Hashtable companyTypes = (Hashtable)request.getAttribute("companyTypes");
											Enumeration en = companyTypes.keys();
											String selected = "";
											Integer temp = (Integer) request.getAttribute("typeId");
											for(int i = 0 ; i < companyTypes.size() ; i++){
												Object key = en.nextElement();
												Integer temp2 = (Integer) key;
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}
											%>
					  <option value="<%=key%>" <%=selected%>><%=companyTypes.get(key)%> </option>
					  <%
											}
											%>
					</select></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6">Razón Social</span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="socialName" maxlength="30" value="<%=request.getAttribute("socialName")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Nombre Comercial</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="commercialName" maxlength="30" size="30" value="<%=request.getAttribute("commercialName")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				</tr>
				
				<% if(showDesc.equals("true")){%>
				<tr>
				  <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
                                  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6">Descripci&oacute;n</span></td>
                                  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="description" maxlength="20"  value="<%=request.getAttribute("description")%>"></td>
				</tr>
                                    <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				<%
				}
				else{
				%>
				<input type="hidden" name="description" maxlength="20"  value="">
				<%
				}
				%>
				
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">NIT</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="companyId" maxlength="20" value="<%=request.getAttribute("companyId")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio, Campo Numérico-->
				</tr>
				<tr>
                                  <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				 <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Sector Económico</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><select name="sector">
					  <%
											Hashtable sectorList = (Hashtable)request.getAttribute("sectorList");
											en = sectorList.keys();
											selected = "";
											temp = (Integer) request.getAttribute("sectorId");
											for(int i = 0 ; i < sectorList.size() ; i++){
												Object key = en.nextElement();
												Integer temp2 = (Integer) key;
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}
											%>
					  <option value="<%=key%>" <%=selected%>><%=sectorList.get(key)%> </option>
					  <%
											}
											%>
					</select></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				</tr>
				<tr>
                                  <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				 <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Dirección</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="address" maxlength="50" value="<%=request.getAttribute("address")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				</tr>
				<tr> 
				  <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Teléfono 1</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="phoneNumber1" maxlength="15" value="<%=request.getAttribute("phoneNumber1")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio, Numérico-->
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6">Teléfono 2</span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="phoneNumber2" maxlength="15" value="<%=request.getAttribute("phoneNumber2")%>"></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				 <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Contacto 1 </font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="contact1" maxlength="30" value="<%=request.getAttribute("contact1")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6">Contacto 2</span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="contact2" maxlength="30" value="<%=request.getAttribute("contact2")%>"></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6">Fax</span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="fax" maxlength="7" value="<%=request.getAttribute("fax")%>"></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Email</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="email" maxlength="60" value="<%=request.getAttribute("email")%>"></td>
				  <!-- JS: Verificación de campo vacío, Campo Obligatorio, Correo Electrónico-->
				</tr>
				<!--
				<tr> 
				  <td><strong>Numero Afiliación Fenalco</strong></td>
				  <td><input type="text" name="fenalcoNumber" maxlength="15" value="<%=request.getAttribute("fenalcoNumber")%>"></td>
				 
				</tr>
				-->
				
				<!--
				<tr> 
				  <td><strong>Código Ciiu</strong></td>
				  <td><select name="ciiu">
					  <%
											Hashtable ciiuList = (Hashtable)request.getAttribute("ciiuList");
											en = ciiuList.keys();
											selected = "";
											temp = (Integer) request.getAttribute("ciiuId");
											
											for(int i = 0 ; i < ciiuList.size() ; i++){
												Object key = en.nextElement();
												Integer temp2 = (Integer) key;
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}
											%>
					  <option value="<%=key%>" <%=selected%>><%=ciiuList.get(key)%> </option>
					  <%
											}
											%>
					</select></td>
				</tr>
				-->
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">País</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><select name="country" onChange="submitCombo(this.name)">
					  <%
											Vector countriesList = (Vector)request.getAttribute("countriesList");
											en = countriesList.elements();
											selected = "";
											temp = (Integer) request.getAttribute("countryId");
											for(int i = 0 ; i < countriesList.size() ; i++){
												Country country = (Country)en.nextElement();
												Integer temp2 = new Integer(country.getId());
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}   
												
												
											%>
					  <option value="<%=country.getId()%>" <%=selected%>><%=country.getName()%> 
					  </option>
					  <%
											}
											%>
					</select></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Departamento</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				  <td width="285" height="25" bgcolor="#FBF5C1"><select name="province" onChange="submitCombo(this.name)">
					  <%
											Vector provincesList = (Vector)request.getAttribute("provincesList");
											en = provincesList.elements();
											selected = "";
											temp = (Integer) request.getAttribute("provinceId");
											for(int i = 0 ; i < provincesList.size() ; i++){
											   Province province = (Province)en.nextElement();
												Integer temp2 = new Integer( province.getId() );
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}   
											%>
					  <option value="<%=province.getId()%>" <%=selected%>><%=province.getName()%> 
					  </option>
					  <%
											}
											%>
					</select></td>
				</tr>
				<tr> 
				 <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Ciudad</font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
				 <td width="285" height="25" bgcolor="#FBF5C1"><select name="city" onChange="submitCombo(this.name)">
					  <%
											Vector citiesList = (Vector)request.getAttribute("citiesList");
											en = citiesList.elements();
											selected = "";
											temp = (Integer) request.getAttribute("cityId");
											for(int i = 0 ; i < citiesList.size() ; i++){
												City city = (City)en.nextElement();
												Integer temp2 = new Integer( city.getId() );
												
												if(temp.intValue() == temp2.intValue()){
													selected = "selected";
												}
												else{
													selected = "";
												}   
											%>
					  <option value="<%=city.getId()%>" <%=selected%>><%=city.getName()%> 
					  </option>
					  <%
											}
											%>
					</select></td>
				</tr>
				
		
				<% if(showGLN.equals("true")){%>
                                <tr> 
				   <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
				  <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">GLN </font></span></td>
				  <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
                		  <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="GLN" maxlength="20"  value="<%=request.getAttribute("GLN")%>"></td>
                               </tr>				  
                                <!-- JS: Verificación de campo vacío, Campo Obligatorio-->
				
				<%
				}
				else{
				%>
				<input type="hidden" name="GLN" maxlength="20"  value="">
				<%
				}
				%>
				
				 <tr bgcolor="FBF3B2"> 
                                <td height="15" bgcolor="#FBF3B2">&nbsp;</td>
                                <td height="15" colspan="3" bgcolor="#FBF3B2"><span class="Estilo2">Los 
                                  campos con color son obligatorios </span></td>
                              </tr>
                          <tr valign="bottom"> 
                            <td colspan="4"><img src="images/sysmanager/barra2form.gif" width="477" height="17"></td>
                          </tr>
                          
			</table>
	</td>
	</tr>

		<!-- datos de la empresa -->

<tr align="center">
	<td align="center">
		<%
           tittle = "Datos del usuario";
        %>
        <%@ include file="/titulo.jsp" %>
	</td>
</tr>
<tr>
    <td>
        <center><div id="wait" ></div></center>
    </td>
</tr>
<tr align="left">
	  <td align="left"> 
        <!-- datos del usuario -->
        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FCF8D1">
          <tr valign="top"> 
            <td colspan="4"><img src="images/sysmanager/barra1form.gif" width="477" height="19"></td>
          </tr>
		  <tr bgcolor="FBF3B2"> 
            <td height="15" bgcolor="#FBF3B2">&nbsp;</td>
            <td height="15" colspan="3" bgcolor="#FBF3B2"><span class="Estilo2">Los 
              campos con color son obligatorios </span></td>
          </tr>
          <tr> 
            <td width="20" height="25" bgcolor="#F9ED8C">&nbsp;</td>
            <td width="152" height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Usuario</font></span></td>
            <td width="20" height="25" bgcolor="#FBF5C1">&nbsp;</td>
            <td width="285" height="25" bgcolor="#FBF5C1"><input type="text" name="login" maxlength="12" value="<%=request.getAttribute("login")%>"></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#FAF09F">&nbsp;</td>
            <td height="25" bgcolor="#FAF09F"><span class="Estilo6"><font color="#FF0000">Contrase&ntilde;a</font></span></td>
            <td height="25">&nbsp;</td>
            <td height="25"><input type="password" name="passwd" maxlength="12" value=""></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#F9ED8C">&nbsp;</td>
            <td height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Confirme 
              su contrase&ntilde;a</font> </span></td>
            <td height="25" bgcolor="#FBF5C1">&nbsp;</td>
            <td height="25" bgcolor="#FBF5C1"><input type="password" name="passwd2" maxlength="12" value=""></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#FAF09F">&nbsp;</td>
            <td height="25" bgcolor="#FAF09F"><span class="Estilo6"><font color="#FF0000">Nombre</font></span></td>
            <td height="25">&nbsp;</td>
            <td height="25"><input type="text" name="firstName" maxlength="20" value="<%=request.getAttribute("firstName")%>"></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#F9ED8C">&nbsp;</td>
            <td height="25" bgcolor="#F9ED8C"><span class="Estilo6"><font color="#FF0000">Apellido</font></span></td>
            <td height="25" bgcolor="#FBF5C1">&nbsp;</td>
            <td height="25" bgcolor="#FBF5C1"><input type="text" name="lastName" maxlength="20" value="<%=request.getAttribute("lastName")%>"></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#FAF09F">&nbsp;</td>
            <td height="25" bgcolor="#FAF09F"><span class="Estilo6"><font color="#FF0000">C&eacute;dula</font></span></td>
            <td height="25">&nbsp;</td>
            <td height="25"><input type="text" name="idNumber" maxlength="15" value="<%=request.getAttribute("idNumber")%>"></td>
          </tr>
          <tr> 
            <td height="25" bgcolor="#F9ED8C">&nbsp;</td>
            <td height="25" bgcolor="#F9ED8C"><span class="Estilo6">Cargo</span></td>
            <td height="25" bgcolor="#FBF5C1">&nbsp;</td>
            <td height="25" bgcolor="#FBF5C1">
			<select name="position">
                <%
									Vector positionList = (Vector)request.getAttribute("positionList");
									en = positionList.elements();
									selected = "";
									temp =  (Integer) request.getAttribute("position") ;
									for(int i = 0 ; i < positionList.size() ; i++){
									   Position position = (Position)en.nextElement();
										Integer temp2 = new Integer( position.getId() );
			
										if(temp.intValue() == temp2.intValue()){
											selected = "selected";
										}
										else{
											selected = "";
										}   
									%>
                <option value="<%=position.getId()%>" <%=selected%>><%=position.getName()%> 
                </option>
                <%
									}
									%>
              </select>
			</td>
          </tr>
		  <tr> 
            <td height="25" bgcolor="#FAF09F">&nbsp;</td>
            <td height="25" bgcolor="#FAF09F"><span class="Estilo6"><font color="#FF0000">Correo 
              electr&oacute;nico personal</font> </span></td>
            <td height="25">&nbsp;</td>
            <td height="25"><input type="text" name="userEmail" maxlength="60" value="<%=request.getAttribute("userEmail")%>"></td>
          </tr>
          
          <tr> 
            <td height="0" bgcolor="#F9ED8C">&nbsp;</td>
            <td height="40" bgcolor="#F9ED8C"><input type="submit" id="enviar" name="enviar" value="Registrar"  onClick='return validateForm();'></td>
            <td height="0" bgcolor="#FBF5C1">&nbsp;</td>
            <td height="0" bgcolor="#FBF5C1">
			<span class="Estilo6"><a href="/index.jsp"> 
              Regresar a la p&aacute;gina de inicio.......</a></span>
			</td>
          </tr>
          <tr valign="bottom"> 
            <td colspan="4"><img src="images/sysmanager/barra2form.gif" width="477" height="17"></td>
          </tr>
        </table>
        <p>&nbsp;</p></form>

		<!-- datos del usuario -->
	</td>
</tr>
<tr>
	<td height="60">
		<table width="545" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr> 
				  <td colspan="9" height="17"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#666666">Copyright 
					  © 2004 FEDERACION NACIONAL DE COMERCIANTES </font></div></td>
				</tr>
				<tr> 
				  <td colspan="9"> <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#999999">Prohibida 
					  su reproducción total o parcial, así como su traducción sin<br>
					  autorización escrita. ® Reservados todos los derechos.</font></div></td>
				</tr>
			  </table>
	</td>
</tr>

</table>



</body>
</html>
// “Copyright (C) <2008> Multilateral Investment Fund of the Inter-American Development Bank.
// Este archivo es parte de <ICT4BUS-PVL>
// < ICT4BUS-PVL > es software libre: usted puede redistribuirlo y/o modificarlo bajo los términos de la Licencia Pública General GNU publicada por la Fundación para el Software Libre, ya sea la versión 3 de la Licencia, o (a su elección) cualquier versión posterior.
// < ICT4BUS-PVL > se distribuye con la esperanza de que sea útil, pero SIN GARANTÍA ALGUNA; ni siquiera la garantía implícita MERCANTIL o de APTITUD PARA UN PROPÓSITO DETERMINADO. 
// Consulte los detalles de la Licencia Pública General GNU para obtener una información más detallada. 
// Debería haber recibido una copia de la Licencia Pública General GNU junto a este programa. En caso contrario, consulte http://www.gnu.org/licenses/.”