Index: /trunk/workflow/js/scriptaculous/lightbox.js
===================================================================
--- /trunk/workflow/js/scriptaculous/lightbox.js	(revision 795)
+++ /trunk/workflow/js/scriptaculous/lightbox.js	(revision 7372)
@@ -133,5 +133,14 @@
 		info = "<div id='lbContent'></div>";
 		new Insertion.Before($('lbLoadMessage'), info);
-		this.content();
+
+		if (typeof(this.content) == "function") 
+		{
+			this.content();
+		}
+		else
+		{
+			this.content;
+		}
+
 		$('lightbox').className = "done";
 		//this.actions();
@@ -182,5 +191,7 @@
 	if (!$('overlay'))
 		addLightboxMarkup();
+	
 	lbox = document.getElementsByClassName('lbOn');
+
 	for(i = 0; i < lbox.length; i++) {
 		valid = new lightbox(lbox[i]);
@@ -194,11 +205,12 @@
 	bod 				= document.getElementsByTagName('body')[0];
 	overlay 			= document.createElement('div');
-	overlay.id		= 'overlay';
+	overlay.id			= 'overlay';
 	lb					= document.createElement('div');
 	lb.id				= 'lightbox';
-	lb.className 	= 'loading';
-	lb.innerHTML	= '<div id="lbLoadMessage">' +
+	lb.className 		= 'loading';
+	lb.innerHTML		= '<div id="lbLoadMessage">' +
 						  '<p>Loading</p>' +
 						  '</div>';
+
 	bod.appendChild(overlay);
 	bod.appendChild(lb);
Index: /trunk/workflow/js/orgchart/organization.js
===================================================================
--- /trunk/workflow/js/orgchart/organization.js	(revision 7013)
+++ /trunk/workflow/js/orgchart/organization.js	(revision 7372)
@@ -242,5 +242,7 @@
 		if (!name)
 			name = this.combo['id'];
+		
 		combo = this.combo;
+
 		var comboResult = function(data)
 		{
@@ -251,13 +253,21 @@
 			if (includeNull)
 				newFormat['NULL'] = "Nenhum";
+
 			for (var i = 0; i < data.length; i++)
 				newFormat[data[i][combo['id']]] = data[i][combo['name']];
+
 			if ((newFormat.length > 0) || includeNull)
+			{
 				displayArea.innerHTML = constructSelectBox(name, newFormat);
+			}
 			else
+			{
 				displayArea.innerHTML = '<i>nenhum registro encontado</i><input type="hidden" id="' + name + '" value=""/>';
+			}
+
 			if (callback)
 				callback();
 		};
+
 		this.list(comboResult, params);
 	},
