(function() { var Xtools = null; var dragDrop = null; var path = path_jabberit; function build(pObj) { var _window = document.getElementById( pObj.id_window + '__parent'); Xtools = new JITXtools(path); if( _window == null ) { pObj.width = ( ( pObj.width > 160 ) ? pObj.width : 160 ); pObj.height = ( ( pObj.height > 80 ) ? pObj.height : 80 ); pObj.onclick = "winBuild ('" + pObj.id_window + "', '" + pObj.closeAction + "')"; _window = document.createElement("div"); _window.id = pObj.id_window + "__parent"; _window.setAttribute("onselectstart" , "return false"); _window.style.width = pObj.width + "px"; _window.style.height = pObj.height + "px"; _window.style.top = pObj.top + "px"; _window.style.left = pObj.left + "px"; _window.style.position = "absolute"; _window.style.zIndex = pObj.zindex; _window.innerHTML = Xtools.parse( Xtools.xml('window_main'), 'window.xsl', pObj ); _window.style.visibility = 'visible'; document.body.appendChild( _window ); if( pObj.draggable ) { dragDrop = new dragdrop(); dragDrop.set( pObj.id_window ); } } else _load(pObj.id_window, "display"); } function _content( pId, pContent ) { var _contentWindow = function() { var _win_content = document.getElementById(pId + "__content"); _win_content.innerHTML = pContent; }; setTimeout( function(){ _contentWindow();}, 220 ); } function Load( pId, pVisible ) { var winM = document.getElementById( pId + '__parent'); if( winM != null ) { if ( pVisible == "display" ) { winM.style.left = "70px"; } if ( pVisible == "hidden") { winM.style.left = "-1500px"; } if( pVisible == "remove" ) document.body.removeChild( winM ); } } function _window() { var objectW = null; if( arguments.length == 1 ) { objectW = arguments[0]; JSLoader.load([path + "js/dragdrop.js"]); JSLoader.load([path + "templates/default/css/button.css"]) setTimeout( function(){ build(objectW); }, 200 ); } if( arguments.length == 2 ) Load(arguments[0], arguments[1]); if( arguments.length === 3 ) _content( arguments[0], arguments[1]); } window.bWindow = _window; })(); function winBuild() { if( arguments.length == 1 ) _win = new bWindow( arguments[0] ); if( arguments.length == 2 ) _win = new bWindow( arguments[0], arguments[1] ); if( arguments.length == 3 ) _win = new bWindow( arguments[0], arguments[1], arguments[2] ); }