source: trunk/jmessenger/js/jscode/loadIM.js @ 2977

Revision 2977, 39.9 KB checked in by alexandrecorreia, 14 years ago (diff)

Ticket #1122 - Retirado a tela de login do modulo IM sem java( Novo IM )

  • Property svn:executable set to *
Line 
1(function()
2{
3        var _autoStatus;
4        var _autoStatusTime             = 60000; // 1 minuto
5        var addUser                                     = null;
6        var conn                                        = null;
7        var fullName                            = "";
8        var path                                        = "";
9        var _preferencesIM                      = "";
10        var selectEditable                      = null;
11        var showhidden                          = null;
12        var statusUserIM                        = "";
13        var _statusMessage                      = "";
14        var timeoutId                           = null;
15        var userCurrent                         = null;
16        var _timeOutNotification        = "";
17        var Xtools                                      = null;
18        var zIndex                                      = 9001;
19        var windowPopUp                         = [];
20       
21        // Sniffer Browser
22        var agt = navigator.userAgent.toLowerCase();
23    var is_major = parseInt(navigator.appVersion);
24    var is_minor = parseFloat(navigator.appVersion);   
25    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
26                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
27                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
28    var is_gecko = (agt.indexOf('gecko') != -1);
29    var is_gecko1_5 = (agt.indexOf('firefox/1.5') != -1 || agt.indexOf('firefox/2') != -1 || agt.indexOf('iceweasel/2') != -1);
30    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
31    var is_ie3    = (is_ie && (is_major < 4));
32    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
33    var is_ie4up  = (is_ie && (is_major >= 4));
34    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
35    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
36    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
37    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
38    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
39    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);   
40    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
41
42        // Images
43        var add_user = new Image();
44        add_user.src = path_jabberit + 'templates/default/images/adduser_azul.png';
45
46        var arrow_down = new Image();
47        arrow_down.src = path_jabberit + 'templates/default/images/arrow_down.gif';
48
49        var arrow_right = new Image();
50        arrow_right.src = path_jabberit + 'templates/default/images/arrow_right.gif';
51       
52        function actionButton()
53        {
54                if( arguments.length > 0 )
55                {
56                        var e                   = arguments[0];
57                        var _element    = ( e.target ) ? e.target : e.srcElement;
58                        var jid         = arguments[1];
59                        var coord       = null;
60
61                        if ( !e )
62                                e = window.event;
63
64                        var _X = e.clientX + document.body.scrollLeft - document.body.clientLeft;
65                        var _Y = e.clientY + document.body.scrollTop  - document.body.clientTop;
66                               
67                        coord = { X : _X, Y : _Y };
68               
69
70                        var _onContextMenu = function()
71                        {
72                                return false;
73                        };
74                       
75                        window.document.oncontextmenu   = _onContextMenu;
76                       
77                        if( e.button )
78                        {
79                                if( e.button > 1 )
80                                        optionsItensContact( jid, coord );
81                                else
82                                        TrophyIM.rosterClick(jid);
83                        }       
84                        else if( e.which )
85                        {
86                                if( e.which > 1 )
87                                        optionsItensContact( jid, coord );
88                                else
89                                        if( e.target.id )
90                                                TrophyIM.rosterClick(jid);
91                        }
92                       
93                        setTimeout(function()
94                        {
95                                window.document.oncontextmenu = function()
96                                {
97                                        return true;
98                                };
99                               
100                        },500);
101                }
102        }
103
104        function addContact()
105        {
106                if( arguments.length > 0 )
107                        addUser.add();
108                else
109                        addUser.show();
110        }
111       
112        function addIcon()
113        {
114               
115                var div_write_msg       = ( getElement('em_div_write_msg') != null ) ? getElement('em_div_write_msg') : null ;
116                var StatusBar           = ( getElement('divStatusBar') != null ) ? getElement('divStatusBar') : null ;
117                var StatusBarIM         = ( getElement('JabberMessenger') != null ) ?  getElement('JabberMessenger') : null;
118               
119                /**************************************************************************
120                 *
121                 * Quando estiver habilitada a opção fora de escritório nos filtros.
122                 * 
123                 */
124
125                if( ( div_write_msg && StatusBarIM ) != null )
126                {               
127                        div_write_msg.parentNode.insertBefore(StatusBarIM, div_write_msg);
128                        StatusBarIM.style.paddingLeft = '33px';
129                        return;
130                }
131               
132                /**************************************************************************/
133               
134                if ( !StatusBarIM )
135                {
136                        StatusBarIM = document.createElement('div');
137                        StatusBarIM.setAttribute('id', 'JabberMessenger');
138                }
139               
140                if( StatusBar )
141                {
142                        StatusBar.style.paddingLeft = '33px';
143                       
144                        var _div = document.createElement('div');
145                                _div.appendChild(StatusBar.parentNode.removeChild(StatusBar.previousSibling));
146                       
147                                StatusBar.parentNode.insertBefore( _div, StatusBar);
148                       
149                        var _fastMenu = top.document.createElement('div');
150                                _fastMenu.setAttribute('id', 'fast_menu_jabber_expresso');
151                                _fastMenu.style.background              = 'no-repeat';
152                                _fastMenu.style.backgroundImage = 'url(' + arrow_down.src + ')';
153                                _fastMenu.style.float                   = 'left';
154                                _fastMenu.style.height                  = '15px';
155                                _fastMenu.style.left                    = '7px';
156                                _fastMenu.style.margin                  = '8 0 0 10px';
157                                _fastMenu.style.padding                 = '0px';
158                                _fastMenu.style.position                = 'absolute';
159                                _fastMenu.style.width                   = '15px';
160                                _fastMenu.style.cursor                  = 'pointer';
161
162                        StatusBarIM.insertBefore( _fastMenu, StatusBarIM.firstChild );
163                       
164                        // Add event onclick element _fastMenu
165                        configEvents( _fastMenu, 'onclick', function(){ fastMenu(_fastMenu); });
166
167                        var _statusJabber = top.document.createElement('div');
168                                _statusJabber.setAttribute('id','status_jabber_expresso');
169                                _statusJabber.style.background          = 'no-repeat';
170                                _statusJabber.style.backgroundImage = 'url(' + add_user.src +')';
171                                _statusJabber.style.float                       = 'left';
172                                _statusJabber.style.height                      = '18px';
173                                _statusJabber.style.left                        = '19px';
174                                _statusJabber.style.margin                      = '0 0 0 10px';
175                                _statusJabber.style.padding                     = '0px';
176                                _statusJabber.style.position            = 'absolute';
177                                _statusJabber.style.width                       = '18px';
178                                _statusJabber.style.cursor                      = 'pointer';
179                                _statusJabber.style.zindex                      = '999999';
180                       
181                        StatusBarIM.insertBefore( _statusJabber, StatusBarIM.firstChild );
182                       
183                        StatusBar.insertBefore( StatusBarIM, StatusBar.firstChild );
184
185                        // Add event onclick element _statusJabber
186                        if( _preferencesIM[0] == "openWindowJabberit:true" )
187                        {
188                                configEvents( _statusJabber, 'onclick', function(){ rosterDiv(); });
189                        }
190                        else
191                        {
192                                configEvents( _statusJabber, 'onclick', function(){ TrophyIM.load(); });
193                        }
194                }
195        }
196
197        function autoStatus()
198        {
199                var _div_status = ( getElement('status_jabber_expresso') != null ) ?  getElement('status_jabber_expresso') : null;
200               
201                if ( _autoStatus )
202                        clearTimeout(_autoStatus);
203
204                if ( _div_status != null )
205                {
206                        var _status = _div_status.style.backgroundImage;
207                                _status = _status.substr(_status.lastIndexOf('/') + 1);
208                                _status = _status.substr(0, _status.indexOf('.'));
209                               
210                        if( _status == "xa" && _div_status.getAttribute('autoStatus') )
211                        {
212                                if( getStatusMessage() != "")
213                                        TrophyIM.setPresence("available", getStatusMessage());
214                                else
215                                        TrophyIM.setPresence("available");
216                               
217                                _div_status.removeAttribute('autoStatus');
218                                loadscript.setStatusJabber("Disponível","available");
219                        }
220                }
221               
222                var TimeStatus = _preferencesIM[2].split(':');
223
224                if( TimeStatus[1] )
225                        _autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(TimeStatus[1]) * _autoStatusTime );
226                else
227                        _autoStatus = setTimeout( function(){ autoStatusHandler();}, parseInt(_autoStatusTime));
228        }
229       
230        function autoStatusHandler()
231        {
232                var _div_status = ( getElement('status_jabber_expresso') != null ) ?  getElement('status_jabber_expresso') : null;
233               
234                if ( _div_status != null )
235                {
236                        var _status = _div_status.style.backgroundImage;
237                                _status = _status.substr(_status.lastIndexOf('/') + 1);
238                                _status = _status.substr(0, _status.indexOf('.'));
239                       
240                        if( _status == "available" )
241                        {
242                                if(getStatusMessage() != "")
243                                        TrophyIM.setPresence("xa", getStatusMessage());
244                                else
245                                        TrophyIM.setPresence("xa");
246
247                                _div_status.setAttribute('autoStatus','true');
248                               
249                                loadscript.setStatusJabber("Não Disponível","xa");
250                        }
251                }
252        }
253
254        function clrAllContacts()
255        {
256                getElement("JabberIMRoster").innerHTML = "";
257        }
258       
259        function configEvents(pObj, pEvent, pHandler)
260        {
261                if ( typeof pObj == 'object' )
262                {
263                        if ( pEvent.substring(0, 2) == 'on' )
264                                pEvent = pEvent.substring(2, pEvent.length );
265
266                        if ( arguments.length == 3 )
267                        {
268                                if ( pObj.addEventListener )
269                                        pObj.addEventListener(pEvent, pHandler, false );
270                                else if ( pObj.attachEvent )
271                                        pObj.attachEvent( 'on' + pEvent, pHandler );
272                        }
273                        else if ( arguments.length == 4 )
274                        {
275                                if ( pObj.removeEventListener )
276                                        pObj.removeEventListener( pEvent, pHandler, false );
277                                else if ( pObj.detachEvent )
278                                        pObj.detachEvent( 'on' + pEvent, pHandler );
279                        }
280                }
281        }
282
283        function disabledNotificationNewUsers()
284        {
285                var _notification       = getElement('notification_new_users_jabber') ;
286                var _statusJabber       = getElement('status_jabber_expresso');
287
288                _notification.style.display = 'none';
289               
290                _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat";
291               
292                if( _timeOutNotification )
293                        clearTimeout(_timeOutNotification );
294               
295                TrophyIM.controll.notificationNewUsers = 0;
296        }
297       
298        function enabledNotificationNewUsers()
299        {
300                var _notification       = getElement('notification_new_users_jabber') ;
301                var _statusJabber       = getElement('status_jabber_expresso');
302       
303                if( _notification && _statusJabber )
304                {       
305                        if ( _notification.style.display == 'none' )
306                        {
307                                _notification.style.display = 'block';
308                               
309                                _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/alert_mini.png') no-repeat";
310                               
311                                if( _timeOutNotification )
312                                        clearTimeout(_timeOutNotification );
313
314                                _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 2000 );
315                        }
316                        else
317                        {
318                                _notification.style.display = 'none';
319                               
320                                _statusJabber.style.background = "url('"+path_jabberit+"templates/default/images/" + statusUserIM + ".gif') no-repeat";
321                               
322                                if( _timeOutNotification )
323                                        clearTimeout(_timeOutNotification );
324
325                                _timeOutNotification = setTimeout( function(){ enabledNotificationNewUsers(); }, 800 );
326                        }
327                }
328        }
329
330        function fastMenu()
331        {
332                if( arguments.length > 0 )
333                {
334                        var element = arguments[0];
335
336                        if( showhidden == null )
337                                showhidden = new ShowHidden(300);
338
339                        var _options = [
340                                                ['Adicionar Contato', 'loadscript.addContact();' ],
341                                                ['Ajuda', 'alert("2")' ],
342                                                ['Preferências', 'loadscript.preferences();'],
343                                                   ];
344
345                        var _itens = "";
346                       
347                        for( var i in _options )
348                        {
349                                if( _options[i].constructor == Function )
350                                        continue;
351                               
352                                _itens += '<img src="'+arrow_right.src+'"/>';
353                                _itens += '<span style="cursor:pointer; margin:3px;" onclick='+_options[i][1]+'>';
354                                _itens += _options[i][0] + '</span><br/>';
355                        }
356                       
357                        var _optionsItens = document.createElement("div");
358                                _optionsItens.id        = "fastMenu_Jabber";                           
359                                _optionsItens.style.marginTop   = "19px";
360                                _optionsItens.style.marginLeft  = "-8px";
361                                _optionsItens.className         = "x-menu";
362                                _optionsItens.style.zIndex      = '999999';
363                                _optionsItens.innerHTML         = _itens;
364                                _optionsItens.onclick           = function(){ showhidden.hiddenObject(false); };
365                                _optionsItens.onmouseout        = function(){ showhidden.hiddenObject(false); };
366                                _optionsItens.onmouseover       = function(){ showhidden.hiddenObject(true); };
367                                                                                 
368                                showhidden.action('onmouseover', 'onmouseout', _optionsItens);
369                               
370                        element.parentNode.appendChild( _optionsItens );
371                }
372        }
373       
374        function getElement( elementId )
375        {
376                return document.getElementById( elementId );
377        }
378       
379        function getIsIE()
380        {
381                return is_ie;
382        }
383       
384        function getPhotoUser( jid )
385        {
386                try
387                {
388                var _divPhoto = getElement( jid + '__photo' );
389
390                if( _divPhoto.style.backgroundImage.indexOf('photo.png') > 0 )
391                {
392                        var _imgUser  = path_jabberit + 'inc/WebService.php?' + Date.parse( new Date );
393                                _imgUser += '&photo_ldap=' + jid;
394
395                        _divPhoto.style.backgroundImage = 'url(' + _imgUser + ')';
396                }
397                }
398                catch(e)
399                {}
400        }
401       
402        function getShowContactsOffline()
403        {
404                if( _preferencesIM[3] )
405                {
406                        var showOffline = _preferencesIM[3].split(":");
407                       
408                        if( showOffline[1] === "true")
409                                return true;
410                        else
411                                return false;
412                }
413               
414                return true;
415        }
416       
417        function getSmiles( String )
418        {
419                String = String.replace( /:\)|:-\)/g    , " <img src='"+path_jabberit+"templates/default/images/smiles/1.gif'/> ");
420                String = String.replace( /:-D/g                 , " <img src='"+path_jabberit+"templates/default/images/smiles/2.gif'/> ");
421                String = String.replace( /;-\)/g                , " <img src='"+path_jabberit+"templates/default/images/smiles/3.gif'/> ");
422                String = String.replace( /=-O/g                 , " <img src='"+path_jabberit+"templates/default/images/smiles/4.gif'/> ");
423                String = String.replace( /:P/g                  , " <img src='"+path_jabberit+"templates/default/images/smiles/5.gif'/> ");
424                String = String.replace( /8-\)/g                , " <img src='"+path_jabberit+"templates/default/images/smiles/6.gif'/> ");
425                String = String.replace( /\>:o/g                , " <img src='"+path_jabberit+"templates/default/images/smiles/7.gif'/> ");
426                String = String.replace( /:-\$/g                , " <img src='"+path_jabberit+"templates/default/images/smiles/8.gif'/> ");
427                String = String.replace( /:s|:-X/g              , " <img src='"+path_jabberit+"templates/default/images/smiles/9.gif'/> ");
428                String = String.replace( /:-\(/g                , " <img src='"+path_jabberit+"templates/default/images/smiles/10.gif'/> ");
429                String = String.replace( /:\'\(/g               , " <img src='"+path_jabberit+"templates/default/images/smiles/11.gif'/> ");
430                String = String.replace( /:\|/g                 , " <img src='"+path_jabberit+"templates/default/images/smiles/12.gif'/> ");
431                String = String.replace( /O:-\)/g               , " <img src='"+path_jabberit+"templates/default/images/smiles/13.gif'/> ");
432                String = String.replace( /\*\*@#%/g             , " <img src='"+path_jabberit+"templates/default/images/smiles/14.gif'/> ");
433                String = String.replace( /\(I\)/g               , " <img src='"+path_jabberit+"templates/default/images/smiles/15.gif'/> ");
434 
435                return String;
436        }
437       
438        function getStatusMessage()
439        {
440                return _statusMessage;
441        }
442       
443        function getUserCurrent()
444        {
445                return userCurrent;
446        }
447       
448        function getZindex()
449        {
450                return zIndex++;
451        }
452       
453        function groupsHidden()
454        {
455                if( arguments.length > 0 )
456                {
457                        var _element = arguments[0];
458                                _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_right.gif') no-repeat center left";
459                                _element.onclick = function(){ groupsVisible(_element);};
460                               
461                                // Hidden all
462                                var _elementNext = _element.nextSibling;
463                               
464                                while( _elementNext )
465                                {       
466                                        if( _elementNext.nodeType == 1 )
467                                                _elementNext.style.display = "none";
468                                       
469                                        _elementNext = _elementNext.nextSibling;
470                                }
471                }
472        }
473       
474        function groupsVisible()
475        {
476                if( arguments.length > 0 )
477                {
478                        var _element = arguments[0];
479                                _element.style.background = "url('"+path_jabberit+"templates/default/images/arrow_down.gif') no-repeat center left";
480                                _element.onclick = function(){ groupsHidden(_element);};
481
482                                // Display all
483                                var _elementNext = _element.nextSibling;
484                               
485                                while( _elementNext )
486                                {       
487                                        if( _elementNext.nodeType == 1 && _elementNext.nodeName.toLowerCase() == "div" )
488                                        {
489                                                var is_off = _elementNext.style.backgroundImage.indexOf("unavailable");
490
491                                                if( is_off > 0 && !getShowContactsOffline())
492                                                {
493                                                        _elementNext.style.display = "none";
494                                                        getElement("span_show_" + _elementNext.id ).style.display = "none";
495                                                       
496                                                }
497                                                else
498                                                {
499                                                        _elementNext.style.display = "block";
500                                                        getElement("span_show_" + _elementNext.id ).style.display = "block";
501                                                }
502                                        }
503
504                                        _elementNext = _elementNext.nextSibling;
505                                }
506                }
507        }
508       
509        function keyPressSearch()
510        {
511                if( arguments.length > 0 )
512                {
513                        var ev          = arguments[0];
514                        var element     = arguments[1];
515       
516                        if ( ev.keyCode == 13 )
517                                if( element.value.length >= 3 )
518                                        searchUser( element.value );   
519                                else
520                                        alert('Your search argument must be longer than 3 characters.');
521                }
522        }
523
524       
525        function loginPage()
526        {
527                var paramsLoginPage =
528                {
529                        'username' : ((( Base64.decode(getUserCurrent().jid) )) ? Base64.decode(getUserCurrent().jid) : ""),
530                        'password' : ((( Base64.decode(getUserCurrent().password) )) ? Base64.decode(getUserCurrent().password) : "")
531                }
532               
533                var winLoginPage =
534                {       
535                         id_window              : "window_login_page",
536                         width                  : 260,
537                         height                 : 120,
538                         top                    : 100,
539                         left                   : 400,
540                         draggable              : true,
541                         visible                : "display",
542                         resizable              : true,
543                         zindex                 : zIndex++,
544                         title                  : "Expresso Messenger - Login",
545                         closeAction    : "remove",
546                         content                : Xtools.parse(Xtools.xml("login_page"), "loginPage.xsl", paramsLoginPage)     
547                };
548
549                _winBuild( winLoginPage );
550        }
551
552        function loadScripts(pFiles)
553        {
554                // Load JavaScript
555                var loadJavaScript = function(pJs)
556                {
557                        var newScript = document.createElement("script");
558                                newScript.setAttribute("type", "text/javascript");
559                                newScript.setAttribute("src", pJs );
560                               
561                        return newScript;
562                };
563               
564                // Load CSS
565                var loadStyleSheet = function(pCss)
566                {
567                        var newStyle = document.createElement("link");
568                                newStyle.setAttribute("rel", "stylesheet");
569                                newStyle.setAttribute("type", "text/css");
570                                newStyle.setAttribute("href", pCss);
571                               
572                        return newStyle;
573                };
574               
575                for(var i = 0; i < pFiles.length; i++)
576                {
577                        if( pFiles[i].indexOf(".js") > -1 )
578                                document.getElementsByTagName("head")[0].appendChild(loadJavaScript(pFiles[i]));
579                               
580                        if( pFiles[i].indexOf(".css") > -1 )
581                                document.getElementsByTagName("head")[0].appendChild(loadStyleSheet(pFiles[i]));
582                }
583        }
584       
585        function notificationNewMessage()
586        {
587                var _doc                = document;
588                var _id                 = arguments[0];
589                var _win_name   = _id.replace( /\W/g, '' );
590               
591                if ( windowPOPUP( _id ) )
592                {
593                        _doc = windowPopUp[_win_name].document;
594                }
595               
596                var oldTitle    = _doc.title;
597                var newTitle    = "## NOVA MENSAGEM ##";
598
599                if( timeoutId == null )
600                {
601                        timeoutId = setInterval(function()
602                        {
603                                _doc.title = ( _doc.title == newTitle ) ? oldTitle : newTitle;
604                        }, 1000);
605                       
606                        configEvents( _doc, 'onclick', function()
607                        {
608                                clearInterval(timeoutId);
609                                _doc.title      = oldTitle;
610                                timeoutId               = null;
611                        });
612                       
613                        configEvents( _doc, 'onkeypress', function()
614                        {
615                                clearInterval(timeoutId);
616                                _doc.title      = oldTitle;
617                                timeoutId               = null;
618                        });
619                }
620        }
621
622        function optionsItensContact()
623        {
624                if( arguments.length > 0 )
625                {
626                        var jid         = arguments[0];
627                        var coord       = arguments[1];
628                        var element = getElement('itenContact_' + jid );
629                        var action      = ( element.getAttribute("subscription") === "not-in-roster" ) ? "Adicionar" : "Autorizar";     
630                       
631                        if( showhidden == null )
632                                showhidden = new ShowHidden(300);
633
634                        var _options = [
635                                                [ action , 'loadscript.setAutorization(\''+jid+'\')'],
636                                                ['Remover' , 'loadscript.removeContact(\''+jid+'\')'],
637                                                ['Renomear' , 'loadscript.renameContact(\''+jid+'\')'],
638                                                ['Trocar grupo' , 'loadscript.renameGroup(\''+jid+'\')']
639                                                   ];
640
641                        var _itens = "";
642                       
643                        for( var i in _options )
644                        {
645                                if( typeof(_options[i]) == "object")
646                                {
647                                        _itens += '<img src="'+arrow_right.src+'"/>';
648                                        _itens += '<span style="cursor:pointer;margin:3px;font-weight:normal;" onclick='+_options[i][1]+'>';
649                                        _itens += _options[i][0] + '</span><br/>';
650                                }
651                        }
652                       
653                        var _optionsItens = document.createElement("div");
654                                _optionsItens.className         = "x-menu";
655                                _optionsItens.style.top         = coord.Y;
656                                _optionsItens.style.left        = ( coord.X - element.offsetLeft );
657                                _optionsItens.style.zIndex      = getZindex();
658                                _optionsItens.innerHTML         = _itens; 
659                                _optionsItens.onclick           = function(){ showhidden.hiddenObject(false); };
660                                _optionsItens.onmouseout        = function(){ showhidden.hiddenObject(false); };       
661                                _optionsItens.onmouseover       = function(){ showhidden.hiddenObject(true); };
662                               
663                                showhidden.action('onmouseover', 'onmouseout', _optionsItens);
664                               
665                        window.document.body.appendChild(_optionsItens);
666                }
667        }
668
669        function parse()
670        {
671                if( arguments.length == 2 )
672                        return Xtools.parse(Xtools.xml(arguments[0]), arguments[1] );
673               
674                if( arguments.length === 3 )
675                        return Xtools.parse(Xtools.xml(arguments[0]), arguments[1], arguments[2] );
676        }
677       
678        function preferences()
679        {
680                var paramPreferences =
681                {
682                        'path'  : path,
683                        'lang1' : 'Suas Preferências',
684                        'lang2' : 'Conexão',   
685                        'lang3' : 'Conectar Automaticamente o IM',
686                        'lang4' : 'Usuários OffLine',
687                        'lang5' : 'Exibir amigos Offline',
688                        'lang6' : 'Salvar',
689                        'lang7' : 'Cancelar',
690                        'lang8' : 'Janela de Contatos',
691                        'lang9' : 'Abrir janela como Pop-up',
692                        'lang10' : 'Ausente',
693                        'lang11' : 'Definir status de ausente depois de',
694                        'lang12' : 'minutos',   
695                        'lang13' : 'Mostrar Contatos', 
696                        'lang14' : 'Mostrar contatos desconectados',
697                        'langYes': 'Sim',
698                        'langNo' : 'Não'                                                                                           
699                };
700               
701               
702                var _win_preferences =
703                {
704                                id_window        : "jabberit_preferences",
705                                width            : 430,
706                                height           : 350,
707                                top                      : 150,
708                                left             : 100,
709                                draggable        : true,
710                                visible          : "display",
711                                resizable        : true,
712                                zindex           : zIndex++,
713                                title            : 'Expresso Messenger - Preferências',
714                                closeAction  : "remove",
715                                content          : Xtools.parse(Xtools.xml('preferences'), 'preferences.xsl', paramPreferences)
716                };
717
718                _winBuild(_win_preferences);
719               
720               
721                var _pButtons = {
722                                'lang1' : 'Salvar',
723                                'lang2' : 'Fechar',
724                                'onclickClose' : '_winBuild("jabberit_preferences","remove");',
725                                'onclickSubmit' : 'javascript:loadscript.setPreferences();'
726                };
727               
728                document.getElementById('buttons_preferences_jabberit').innerHTML = Xtools.parse(Xtools.xml('buttons_main'), 'buttons.xsl', _pButtons);
729               
730                // Element openWindowJabberit
731                var value1                      = _preferencesIM[0].split(':');
732                var element1            = document.getElementById(value1[0]);
733                var valueSelect1        = value1[1];
734               
735                for(var i = 0; i < element1.options.length; i++)
736                        if( element1.options[i].value == valueSelect1 )
737                                element1.options[i].selected = true;
738
739                // Element openWindowJabberitPopUp
740                var value2                      = _preferencesIM[1].split(':');
741                       
742                // Element flagAwayIM
743                var value3              = _preferencesIM[2].split(':');
744                var element3    = document.getElementById(value3[0]);
745                element3.value  = value3[1];
746               
747                // Element showContactsOfflineJabberit
748                var value4                      = _preferencesIM[3].split(':');
749                var element4            = document.getElementById(value4[0]);
750                var valueSelect4        = value4[1];
751                for(var i = 0; i < element4.options.length; i++)
752                        if( element4.options[i].value == valueSelect4 )
753                                element4.options[i].selected = true;
754        }
755       
756        function removeContact( jid )
757        {
758                TrophyIM.removeContact( jid );
759        }
760       
761        function removeElement( )
762        {
763                if( arguments.length > 0 )
764                {
765                        var _element = arguments[0]
766                        var _parent  = _element.parentNode;
767       
768                        _parent.removeChild( _element );
769                }
770        }
771       
772        function removeGroup()
773        {
774                var _parent = arguments[0];
775               
776                if( _parent.childNodes.length <= 2 )
777                        _parent.parentNode.removeChild(_parent);
778        }
779       
780        function renameContact()
781        {
782                if( arguments.length > 0 )
783                {
784                        var _jid        = arguments[0];
785                       
786                        TrophyIM.renameContact( _jid );
787                }
788        }
789       
790        function renameGroup()
791        {
792                if( arguments.length > 0 )
793                {
794                        var _jid        = arguments[0];
795                       
796                        TrophyIM.renameGroup( _jid );
797                }
798        }
799       
800        function rosterDiv()
801        {
802                var _rosterDiv = function()
803                {
804                        var _idUser     = Base64.decode(getUserCurrent().jid);
805                       
806                        var paramListContact =
807                        {
808                                'idUser'                : _idUser,
809                                'full_name'             : (( fullName.length < 25 ) ? fullName : ( fullName.substring( 0, 25) + "...")),
810                                'path_jabberit' : path_jabberit,
811                                'zIndex_'               : zIndex++
812                        };
813       
814                        var winRosterDiv =
815                        {
816                                 id_window              : "window_Roster_im",
817                                 width                  : 250,
818                                 height                 : 410,
819                                 top                    : 50,
820                                 left                   : -1500,
821                                 leftOld                : 50,
822                                 draggable              : true,
823                                 visible                : "display",
824                                 resizable              : true,
825                                 zindex                 : zIndex++,
826                                 title                  : "Expresso Messenger - Contatos",
827                                 closeAction    : "hidden",
828                                 content                : Xtools.parse(Xtools.xml("contacts_list"),"contactsList.xsl", paramListContact)       
829                        };
830                       
831                        if( _preferencesIM[0] == "openWindowJabberit:false" )
832                        {
833                                winRosterDiv.left               = 50;
834                                winRosterDiv.leftOld    = -1500;
835                        }
836                               
837                        _winBuild( winRosterDiv );
838                       
839                        // Photo User
840                        getPhotoUser(_idUser);
841                }
842               
843                setTimeout( function(){ _rosterDiv(); }, 200 );
844        }
845
846        function searchUser()
847        {
848                var _input      = getElement('search_user_jabber');
849               
850                if( _input.value.length >= 3 )
851                        addUser.search();
852                else
853                        alert( i18n.YOUR_SEARCH_ARGUMENT_MUST_BE_LONGER_THAN_3_CHARACTERS + '.' );
854        }
855       
856        function setAutorization()
857        {
858                var divItenContact = null;
859               
860                if( arguments.length > 0 )
861                {
862                        var jidTo = arguments[0];
863               
864                        if( getElement('itenContact_' + jidTo) )
865                                divItenContact = getElement('itenContact_' + jidTo );
866                }
867               
868        if( divItenContact )
869        {       
870                var subscription = divItenContact.getAttribute('subscription');
871
872                switch(subscription)
873                {
874                        case 'from':
875                               
876                                TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
877                                break;
878
879                        case 'none' :
880                               
881                                TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
882                                TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
883                               
884                                break;
885
886                        case 'not-in-roster':
887                                       
888                                setTimeout(function()
889                                        {
890                                        var _add = "";
891                               
892                                        if( ( _add = confirm("Deseja adicionar o usuario!")) )         
893                                        {
894                                                addUser.add( jidTo );
895                                        }
896                                       
897                                        },100);
898                               
899                                        break;
900                                       
901                        case 'to' :
902
903                                TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribed');
904                                       
905                        case 'subscribe' :
906                               
907                                TrophyIM.setAutorization( jidTo, Base64.decode(this.getUserCurrent().jid), 'subscribe');
908                               
909                                        break;
910                                       
911                                default :
912                                        alert( "SEM PARAMETRO DEFINIDO : " + subscription );
913                                       
914                }
915        }
916       
917        setTimeout(function()
918        {
919                        if( getElement('itenContactNotification_' + jidTo ) )
920                                loadscript.removeElement( getElement('itenContactNotification_' + jidTo ) );
921        },500);
922   
923        }
924       
925        function setMessageStatus()
926        {
927                if( arguments.length > 0 )
928                {
929                        var _element = arguments[0];
930                        var _parent      = _element.parentNode;                 
931
932                        if( _element.nodeName.toLowerCase() == "label")
933                        {
934                                var _input                              = document.createElement("input");
935                                        _input.size                     = "35";
936                                        _input.maxlength        = "35";
937                                        _input.style.border = "0";
938                                        _input.value            = _element.innerHTML;
939                                       
940                                // OnkeyUp
941                                configEvents( _input, "onkeyup", function(e)
942                                                {
943                                                        if( e.keyCode == 13 ) loadscript.setMessageStatus(_input, _element);
944                                                }
945                                );
946                               
947                                // Onblur       
948                            configEvents(_input, "onblur", function(){ loadscript.setMessageStatus(_input, _element)});         
949
950                           
951                                if( _parent != null )
952                                {       
953                                        // Remove label
954                                        if( _element != null )
955                                                _parent.removeChild( _element );
956                                               
957                                        // Add Input
958                                        if( _input != null )
959                                                _parent.appendChild( _input );
960                                }
961
962                                _input.focus();
963                                _input.select();
964                        }
965                        else
966                        {
967                                var _label              = arguments[1];
968                                _statusMessage  = _element.value.replace(/^\(+|\)+$/g,"");
969                               
970                                if( ( _statusMessage = _statusMessage.replace(/^\s+|\s+$|^\n|\n$/g,"") ) != "")
971                                        _label.innerHTML = "( " + _statusMessage + " )";
972                                else
973                                        _label.innerHTML = "( " + i18n.TYPE_YOUR_MESSAGE_HERE_STATUS + " )";
974                               
975                                if( _parent != null )
976                                {       
977                                        // Remove Input
978                                        if( _element != null )
979                                                _parent.removeChild( _element );
980                                               
981                                        // Add Label
982                                        if( _label != null )
983                                                _parent.appendChild( _label );
984                                }
985                               
986                                // Send Status Message
987                                _statusMessage = ( ( _statusMessage !=  i18n.TYPE_YOUR_MESSAGE_HERE_STATUS ) ? _statusMessage : "" );                           
988                               
989                                TrophyIM.setPresence("status", _statusMessage );
990                        }       
991                }
992        }
993       
994        function setPreferences()
995        {
996                // Element openWindowJabberit
997                var elementOpenW        = document.getElementById('openWindowJabberit');
998                var value                       = '';
999               
1000                for(var i = 0 ; i < elementOpenW.options.length; i++)
1001                        if( elementOpenW.options[i].selected == true)
1002                        {
1003                                value = 'preferences1=openWindowJabberit:' + elementOpenW.options[i].value;
1004                                _preferencesIM[0] = 'openWindowJabberit:' + elementOpenW.options[i].value;
1005                        }
1006
1007                // Element openWindowJabberitPopUp
1008                value += '&preferences2=openWindowJabberitPopUp:false';
1009                _preferencesIM[1] = 'openWindowJabberitPopUp:false';
1010               
1011                // Element flagAwayIM
1012                var elementFlagIM = document.getElementById('flagAwayIM');
1013               
1014                if( elementFlagIM.value.length > 0 && parseInt(elementFlagIM.value) > 0 )
1015                {
1016                        _preferencesIM[2] = 'flagAwayIM:' + elementFlagIM.value;
1017                        value += '&preferences3=flagAwayIM:' + elementFlagIM.value;
1018                }
1019                else
1020                {
1021                        alert('Informe um valor igual ou maior que 1!');
1022                        return false;
1023                }
1024
1025                // Element showContactsOfflineJabberit
1026                var elementShowOffline  = document.getElementById('showContactsOfflineJabberit');
1027               
1028                for(var i = 0 ; i < elementShowOffline.options.length; i++)
1029                        if( elementShowOffline.options[i].selected == true)
1030                        {
1031                                _preferencesIM[3] = 'showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
1032                                value += '&preferences4=showContactsOfflineJabberit:' + elementShowOffline.options[i].value;
1033                        }
1034               
1035                // Save Preferences
1036                conn.go('p.pf.setPreferences',
1037                                 function(data)
1038                                 {
1039                                        if( data == 'false' )
1040                                        {
1041                                                alert('Erro salvando suas preferências!');
1042                                        }
1043
1044                                        _winBuild('jabberit_preferences', 'remove');
1045                                 },
1046                                 value);
1047        }
1048       
1049        function setPresence()
1050        {
1051                if( arguments.length > 0 )
1052                {
1053                        var element = arguments[0];
1054                       
1055                        if( showhidden == null )
1056                                showhidden = new ShowHidden(300);
1057                       
1058                        var _status = [
1059                                               ['Afastado', 'away', '<img src="'+path_jabberit+'templates/default/images/away.gif" />'],
1060                                               ['Disponível', 'available', '<img src="'+path_jabberit+'templates/default/images/available.gif" />'],
1061                                               ['Livre p/ Conversa', 'chat', '<img src="'+path_jabberit+'templates/default/images/chat.gif" />'],
1062                                               ['Não Disponível', 'xa', '<img src="'+path_jabberit+'templates/default/images/xa.gif" />'],
1063                                               ['Ocupado', 'dnd', '<img src="'+path_jabberit+'templates/default/images/dnd.gif" />'],
1064                                               ['Desconectado', 'unavailable', '<img src="'+path_jabberit+'templates/default/images/unavailable.gif" />'],
1065                                               ['Mensagem de Status...', 'status', '<img src="'+path_jabberit+'templates/default/images/message_normal.gif" />'],                                               
1066                                          ];
1067                       
1068                        var _itens = "";
1069                       
1070                        for( var i in _status )
1071                        {
1072                                if( typeof( _status[i]) == "object" )
1073                                {
1074                                        _itens += '<span style="cursor:pointer;" onclick="TrophyIM.setPresence(\''+_status[i][1]+'\'); loadscript.setStatusJabber(\''+_status[i][0]+'\',\''+_status[i][1]+'\');">';
1075                                        _itens += _status[i][2]+ "<span style='margin:3px;'>" + _status[i][0] + "</span></span><br/>";
1076                                }
1077                        }
1078                       
1079                        var _statusItens = document.createElement("div");
1080                                _statusItens.style.marginTop    = "65px";
1081                                _statusItens.style.marginLeft   = "67px";
1082                                _statusItens.className                  = "x-menu";
1083                                _statusItens.style.zIndex               = '99999';
1084                                _statusItens.innerHTML                  = _itens; 
1085                                _statusItens.onclick                    = function(){ showhidden.hiddenObject(false); };
1086                                                                                 
1087                                showhidden.action('onmouseover', 'onmouseout', _statusItens);
1088                               
1089                        element.parentNode.onmouseout   = function(){ showhidden.hiddenObject(false); };
1090                        element.parentNode.onmouseover  = function(){ showhidden.hiddenObject(true); };
1091                        element.parentNode.appendChild(_statusItens);
1092                }
1093        }
1094
1095        function setSelectEditable(element)
1096        {
1097                if( getElement('selectBox0') == null )
1098                        selectEditable.create(element);
1099        }
1100
1101        function setStatusJabber()
1102        {
1103                if( arguments.length > 0 )
1104                {
1105                        if( arguments[1] != 'status' )
1106                        {
1107                                var _text       = arguments[0];
1108                                var _img        = statusUserIM = arguments[1];
1109                               
1110                                getElement('statusJabberText').innerHTML                = _text;
1111                                getElement('statusJabberImg').style.background  = "url('"+path_jabberit+"templates/default/images/"+_img+".gif')";
1112                                getElement('status_jabber_expresso').style.background = "url('"+path_jabberit+"templates/default/images/"+_img+".gif') no-repeat";
1113                        }
1114                }       
1115        }
1116
1117        function _setUserCurrent( _user )
1118        {
1119                userCurrent =
1120                {
1121                        'jid'           : _user.jid.substring(11, _user.jid.length),
1122                        'password'      : _user.password.substring(11, _user.password.length)
1123                }               
1124        }
1125       
1126        function setUserCurrent()
1127        {
1128                if( getUserCurrent() == null )
1129                {
1130                        conn.go('p.ff.data_0',
1131                                                function(_User)
1132                                                {
1133                                                        conn.go('p.ff.data_1',
1134                                                                        function(_pass)
1135                                                                        {
1136                                                                                _setUserCurrent( { jid : _User, password : _pass } );
1137                                                                        });
1138                                                });
1139                }
1140        }
1141
1142        var _stylesheets = [ ];
1143        var _links = document.getElementsByTagName( 'link' );
1144       
1145        for ( var i = 0; i < _links.length; i++ )
1146                if ( _links.item( i ).type && _links.item( i ).type.toLowerCase( ) == 'text/css' )
1147                        _stylesheets[ _stylesheets.length ] = _links.item( i ); 
1148       
1149        function windowPOPUP()
1150        {
1151                var _id = arguments[0];
1152                var _win_name = _id.replace( /\W/g, '' );
1153
1154                if ( arguments.length == 1 )
1155                {
1156                        if ( windowPopUp[_win_name] )
1157                                return true;
1158                        else
1159                                return false;
1160                }
1161               
1162                if( arguments.length == 2 )
1163                {       
1164                        if( !windowPopUp[_win_name] )
1165                        {
1166                                windowPopUp[_win_name] = window.open( '', _win_name + '__popup', 'height=355,width=380,top=50,left=50,toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,titlebar=no');
1167                                var tmp = windowPopUp[_win_name].document;
1168                               
1169                                tmp.write('<html><head>');
1170                                tmp.write('</head><body>');
1171                                tmp.write('</body></html>');
1172                                tmp.close();
1173                               
1174                                for ( var i = 0; i < _stylesheets.length; i++ )
1175                                        tmp.documentElement.getElementsByTagName( 'head' ).item(0).appendChild( _stylesheets[ i ].cloneNode( true ) );
1176
1177                                var divPOP = getElement( _id + "__popUp" );
1178                                        divPOP.style.background = "url('"+path_jabberit+"templates/default/images/icon_down.png') no-repeat";
1179                                        divPOP.innerHTML = "PopIn";
1180                                       
1181                                function _close( )
1182                                {
1183                                        windowPopUp[_win_name].close();
1184                                        configEvents( divPOP ,'onclick', _close, true );
1185                                }
1186                                       
1187                                configEvents( divPOP ,'onclick', _close );
1188
1189                                var _content = tmp.documentElement.getElementsByTagName( 'body' ).item(0).appendChild( getElement(_id + '__chatBox' ).parentNode );
1190
1191                                _content.firstChild.scrollTop = _content.firstChild.scrollHeight;
1192
1193                                configEvents( windowPopUp[_win_name] ,'onbeforeunload', function()
1194                                {
1195                                        delete windowPopUp[_win_name];
1196                                        divPOP.style.background = "url('"+path_jabberit+"templates/default/images/icon_up.png') no-repeat";
1197                                        divPOP.innerHTML = "PopUp";
1198                                        divPOP.onclick  = function(){ loadscript.windowPOPUP( _id , true ); };
1199                                        _winBuild( 'window_chat_area_' + _id, "display" ).content( true );
1200                                });
1201
1202                                _winBuild( 'window_chat_area_' + _id, 'hidden' );
1203                        }
1204                }
1205        }
1206       
1207        function windowNotificationNewUsers()
1208        {
1209                var _users = Xtools.xml('notification_new_users');
1210               
1211                for( var user in TrophyIM.rosterObj.roster )
1212                {
1213                        if ( TrophyIM.rosterObj.roster[ user ].constructor == Function )
1214                                continue;
1215
1216                        if( TrophyIM.rosterObj.roster[ user ].contact.jid != Base64.decode( loadscript.getUserCurrent().jid) )
1217                        {
1218                                var _subscription = TrophyIM.rosterObj.roster[user].contact.subscription;
1219                               
1220                                if ( _subscription == 'to' || _subscription == 'not-in-roster' )
1221                                {
1222                                        var _user       = _users.createElement('user');
1223                                        var _jid        = _users.createElement('jid');
1224                                        var _status     = _users.createElement('status');
1225                                        _jid.appendChild( _users.createTextNode(TrophyIM.rosterObj.roster[user].contact.jid) );
1226                                        _status.appendChild( _users.createTextNode( _subscription ) );
1227                                        _user.appendChild( _jid );
1228                                        _user.appendChild( _status );
1229                                        _users.documentElement.appendChild( _user );
1230                                }
1231                        }
1232                }
1233               
1234                var paramsNotification =
1235                {
1236                        'lang_1' : "Notificação",       
1237                        'lang_2' : "O(s) usuário(s) abaixo pedem sua autorização.",
1238                        'lang_3' : "Autorizar",
1239                        'lang_4' : "Remover"
1240                };
1241               
1242                var winNotification =
1243                {       
1244                         id_window              : "window_notification_new_users",
1245                         width                  : 400,
1246                         height                 : 300,
1247                         top                    : 100,
1248                         left                   : 400,
1249                         draggable              : true,
1250                         visible                : "display",
1251                         resizable              : true,
1252                         zindex                 : zIndex++,
1253                         title                  : "Expresso Messenger - Notificação de Novos Usuários",
1254                         closeAction    : "remove",
1255                         content                : Xtools.parse( _users , "notificationNewUsers.xsl", paramsNotification )       
1256                };
1257
1258                _winBuild( winNotification );
1259        }
1260
1261        function loadIM()
1262        {
1263                if( arguments.length > 0 )
1264                {
1265                        var files = [
1266                                                path_jabberit + 'js/connector.js',
1267                                                path_jabberit + 'js/xtools.js',
1268                                                path_jabberit + 'js/lang/i18n_pt_Br.js',
1269                                                path_jabberit + 'js/dragdrop.js',
1270                                                path_jabberit + 'js/makeW.js',
1271                                                path_jabberit + 'js/show_hidden.js',
1272                                                path_jabberit + 'js/trophyim.js',
1273                                                //path_jabberit + 'js/strophe.min.js',
1274                                                path_jabberit + 'js/json2.js',
1275                                                path_jabberit + 'js/AddUser.js',
1276                                                path_jabberit + 'js/SelectEditable.js',
1277                                                path_jabberit + 'templates/default/css/button.css',
1278                                                path_jabberit + 'templates/default/css/common.css',
1279                                                path_jabberit + 'templates/default/css/selectEditableStyle.css',
1280                                                path_jabberit + 'templates/default/css/' + theme_jabberit
1281                                    ];
1282                        // FullName
1283                        fullName = arguments[0];
1284                       
1285                        // Preferences
1286                        _preferencesIM = arguments[1].split(";");
1287                       
1288                        if( !_preferencesIM[3] ) _preferencesIM[3] = "showContactsOfflineJabberit:true";
1289                       
1290                        loadScripts(files);
1291                       
1292                        setTimeout(function()
1293                        {
1294                                // Object Xtools       
1295                                if( Xtools == null )
1296                                        Xtools = new xtools(path_jabberit);
1297                               
1298                                // Object Conector
1299                                if( conn == null )
1300                                        conn = new AjaxConnector(path_jabberit);
1301                               
1302                                // Object Add User
1303                                if( addUser == null )
1304                                        addUser = new addUserIM(Xtools, conn);
1305
1306                               
1307                                // Object SelectEditable
1308                                if( selectEditable == null )
1309                                        selectEditable = new SelectEditable();
1310                                       
1311                                // Add Jabber in StatusBar;
1312                                addIcon();
1313
1314                                // Auto Connect
1315                                setTimeout(function()
1316                                {
1317                                        if( _preferencesIM[0] === 'openWindowJabberit:true' )
1318                                        {
1319                                                TrophyIM.load();
1320                                        }
1321                                       
1322                                },1500);
1323                               
1324                                // Auto Status
1325                                autoStatus();
1326                                configEvents( document, 'onmousemove', autoStatus );
1327                                configEvents( document, 'onkeypress', autoStatus );
1328                               
1329                        }, 2000);
1330                }
1331        }
1332       
1333        loadIM.prototype.adIcon                         = addIcon;
1334        loadIM.prototype.actionButton           = actionButton;
1335        loadIM.prototype.addContact                     = addContact;
1336        loadIM.prototype.clrAllContacts         = clrAllContacts;
1337        loadIM.prototype.configEvents           = configEvents;
1338        loadIM.prototype.disabledNotificationNewUsers   = disabledNotificationNewUsers;
1339        loadIM.prototype.enabledNotificationNewUsers    = enabledNotificationNewUsers; 
1340        loadIM.prototype.getIsIE                        = getIsIE;
1341        loadIM.prototype.getPhotoUser           = getPhotoUser;
1342        loadIM.prototype.getSmiles                      = getSmiles;
1343        loadIM.prototype.getStatusMessage       = getStatusMessage;
1344        loadIM.prototype.getShowContactsOffline = getShowContactsOffline;
1345        loadIM.prototype.getUserCurrent         = getUserCurrent;
1346        loadIM.prototype.getZIndex                      = getZindex;
1347        loadIM.prototype.groupsHidden           = groupsHidden;
1348        loadIM.prototype.groupsVisible          = groupsVisible;
1349        loadIM.prototype.keyPressSearch         = keyPressSearch;       
1350        loadIM.prototype.loginPage                      = loginPage;
1351        loadIM.prototype.notification           = notificationNewMessage;
1352        loadIM.prototype.parse                          = parse;
1353        loadIM.prototype.preferences            = preferences;
1354        loadIM.prototype.searchUser                     = searchUser
1355        loadIM.prototype.setAutorization        = setAutorization;
1356        loadIM.prototype.setMessageStatus       = setMessageStatus;
1357        loadIM.prototype.setPreferences         = setPreferences;
1358        loadIM.prototype.setPresence            = setPresence;
1359        loadIM.prototype.setStatusJabber        = setStatusJabber;
1360        loadIM.prototype.setSelectEditable      = setSelectEditable;
1361        loadIM.prototype.setUserCurrent         = setUserCurrent;
1362        loadIM.prototype.removeContact          = removeContact;
1363        loadIM.prototype.removeElement          = removeElement;
1364        loadIM.prototype.removeGroup            = removeGroup;
1365        loadIM.prototype.renameContact          = renameContact;
1366        loadIM.prototype.renameGroup            = renameGroup;
1367        loadIM.prototype.rosterDiv                      = rosterDiv;
1368        loadIM.prototype.windowNotificationNewUsers  = windowNotificationNewUsers;
1369        loadIM.prototype.windowPOPUP            = windowPOPUP;
1370       
1371       
1372        window.LoadIM = loadIM;
1373       
1374       
1375        // Necessário para não ocasionar problema no ExpressoMail
1376        // quando os itens abaixo não são criados pelo próprio ExpressoMail
1377        if( is_ie )
1378        {
1379                configEvents( window, 'onload', function( )
1380                {
1381                        if ( ! document.getElementById( 'cc_msg_err_serialize_data_unknown' ) )
1382                        {
1383                                var fix = document.createElement('input');
1384                                        fix.type        = 'hidden';
1385                                        fix.id          = 'cc_msg_err_serialize_data_unknown';
1386                               
1387                                        document.appendChild( fix );
1388                        }
1389                        if ( ! window.showMessage )
1390                                window.showMessage = function(){};
1391                });
1392        }
1393       
1394})();
Note: See TracBrowser for help on using the repository browser.