@@ -400,23 +410,40 @@
 function createOrganizationMenu(organizationID, div)
 {
-	var content = '<ul class="horizontalMenu">';
-	content += '<li style="margin: 5px 5px 0 5px">Atualizar : <select>'
-	content += '<option></option>'
-	content += '<option onclick="loadAddEmployeeStatusUI(' + organizationID  + ');" class="lbOn">Status de Funcionário</option>'
-	content += '<option onclick="loadAddEmployeeCategoryUI(' + organizationID  + ');" class="lbOn">Categorias</option>'
-	content += '<option onclick="loadAddJobTitleUI(' + organizationID  + ');" class="lbOn">Cargos</option>'
-	content += '<option onclick="loadAddAreaStatusUI(' + organizationID  + ');" class="lbOn">Status de Área</option>'
-	content += '<option onclick="loadAddCostCenterUI(' + organizationID  + ');" class="lbOn">Centros de Custo</option>'
-	content += '<option onclick="loadAddLocalUI(' + organizationID  + ');" class="lbOn">Localidade</option>'
-	content += '<option onclick="loadAddAreaUI(' + organizationID  + ');" class="lbOn">Áreas</option>'
-	content += '<option onclick="loadAddEmployeeUI(' + organizationID  + ');" class="lbOn">Funcionários</option>'
-	content += '<option onclick="loadAddTelephoneUI(' + organizationID  + ');" class="lbOn">Telefones</option>'
-	content += '<option onclick="loadAddSubstitutionUI(' + organizationID  + ');" class="lbOn">Substituições</option>'
-	content += '</select></li>';
-	content += '<li><a><input type="text" name="search_term" id="search_term" onkeypress="if (((window.Event) ? event.which : event.keyCode) == 13) $(\'search_span_' + organizationID  + '\').onclick(); return true;" /> <span id="search_span_' + organizationID + '" onclick="tmp = $$(\'div#orgchartAreas_' + organizationID + ' a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); searchEmployee(' + organizationID + ', $(\'orgchartEmployees_' + organizationID + '\')); return false;">busca</span></a></li>';
-	content += '</ul>';
-	content += '<br/>';
-	content += '<br/>';
+	var content  = '<ul class="horizontalMenu">';
+		content += '<li style="margin: 5px 5px 0 5px">Atualizar : <select name="atualizar" id="ddlAtualizar" onchange="loadAdds(this.value, ' + organizationID + ');">';
+		content += '<option></option>';
+		content += '<option value="loadAddEmployeeStatusUI">Status de Funcionário</option>';
+		content += '<option value="loadAddEmployeeCategoryUI">Categorias</option>';
+		content += '<option value="loadAddJobTitleUI" class="lbOn">Cargos</option>';
+		content += '<option value="loadAddAreaStatusUI" class="lbOn">Status de Área</option>';
+		content += '<option value="loadAddCostCenterUI" class="lbOn">Centros de Custo</option>';
+		content += '<option value="loadAddLocalUI" class="lbOn">Localidade</option>';
+		content += '<option value="loadAddAreaUI" class="lbOn">Áreas</option>';
+		content += '<option value="loadAddEmployeeUI" class="lbOn">Funcionários</option>';
+		content += '<option value="loadAddTelephoneUI" class="lbOn">Telefones</option>';
+		content += '<option value="loadAddSubstitutionUI" class="lbOn">Substituições</option>';
+		content += '</select></li>';
+		content += '<li><a><input type="text" name="search_term" id="search_term" onkeypress="if (((window.Event) ? event.which : event.keyCode) == 13) $(\'search_span_' + organizationID  + '\').onclick(); return true;" /> <span id="search_span_' + organizationID + '" onclick="tmp = $$(\'div#orgchartAreas_' + organizationID + ' a.destaque\'); if (tmp[0]) tmp[0].removeClassName(\'destaque\'); searchEmployee(' + organizationID + ', $(\'orgchartEmployees_' + organizationID + '\')); return false;">busca</span></a></li>';
+		content += '</ul>';
+		content += '<br/>';
+		content += '<br/>';
+
 	div.innerHTML = content;
+}
+
+function loadAdds(eventName, organizationID)
+{
+	window.settings = { functionName: eventName };
+
+	var b = document.createElement('button');
+	    b.className = 'lbOn';
+
+	if (!$('overlay'))
+		addLightboxMarkup();
+        
+	var valid = new lightbox(b);
+		valid.activate();
+
+	window[settings.functionName](organizationID);
 }
 
@@ -574,5 +601,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('descricao').focus();
+	//$('descricao').focus();
 	objEmployeeStatus.generateUpdateTable({'organizacao_id': organizationID}, divLB);
 }
@@ -593,5 +620,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('descricao').focus();
+	//$('descricao').focus();
 	objEmployeeCategory.generateUpdateTable({'organizacao_id': organizationID}, divLB);
 }
@@ -612,5 +639,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('descricao').focus();
+	//$('descricao').focus();
 	objJobTitle.generateUpdateTable({'organizacao_id': organizationID}, divLB);
 }
@@ -632,5 +659,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('descricao').focus();
+	//$('descricao').focus();
 	objAreaStatus.generateUpdateTable({'organizacao_id': organizationID}, divLB);
 }
@@ -653,5 +680,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('nm_centro_custo').focus();
+	//$('nm_centro_custo').focus();
 	objCostCenter.generateUpdateTable({'organizacao_id': organizationID}, divLB);
 }
@@ -687,5 +714,5 @@
 	var divLB = $('lbContent');
 	divLB.innerHTML = content;
-	$('descricao').focus();
+	//$('descricao').focus();
 	objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), true, null,
 		function()
