function emQuickCatalogSearch ()
{
this.arrayWin = new Array();
this.el;
this.cc_contacts = new Array();
this.cc_groups = new Array();
}
$(document).ready(function(){
$('#combobox option').each(function(){
if($(this).val() == preferences.catalog_search){
$(this).attr('selected',true);
}
});
});
/* showlist */
emQuickCatalogSearch.prototype.showList = function(data, begin, end, ID, field)
{
data_ = data;
id_ = ID;
field_ = field;
begin_ = begin;
end_ = end;
keypress_read(data);
configure_slider(data);
create_list(data, true);
details_results(data);
id = '1';
_this = this;
var el_A = document.createElement("DIV");
el_A.style.visibility = "hidden";
el_A.style.position = "absolute";
el_A.style.left = "0px";
el_A.style.top = "0px";
el_A.style.width = "0px";
el_A.style.height = "0px";
el_A.id = 'window_QuickCatalogSearch_A';
document.body.appendChild(el_A);
el_A.innerHTML = "";
func_add_contact = function () {
};
_this.showWindow(el_A);
}
/* Leitura das teclas de atalho */
function keypress_read(data) {
$("#dialog-modal").unbind('keydown').keydown(function (e) {
var keyCode = e.keyCode;
arrow = {left: 37, up: 38, right: 39, down: 40, enter: 13, esc: 27, space: 32};
var slider = $( "#slider" );
switch (keyCode)
{
case arrow.enter:
if(!search_focus){
i = $(".ui-selected:last").attr("value") + 1;
if($("#actions_"+i).clone().find(".ui-button-text").text() == '+')
add_contact_field(document.getElementById("contact_"+i).innerHTML, document.getElementById("actions_"+i), "contact_"+i);
else{
remove_contact_field(document.getElementById("contact_"+i).innerHTML, document.getElementById("actions_"+i), "contact_"+i);
}
document.getElementById("busca").value = "";
//Evita que o campo "para" receba o enter
e.preventDefault();
$("#dialog-modal").dialog("close");
}
break;
case arrow.left:
if(!search_focus){
slider.slider("value", $( "#slider" ).slider( "value" ) - 1);
create_list(data_, false);
}
break;
case arrow.right:
if(!search_focus){
if((($( "#slider" ).slider( "value" ))) == Math.ceil(data_.length/6))
break;
slider.slider( "value", $( "#slider" ).slider( "value" ) + 1);
create_list(data_, false);
}
break;
case arrow.up:
if(!search_focus){
show_detail(data_, "up");
}
break;
case arrow.down:
if(!search_focus){
show_detail(data_, "down");
}
break;
case arrow.space:
if(!search_focus){
i = $(".ui-selected:last").attr("value") + 1;
if($("#actions_"+i).clone().find(".ui-button-text").text() == '+')
{
add_contact_field(document.getElementById("contact_"+i).innerHTML, document.getElementById("actions_"+i), "contact_"+i);
}else{
remove_contact_field(document.getElementById("contact_"+i).innerHTML, document.getElementById("actions_"+i), "contact_"+i);
}
document.getElementById("busca").value = "";
}
break;
}
});
}
/* Mostra os detalhes do contato selecionado */
function show_detail(data_, direction) {
id_contact = $(".ui-selected:last").attr("value");
if(direction == "down") {
if((id_contact == (((((parseInt($( "#slider" ).slider( "value" )) - 1)*6))+6)-1)) || id_contact == data_.length - 1 || data_.length == 1)
return;
var line_contact = $('li.ui-selected');
$('li.ui-selected').next().addClass("ui-selected");
id_contact++;
}
else {
if(id_contact == (($( "#slider" ).slider( "value" ) -1)*6))
return;
var line_contact = $('li.ui-selected');
$('li.ui-selected').prev().addClass("ui-selected");
id_contact--;
}
line_contact.removeClass("ui-selected").addClass("ui-selectee");
var details = $("#detalhes_contato").empty();
switch(data_['type_catalog']) {
case 'G':
var extra_fields = (data_['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0) {
details.append('
' + utf8_decoder(data_[id_contact].cn[0]) + " " + '' + data_[id_contact].mail[0] + '
');
if(data_[id_contact].telephonenumber[0] != null)
details.append('Telefone ' + '' + data_[id_contact].telephonenumber[0] + '
');
}
for (var i=0; i<=extra_fields.length-1; i++)
{
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data_[id_contact][valor.toLowerCase()] != undefined) {
var tmp_campo = '' + campo + " " ;
for(j=0; j' + data_[id_contact][valor.toLowerCase()][j] + "
");
tmp_campo = "";
}
}
}
break;
case 'P':
if(utf8_decoder(data_[id_contact].cn) == 'undefined')
details.append('' + utf8_decoder(data_[id_contact].title) + ' ' + '' + data_[id_contact].short_name + '
');
else
details.append('' + utf8_decoder(data_[id_contact].cn) + ' ' + '' + data_[id_contact].mail + '
');
if(data_[id_contact].telephonenumber != null)
details.append('Telefone ' + '' + data_[id_contact].telephonenumber + '
');
break;
default:
var extra_fields = (data_['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0 || data_[id_contact].type_contact == "P") {
if(utf8_decoder(data_[id_contact].cn) == 'undefined')
details.append('' + utf8_decoder(data_[id_contact].title) + ' ' + '' + data_[id_contact].short_name + '
');
else
details.append('' + utf8_decoder(data_[id_contact].cn) + ' ' + '' + data_[id_contact].mail + '
');
if(data_[id_contact].telephonenumber != null)
details.append('Telefone ' + '' + data_[id_contact].telephonenumber + '
');
}
if(data_[id_contact].mail[0] == 'undefined')
break;
if(data_[id_contact].mail[0].length > 1) {
for (var i=0; i<=extra_fields.length-1; i++) {
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data_[id_contact][valor.toLowerCase()] != undefined) {
var tmp_campo = '' + campo + " " ;
for(j=0; j' + data_[id_contact][valor.toLowerCase()][j] + "
");
tmp_campo = "";
}
}
}
}
break;
}
}
/*
* Método que cria a lista de contatos
*/
function create_list(data, begin, uiValue) {
var sliderValue = 1;
if(typeof($( "#slider" ).slider( "value" )) != "object")
sliderValue = $( "#slider" ).slider( "value" );
if(uiValue)
sliderValue = uiValue;
$("#detalhes_contato").empty();
var paginas = Math.ceil(data.length/6);
$("#title_usuarios").html( get_lang("Results") );
var selectable = $("#selectable");
selectable.empty();
var acento = data.search_for;
var Ul = document.createElement("ul");
var caracteresInvalidos = 'àèìòùâêîôûäëïöüáéíóúãõÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÁÉÍÓÚÃÕ';
var caracteresValidos = 'aeiouaeiouaeiouaeiouaoAEIOUAEIOUAEIOUAEIOUAO';
var i = new Number();
var j = new Number();
var cString = new String();
var varRes = '';
for (i = 0; i < data.search_for.length; i++) {
cString = data.search_for.substring(i, i + 1);
for (j = 0; j < caracteresInvalidos.length; j++) {
if (caracteresInvalidos.substring(j, j + 1) == cString){
cString = caracteresValidos.substring(j, j + 1);
}
}
varRes += cString;
}
data.search_for = varRes;
for (i=((sliderValue -1)*6)+1; i<(((sliderValue -1)*6)+1)+6; i++) {
var Op = document.createElement("li");
if(i > data.length)
break;
if (data['type_catalog'] != 'G' && (data[i-1].mail == null || data[i-1].mail == ""))
data[i-1].mail = get_lang("No mail");
if(i == (((sliderValue -1)*6)+1)) {
Op.setAttribute("class", "ui-selected");
Op.setAttribute("className", "ui-selected");
}
else {
Op.setAttribute("class", "ui-selectee");
Op.setAttribute("className", "ui-selectee");
}
var contact_name = utf8_decoder(data[i-1].cn);
if(contact_name == 'undefined'){
contact_name = utf8_decoder(data[i-1].title);
if(contact_name != 'undefined'){
data[i-1].mail = data[i-1].short_name;
}
}
var exist = "add_contact_field";
var signal = "+";
var btnClass = "add";
var emailList = $("#" + field_ + "_" + id_).val();
var emails_adicionados = emailList.split(",");
for(aux=0; aux[\s]*$/)){
if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == (utf8_decoder(data[i-1].mail)).toLowerCase()){
emails_adicionados[aux] = "%";
exist = "remove_contact_field";
signal = "x";
btnClass = "remove";
}
}else{
if(emails_adicionados[aux].toLowerCase() == (utf8_decoder(data[i-1].mail)).toLowerCase()){
emails_adicionados[aux] = "%";
exist = "remove_contact_field";
signal = "x";
btnClass = "remove";
}
}
}
if(contact_name.toLowerCase().indexOf(acento.toLowerCase()) != -1 && acento.indexOf(" ") == -1 && acento.indexOf("@") == -1)
contact_name = contact_name.substring(0, contact_name.toLowerCase().indexOf(acento.toLowerCase())) + "" + contact_name.substr(contact_name.toLowerCase().indexOf(acento.toLowerCase()), acento.length) + " " + contact_name.substring(contact_name.toLowerCase().indexOf(acento.toLowerCase()) + acento.length);
else if(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()) != -1 && data.search_for.indexOf(" ") == -1 && data.search_for.indexOf("@") == -1)
contact_name = contact_name.substring(0, contact_name.toLowerCase().indexOf(data.search_for.toLowerCase())) + "" + contact_name.substr(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()), data.search_for.length) + " " + contact_name.substring(contact_name.toLowerCase().indexOf(data.search_for.toLowerCase()) + data.search_for.length);
var line = '';
Op.innerHTML = line;
$(Op).val(i - 1);
selectable.append(Op);
$("#contact_"+i).click(function(){
document.getElementById("amount-text").focus();
});
}
selectable.append(Ul);
var first_contact;
begin ? first_contact = 0 : first_contact = ((sliderValue* 6) -6);
var details = $("#detalhes_contato").empty();
switch (data['type_catalog']) {
case 'G':
var extra_fields = (data['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0) {
details.append('' + utf8_decoder(data[first_contact].cn[0]) + " " + '' + data[first_contact].mail[0] + "
");
details.append('Telefone ' + '' + data[first_contact].telephonenumber[0] + '
');
}
for (var i=0; i<=extra_fields.length-1; i++) {
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data[0][valor.toLowerCase()] != undefined)
{
var tmp_campo = '' + campo + " " ;
for(j=0; j' + utf8_decoder(data[first_contact][valor.toLowerCase()][j]) + "
");
tmp_campo = "";
}
}
}
break;
case 'P':
if(utf8_decoder(data[first_contact].cn) != 'undefined')
details.append('' + utf8_decoder(data[first_contact].cn) + ' ' + '' + data[first_contact].mail + '
');
else
details.append('' + utf8_decoder(data[first_contact].title) + ' ' + '' + data[first_contact].short_name + '
');
if(data[first_contact].telephonenumber != null)
details.append('Telefone ' + '' + data[first_contact].telephonenumber + '
');
break;
default:
var extra_fields = (data['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0 || data[first_contact].type_contact == "P") {
if(utf8_decoder(data[first_contact].cn) != 'undefined')
details.append('' + utf8_decoder(data[first_contact].cn) + ' ' + '' + data[first_contact].mail + '
');
else
details.append('' + utf8_decoder(data[first_contact].title) + ' ' + '' + data[first_contact].short_name + '
');
if(data[first_contact].telephonenumber != null)
details.append('Telefone ' + '' + data[first_contact].telephonenumber + "
");
}
if( data[first_contact].type_contact == "G") {
if(data[first_contact].mail[0].length > 1) {
for (var i=0; i<=extra_fields.length-1; i++) {
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data[first_contact][valor.toLowerCase()] != undefined) {
var tmp_campo = '' + campo + " " ;
for(j=0; j' + utf8_decoder(data[first_contact][valor.toLowerCase()][j]) + "
");
tmp_campo = "";
}
}
}
}
}
break;
}
var string_results = sliderValue + " " + get_lang("of") + " " + paginas + " (" + data.length + " " + get_lang("Results") + ")";
$( "#amount-text" ).val( string_results );
$("button").button();
//$("button.remove").button({icons:{primary:"ui-icon-close"}, text: false});
//$("button.add").button({icons:{primary:"ui-icon-plus"}, text: false});
if(!is_ie)
document.getElementById("amount-text").focus();
$("#selectable li:first").focus();
removeFocus();
}
/* Método que configura os detalhes do resultado da busca */
function details_results(data) {
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var details = $("#detalhes_contato").empty();
$( ".ui-selected", this ).each(function() {
if(data.length > 0){
switch(data['type_catalog']) {
case 'G':
var extra_fields = (data['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0) {
details.append('' + utf8_decoder(data[this.value].cn[0]) + " " + '' + data[this.value].mail[0] + "
");
details.append('Telefone ' + '' + data[this.value].telephonenumber[0] + "
");
}
for (var i=0; i<=extra_fields.length-1; i++) {
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data[this.value][valor.toLowerCase()] != undefined) {
var tmp_campo = '' + campo + " " ;
for(j=0; j' + utf8_decoder(data[this.value][valor.toLowerCase()][j]) + "
");
tmp_campo = "";
}
}
}
break;
case 'P':
if(utf8_decoder(data[this.value].cn) == 'undefined')
details.append('' + utf8_decoder(data[this.value].title) + " " + '' + data[this.value].short_name + "
");
else
details.append('' + utf8_decoder(data[this.value].cn) + " " + '' + data[this.value].mail + "
");
if(data[this.value].telephonenumber != null)
details.append('Telefone ' + '' + data[this.value].telephonenumber + "
");
break;
default:
var extra_fields = (data['extra_ldap_fields']).split("#");
if(preferences.default_fields_quick_search != 0 || data[this.value].type_contact == "P") {
if(utf8_decoder(data[this.value].cn) == 'undefined')
details.append('' + utf8_decoder(data[this.value].title) + " " + '' + data[this.value].short_name + "
");
else
details.append('' + utf8_decoder(data[this.value].cn) + " " + '' + data[this.value].mail + "
");
if(data[this.value].telephonenumber != null)
details.append('Telefone ' + '' + data[this.value].telephonenumber + "
");
}
if(data[this.value].mail[0] == 'undefined')
break;
if(data[this.value].mail[0] != get_lang("No mail")) {
if(data[this.value].mail[0].length > 1) {
for (var i=0; i<=extra_fields.length-1; i++) {
var campo = extra_fields[i].substr(extra_fields[i].indexOf("|")+1);
var valor = extra_fields[i].substr(0, (extra_fields[i].indexOf("|")));
if(data[this.value][valor.toLowerCase()] != undefined) {
var tmp_campo = '' + campo + " " ;
for(j=0; j' + utf8_decoder(data[this.value][valor.toLowerCase()][j]) + "
");
tmp_campo = "";
}
}
}
}
}
break;
}
}
});
}
});
});
}
/*
* Método que configura o slider e os resultados
*/
function configure_slider(data) {
var paginas = (Math.ceil(data.length/6));
$("#title_usuarios").html( get_lang("Results") );
$(function() {
$( "#slider" ).slider({
value:1,
min: 1,
max: paginas,
step: 1,
slide: function( event, ui ) {
create_list(data, false, ui.value);
var string_results = ui.value + " " + get_lang("of") + " " + paginas + " (" + data.length + " " + get_lang("Results") + ")";
$( "#amount-text" ).val( string_results );
}
});
$("#selectable li:first button:first").focus();
});
}
var search_focus = false;
function setFocus() {search_focus = true;return;}
function removeFocus() {search_focus = false;return;}
function checkEnter(e) {
var kC = window.event ? event.keyCode :
e && e.keyCode ? e.keyCode :
e && e.which ? e.which : null;
if (kC)
return kC == 13;
else
return false;
}
/*
* Faz a busca direto da tela modal
*/
function buscaContato(param) {
$("#busca, #detalhes_contato, #selectable").empty();
if(param.length == 0) {
alert(get_lang("Please enter a parameter to search"));
return;
}
if(param.length < preferences.search_characters_number) {
alert(get_lang("parameter must be at least") + " " + preferences.search_characters_number + " " + get_lang("characters"));
return false;
}
var catalog = $("#combobox").val();
var handler_emQuickSearch = function(data) {
data_ = data;
if(data_.length > 0) {
configure_slider(data_);
create_list(data, true);
details_results(data_);
}
else {
$("#detalhes_contato, #selectable").empty();
var selectable = $("#selectable");
var Ul = document.createElement("ul");
Ul.onclick = function(){
};
var Op = document.createElement("li");
Op.innerHTML = 'Nenhum Resultado Encontrado
';
selectable.append(Op);
selectable.append(Ul);
var string_results = "0 " + get_lang("of") + " 0 (0 " + get_lang("Results") + ")";
$( "#amount-text" ).val( string_results );
details_results(data);
configure_slider(data);
}
}
cExecute ("$this.ldap_functions.quicksearchcontact&search_for="+param+"&field=TO&ID=0&catalog="+catalog, handler_emQuickSearch);
}
function verifyEmails(emailAux, contato) {
var contact_id = contato.split("_");
if(contact_id[1] != 0)
{
var ini = parseInt((contact_id[1]/6).toFixed(0));
if(ini != 0 && ini != 1){
ini = ini * 6;
var fim = ini+1;
}
else{
ini = 1;
var fim = ini;
}
fim = fim +5;
var contact2 = "";
for(aux = ini; aux <= fim; aux++){
if(contact_id[1] != aux){
if($("#"+contact_id[0]+"_"+aux).find('.email').text() == emailAux){
contact2 = contact_id[0]+"_"+aux;
var button = document.getElementById("actions_"+aux);
var div = document.getElementById(contact2);
if($("#actions_"+aux).find('.ui-button-text').text() == '+'){
button.onclick = function(){
remove_contact_field(div.innerHTML, button, contact2);
};
div.ondblclick = function(){
remove_contact_field(div.innerHTML, button, contact2);
};
$("#actions_"+aux).find('.ui-button-text').text('x');
}
else{
button.onclick = function(){
add_contact_field(div.innerHTML, button, contact2);
};
div.ondblclick = function(){
add_contact_field(div.innerHTML, button, contact2);
};
$("#actions_"+aux).find('.ui-button-text').text('+');
}
}
}
}
}
}
/*
* Método que adiciona o contato selecionado no campo do email (To, CC, CCo)
*/
function add_contact_field(contact, button, divs) {
var nome = $(contact).clone().find('.name').text();
var email = $(contact).clone().find('.email').text();
if(email == get_lang("No mail")){
alert(get_lang("It is not possible to add this contact as a recipient because it does not have email"));
if(!is_ie)
document.getElementById("amount-text").focus();
return;
}
verifyEmails(email, divs);
final_contact = "\""+nome +"\" <"+email+">, ";
var emailList = document.getElementById(field_ + "_" + id_).value;
//remove os caracteres da busca
emailList = emailList.substr(0,emailList.lastIndexOf(',')+1);
if (emailList[0] != '"' && emailList.indexOf(",") < 0)
emailList = emailList.substr(end_);
if(emailList.lastIndexOf(",") > 0){
if(emailList.substr(emailList.length-1, emailList.length) == "," || emailList.substr(emailList.length-2, 1) == ","){
emailList = emailList.substr(0, emailList.lastIndexOf(",") + 1);
} else {
emailList = emailList.substr(0, emailList.lastIndexOf("") + 1);
final_contact = ","+final_contact;
}
}
final_contact = final_contact.replace(/\/n/, "");
new_emailList = emailList + final_contact;
document.getElementById(field_ + "_" + id_).value = new_emailList;
button.onclick = function(){
remove_contact_field(document.getElementById(divs).innerHTML, button, divs);
};
var div = document.getElementById(divs);
div.ondblclick = function(){
remove_contact_field(div.innerHTML, button, divs);
};
button.innerHTML = 'x ';
}
/*
* Método que remove o contato selecionado no campo do email (To, CC, CCo)
*/
function remove_contact_field(contact, button, divs) {
var email = $(contact).clone().find('.email').text();
var exist = false;
var emailList = $("#" + field_ + "_" + id_).val();
var emails_adicionados = emailList.split(",");
verifyEmails(email, divs);
for(i=0; i[\s]*$/)){
if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) {
emails_adicionados[i] = "%";
exist = true;
}
}else{
if(emails_adicionados[i].toLowerCase() == email.toLowerCase()) {
emails_adicionados[i] = "%";
exist = true;
}
}
}
if (exist == false)
return false;
var novos_contatos = emails_adicionados.join(",");
novos_contatos = novos_contatos.replace(/%,/g, "");
$("#" + field_ + "_" + id_).val(novos_contatos);
button.onclick = function(){
add_contact_field(document.getElementById(divs).innerHTML, button, divs);
};
var div = document.getElementById(divs);
div.ondblclick = function(){
add_contact_field(div.innerHTML, button, divs);
};
button.innerHTML = '+ ';
}
/* Decoder utf8 */
function utf8_decoder ( str_data ) {
var tmp_arr = [], i = 0, ac = 0, c1 = 0, c2 = 0, c3 = 0;
str_data += '';
while ( i < str_data.length ) {
c1 = str_data.charCodeAt(i);
if (c1 < 128) {
tmp_arr[ac++] = String.fromCharCode(c1);
i++;
} else if ((c1 > 191) && (c1 < 224)) {
c2 = str_data.charCodeAt(i+1);
tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = str_data.charCodeAt(i+1);
c3 = str_data.charCodeAt(i+2);
tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return tmp_arr.join('');
}
/* Mostra tela de help */
function show_help() {
$(function() {
$( "#dialog-modal_help" ).dialog({
resizable: false,
width: 540,
modal: true,
closeOnEscape: true,
close : function (event, ui) {
$( "#amount-text" ).focus();
event.stopPropagation();
}
});
});
}
$("#dialog-modal_help").live("dialogclose", function(){
if(!is_ie)
$( "#amount-text" ).focus();
});
emQuickCatalogSearch.prototype.showWindow = function (div) {
$(this).bind('keydown');
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-modal" ).dialog({
resizable: false,
// height: "auto",
width: 780,
modal: true,
position: 'bottom',
closeOnEscape: true,
close: function (event, ui) {
event.stopPropagation();
$(this).unbind('keydown');
if (is_ie) {
var range= document.getElementById(field_ + "_" + id_).createTextRange();
range.collapse(false);
range.select();
} else {
document.getElementById(field_ + "_" + id_).focus();
}
},
open: function () {
removeFocus();
$("#selectable li:first").focus();
document.getElementById("amount-text").focus();
},
focus: function (event, ui) {
//$(this).unbind('keydown');
},
beforeClose: function (event, ui) {
$(this).unbind('keydown');
},
buttons:[
{
text: "Fechar",
click: function(){
$("#detalhes_contato, #selectable, #busca").empty();
$(this).dialog("close");
if (is_ie) {
var range= document.getElementById(field_ + "_" + id_).createTextRange();
range.collapse(false);
range.select();
} else {
document.getElementById(field_ + "_" + id_).focus();
}
},
style: "margin-top: -2.1em"
}
]
});
});
$(".ui-dialog .ui-dialog-titlebar")
.append('minimize ')
.find('.ui-dialog-titlebar-minimize').click(function() {
$(".ui-dialog-buttonpane, .ui-dialog-content").toggle();
$(".ui-icon-minusthick, .ui-icon-newwin").toggleClass('ui-icon-minusthick').toggleClass('ui-icon-newwin');
});
$("#dialog-modal button, input.button").button();
}
/* Build the Object */
//QuickCatalogSearch;
QuickCatalogSearch = new emQuickCatalogSearch();