(function() { var path = "/jmessenger/"; var _xtools = null; var zIndex = 9001; function configEvents(pObj, pEvent, pHandler) { if ( typeof pObj == 'object' ) { if ( pEvent.substring(0, 2) == 'on' ) pEvent = pEvent.substring(2, pEvent.length); if ( pObj.addEventListener ) pObj.addEventListener(pEvent, pHandler, false); else if ( pObj.attachEvent ) pObj.attachEvent('on' + pEvent, pHandler); } } function TrophyIMChatArea() { /* var winImChatArea = { id_window : "window_chat_area", width : 490, height : 395, top : 100, left : 400, draggable : true, visible : "display", resizable : true, zindex : zIndex++, title : "Mensagens - Expresso Messenger", closeAction : "remove", content : '
' }; _winBuild( winImChatArea ); return '
'; */ } function TrophyIMChatBox() { var chatBox = '
' + '
' + '
' + '
' + '' + '' + '
' + '
'; return chatBox; } function TrophyIMChatTab() { var chatTab = '
' + '
' + '
X
' + '
' + '
'; return chatTab; } function TrophyIMLoggingDiv() { return '
'; } function TrophyIMLoginPage() { setXTools(); var winLoginPage = { id_window : "window_login_page", width : 260, height : 150, top : 100, left : 400, draggable : true, visible : "display", resizable : true, zindex : zIndex++, title : "Login - Expresso Messenger", closeAction : "remove", content : _xtools.parse(_xtools.xml("login_page"), "loginPage.xsl") }; _winBuild( winLoginPage ); } function TrophyIMRosterDiv() { setXTools(); var winRosterDiv = { id_window : "window_Roster_im", width : 250, height : 410, top : 50, left : 50, draggable : true, visible : "display", resizable : true, zindex : zIndex++, title : "Contatos - Expresso Messenger", closeAction : "hidden", content : _xtools.parse(_xtools.xml("contacts_list"),"contactsList.xsl") }; _winBuild( winRosterDiv ); } function TrophyIMRosterGroup() { return '
'; } function TrophyIMRosterItem() { var rosterItem = '
' + '
' + '
' + '
'; return rosterItem; } function TrophyIMStatusDiv() { var statusDiv = '
' + 'Status::::' + 'Select box' + '
' + '
' + '' + '
' + ''+ ''+ ''+ ''+ ''+ ''+ '
'; return statusDiv; } function HTMLSnippets( pType ) { return new ( function( ) { this.chatArea = TrophyIMChatArea; this.chatBox = TrophyIMChatBox; this.chatTab = TrophyIMChatTab; this.loggingDiv = TrophyIMLoggingDiv; this.loginPage = TrophyIMLoginPage; this.rosterDiv = TrophyIMRosterDiv; this.rosterGroup = TrophyIMRosterGroup; this.rosterItem = TrophyIMRosterItem; this.statusDiv = TrophyIMStatusDiv; } ); } function getZindex() { return zIndex++; } function parse() { if( arguments.length == 2 ) return _xtools.parse(_xtools.xml(arguments[0]), arguments[1] ); if( arguments.length === 3 ) return _xtools.parse(_xtools.xml(arguments[0]), arguments[1], arguments[2] ); } function loadScripts(pFiles) { //Load JavaScript var loadJavaScript = function(pJs) { var newScript = document.createElement("script"); newScript.setAttribute("type", "text/javascript"); newScript.setAttribute("src", pJs ); return newScript; }; //Load CSS var loadStyleSheet = function(pCss) { var newStyle = document.createElement("link"); newStyle.setAttribute("rel", "stylesheet"); newStyle.setAttribute("type", "text/css"); newStyle.setAttribute("href", pCss); return newStyle; }; for(var i = 0; i < pFiles.length; i++) { if( pFiles[i].indexOf(".js") > -1 ) document.getElementsByTagName("head")[0].appendChild(loadJavaScript(pFiles[i])); if( pFiles[i].indexOf(".css") > -1 ) document.getElementsByTagName("head")[0].appendChild(loadStyleSheet(pFiles[i])); } } function setPresence() { if( arguments.length > 0 ) { alert('Valor : ' + arguments[0]); } } function setXTools() { if( _xtools == null ) _xtools = new xtools(path); } function loadIM() { var files = [ 'js/xtools.js', 'js/dragdrop.js', 'js/makeW.js', 'js/show_hidden.js', 'css/trophyim.css', //'css/window_azul.css' //'css/window_cataratas.css' //'css/window_celepar.css' //'css/window_comics.css' //'css/window_default.css' //'css/window_escritorio.css' //'css/window_metropole.css' 'css/window_rochas.css' ]; loadScripts(files); } loadIM.prototype.configEvents = configEvents; loadIM.prototype.getZIndex = getZindex; loadIM.prototype.parse = parse; loadIM.prototype.setPresence = setPresence; loadIM.prototype.HTMLSnippets = new HTMLSnippets; window.loadIM = new loadIM; })();