@@ -708,6 +735,6 @@
 	content += '<a href="javascript:void(0)" onclick="openParticipants(\'funcionario_id\', \'uid=1&hidegroups=1\');" id="addEmployeeLink"><img border="0" width="16" height="16" src="workflow/templateFile.php?file=images/add_user.png" /></a>';
 	content += '</td></tr>';
+	content += '<tr><td><label for="funcionario_status_id">Status</label></td><td id="comboStatus"><i>carregando</i></td></tr>';
 	content += '<tr><td><label for="apelido">Apelido</label></td><td><input type="text" size="20" maxlength="20" name="apelido" id="apelido" value=""/></td></tr>';
-	content += '<tr><td><label for="funcionario_status_id">Status</label></td><td id="comboStatus"><i>carregando</i></td></tr>';
 	content += '<tr><td><label for="funcionario_categoria_id">Categoria</label></td><td id="comboFuncionarioCategoria"><i>carregando</i></td></tr>';
 	content += '<tr><td><label for="cargo_id">Cargo</label></td><td id="comboCargo"><i>carregando</i></td></tr>';
@@ -715,5 +742,4 @@
 	content += '<tr><td><label for="data_admissao">Data de admissão</label></td><td><input type="text" name="data_admissao" id="data_admissao" value="" size="15" onkeypress="return formatDateField(event, this);" /></td></tr>';
 	content += '<tr><td><label for="titulo">T&iacute;tulo</label></td><td><input type="text" size="30" name="titulo" id="titulo" value=""/></td></tr>';
-
 	content += '<tr><td><label for="nivel">Nível</label></td><td><input type="text" size="3" name="nivel" id="nivel"/></td></tr>';
 	content += '<tr><td><label for="area_id">Área</label></td><td id="comboArea"><i>carregando</i></td></tr>';
@@ -724,34 +750,34 @@
 	content += '<button id="inserir" onclick="objEmployee.add(); return false;">Inserir</button>';
 	content += '<button onclick="valid.deactivate(); return false;">Cancelar</button>';
-
+	
 	var divLB = $('lbContent');
-	divLB.innerHTML = content;
-
-	objEmployeeStatus.generateComboBox({'organizacao_id': organizationID}, $('comboStatus'), false, null,
-		function()
-		{
-			objEmployeeCategory.generateComboBox({'organizacao_id': organizationID}, $('comboFuncionarioCategoria'), true, null,
-				function()
-				{
-					objJobTitle.generateComboBox({'organizacao_id': organizationID}, $('comboCargo'), true, null,
-						function()
-						{
-							objArea.generateComboBox({'organizacao_id': organizationID}, $('comboArea'), false, null,
-								function()
-								{
-									objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), true, null,
-										function()
-										{
-											objLocal.generateComboBox({'organizacao_id': organizationID}, $('comboLocalidade'), false, null, callback);
-										}
-									)
-								}
-							)
-						}
-					)
-				}
-			)
-		}
-	);
+    divLB.innerHTML = content;
+
+    objEmployeeStatus.generateComboBox({'organizacao_id': organizationID}, $('comboStatus'), false, null,
+        function()
+        {
+            objEmployeeCategory.generateComboBox({'organizacao_id': organizationID}, $('comboFuncionarioCategoria'), true, null,
+                function()
+                {
+                    objJobTitle.generateComboBox({'organizacao_id': organizationID}, $('comboCargo'), true, null,
+                        function()
+                        {
+                            objArea.generateComboBox({'organizacao_id': organizationID}, $('comboArea'), false, null,
+                                function()
+                                {
+                                    objCostCenter.generateComboBox({'organizacao_id': organizationID}, $('comboCentroCusto'), true, null,
+                                        function()
+                                        {
+                                            objLocal.generateComboBox({'organizacao_id': organizationID}, $('comboLocalidade'), false, null, callback);
+                                        }
+                                    )
+                                }
+                            )
+                        }
+                    )
+                }
+            )
+        }
+    );
 }
 
@@ -828,5 +854,5 @@
 	var divLB = $( 'lbContent' );
 	divLB.innerHTML = content;
-	$( 'descricao' ).focus( );
+	//$( 'descricao' ).focus( );
 	objTelephones.generateUpdateTable( { 'organizacao_id' : organizationID }, divLB );
 }
