OSDN Git Service

client is version0.4.21, brush up around boot application.
[pettanr/pettanr.git] / public / assets / system.js
index 698180e..7710a75 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.4.19
+ *   version 0.4.21
  *   
  * author:
  *   itozyun
@@ -101,6 +101,18 @@ pettanr.file = ( function(){
                        TREE_ARRAY.push( _tree);
                        return _tree;
                },
+               getFileUID: function( FILEDATAorFILE ){
+                       if( FILEDATAorFILE instanceof FileClass ){
+                               return FILEDATAorFILE.getUID();
+                       }
+                       
+                       var uid = pettanr.util.getIndex( FILEDATA_RESITER, FILEDATAorFILE );
+                       if( uid === -1){
+                               uid = FILEDATA_RESITER.length;
+                               FILEDATA_RESITER.push( FILEDATAorFILE );
+                       }
+                       return uid;
+               },
                getFileDataAccess: function( UIDorFILEorFILEDATA){
                        var _uid, _data, _access;
                        
@@ -120,7 +132,7 @@ pettanr.file = ( function(){
                                if( _access.DATA === _data) return _access;
                        }
                        return null;
-               },              
+               },      
                getFileData: function( UIDorFILEorFILEDATA){
                        var _access = FILE_CONTROLER.getFileDataAccess( UIDorFILEorFILEDATA);
                        return _access !== null ? _access.DATA : null;
@@ -318,27 +330,24 @@ pettanr.file = ( function(){
  * fileの変更、それに付随して追加されたイベントは、TreeClassで管理される。
  * treeがdestryされると、fileのイベントリスナーも全て削除される。
  * 他の tree も data の共通する currentFile に対してのみは、file の変更イベントを受け取って流す.
+ * 
+ * parentData のほうがいい!
  */
        
-       var FileClass = function( tree, parentFile, data ){
-               var uid = pettanr.util.getIndex( FILEDATA_RESITER, data ),
+       var FileClass = function( tree, parentData, data ){
+               var uid = FILE_CONTROLER.getFileUID( data ),
                        instance = this;
                
-               if( uid === -1){
-                       uid = FILEDATA_RESITER.length;
-                       FILEDATA_RESITER.push( data );
-               }
-               
                FILEDATA_ACCESS.push(
                        {
                                TREE:                           tree,
-                               parentFile:                     parentFile,
+                               parentData:                     parentData,
                                DATA:                           data,
                                dispatchFileEvent:      dispatchEvent
                        }
                );
                
-               tree = parentFile = data = null;
+               tree = parentData = data = null;
                
                function dispatchEvent( e ){
                        FILE_CONTROLER.fileEventRellay( uid, e );
@@ -379,6 +388,14 @@ pettanr.file = ( function(){
                        }
                        return -1;
                },
+               getChildFileByIndex: function( _index ){
+                       var _access = FILE_CONTROLER.getFileDataAccess( this ),
+                               _children = FILE_CONTROLER.getChildren( this );
+                       if( typeof _index !== 'number' || _index < 0 || Type.isArray( _children ) === false || _index >= _children.length) return null;
+                       var _file = new FileClass( _access.TREE, _access.DATA, _children[ _index ]);
+                       // _file.init();
+                       return _file;
+               },
                getName: function(){
                        var driver = FILE_CONTROLER.getDriver( this );
                        if( typeof driver.getName === 'function'){
@@ -464,21 +481,13 @@ pettanr.file = ( function(){
                onDelete: function(){
                        
                },
-               getChildFileByIndex: function( _index ){
-                       var _access = FILE_CONTROLER.getFileDataAccess( this ),
-                               _children = FILE_CONTROLER.getChildren( this );
-                       if( typeof _index !== 'number' || _index < 0 || Type.isArray( _children ) === false || _index >= _children.length) return null;
-                       var _file = new FileClass( _access.TREE, this, _children[ _index ]);
-                       // _file.init();
-                       return _file;
-               },
                move: function( _newFolder, _newIndex, opt_callback ){
                        var _access = FILE_CONTROLER.getFileDataAccess( this );
-                       _access.TREE.move( _access.parentFile, this.getUID(), _newFolder, _newIndex, opt_callback );
+                       _access.TREE.move( _access.parentData, this.getUID(), _newFolder, _newIndex, opt_callback );
                },
                replace: function( _newIndex, opt_callback ){
                        var _access = FILE_CONTROLER.getFileDataAccess( this );
-                       _access.TREE.replace( _access.parentFile, this.getUID(), _newIndex, opt_callback);
+                       _access.TREE.replace( _access.parentData, this.getUID(), _newIndex, opt_callback);
                },
                /**
                 * サーチ
@@ -517,7 +526,7 @@ pettanr.file = ( function(){
                        FILEDATA_ACCESS.splice( _index, 1 );
                        delete _access.DATA;
                        delete _access.TREE;
-                       delete _access.parentFile;
+                       delete _access.parentData;
                        delete _access.dispatchFileEvent;
                }
        }
@@ -797,18 +806,22 @@ pettanr.finder = ( function(){
                ELM_WRAPPER.onclick = onDownClick;
                function onDownClick(){
                        onDownCallback( index);
+                       return false;
                }
                ELM_EDITOR_BUTTON.onclick = onEditorClick;
                function onEditorClick(){
                        onEditorCallback( file, editorList[ 0 ] );
+                       return false;
                }
                ELM_VIEWER_BUTTON.onclick = onViwerClick;
                function onViwerClick(){
                        onViewerCallback( file, viewerList[ 0 ] );
+                       return false;
                }
                ELM_ACTION_BUTTON.onclick = onActionClick;
                function onActionClick(){
                        onActionCallback( file );
+                       return false;
                }
                function draw(){
                        var _thumb = file.getThumbnail();
@@ -878,7 +891,7 @@ pettanr.finder = ( function(){
                                
                        },
                        destroy: function(){
-                               elmContainer.removeChild( ELM_WRAPPER);
+                               elmContainer.removeChild( ELM_WRAPPER );
                                file && file.destroy();
                                file = elmContainer = onDownCallback = onEditorCallback = onViewerCallback = onActionCallback = viewerList = editorList = null;
                                FINDER_ICON_POOL.push( instansce);
@@ -964,7 +977,8 @@ pettanr.finder = ( function(){
                        w, h, bodyH,
                        instance = this;
                        
-               tree.addTreeEventListener( pettanr.file.TREE_EVENT.UPDATE, draw);
+               tree.addTreeEventListener( pettanr.file.TREE_EVENT.UPDATE, draw );
+               ELM_CONTAINER.appendChild( elmContainer );
                
                function draw( _w, _h ){
                        w = Type.isFinite( _w ) === true ? _w : w;
@@ -1000,12 +1014,7 @@ pettanr.finder = ( function(){
                        } else {
                                elmBody.className = 'finder-body';
                        }
-                       try {
-                               elmBody.style.height = bodyH + 'px';
-                       } catch(e){
-                               alert( bodyH)
-                       }
-                       
+                       elmBody.style.height = bodyH + 'px';
                        
                        while( l < ICON_ARRAY.length){
                                ICON_ARRAY.pop().destroy();
@@ -1035,7 +1044,7 @@ pettanr.finder = ( function(){
                        _app.boot( _file );
                }
                function onViwer( _file, _app ){
-                       _app.boot( _file );
+                       _app.bootInOverlay( _file );
                }
                function onAction( _file ){
 
@@ -1049,20 +1058,16 @@ pettanr.finder = ( function(){
                this.init = function(){
                        //$( elmLocation).click( onHeadClick);
                        //$( elmContainer).click( onBodyClick);
-                       var position = pettanr.util.getAbsolutePosition( elmLocation);
+                       var position = pettanr.util.getAbsolutePosition( elmLocation );
                        headX = position.x;
                        headY = position.y;
                        bodyY = pettanr.util.getAbsolutePosition( elmBody ).y;
                        delete instance.init;
                }
-               this.onOpen = function( _w, _h, _option ){
-                       instance.init && instance.init();
-                       draw( _w, _h );
-               }
-               this.onClose = function(){
-                       return true;
-               }
                this.onPaneResize = function( _w, _h ){
+                       instance.init && instance.init();
+                       draw( _w, _h );                 
+                       
                        w = _w;
                        h = _h;
                        elmBody.style.height = ( _h - headH ) + 'px';
@@ -1100,7 +1105,9 @@ pettanr.finder = ( function(){
                init: function(){
                        
                },
-               createFinder: function( _elmTarget, _tree, _header, _footer ){
+               createFinder: function( _applicationReference, _elmTarget, _tree, _header, _footer ){
+                       if( pettanr.view.isApplicationReference( _applicationReference ) === false ) return;
+                       
                        var _finder = new FinderClass( _elmTarget, _tree, _header, _footer );
                        FINDER_ARRAY.push( _finder );
                        return _finder;
@@ -1234,6 +1241,13 @@ pettanr.driver = ( function(){
                        viewerApplicationList: function( _file ){
                                var _data = FileAPI.getFileData( _file ),
                                        _type = _data !== null ? _data.type : null;
+                                       
+                               if( _data === FILE_DATA_MY_PICTURES_ROOT ){
+                                       return [ pettanr.premiumSatge ];
+                               }
+                               if( _type === pettanr.driver.FILE_TYPE.ARTIST ){
+                                       return [ pettanr.premiumSatge ];
+                               }
                                return [];
                        },
                        editorApplicationList: function( _file ){
@@ -1279,7 +1293,8 @@ pettanr.driver = ( function(){
                        name:           'My Comics',
                        type:           pettanr.file.FILE_TYPE.FOLDER,
                        children:       [],
-                       driver:         Driver
+                       driver:         Driver,
+                       id:                     MyAuthorID
                },
                FILE_DATA_LATEST_COMICS = {
                        name:           'Latest Comics',
@@ -1291,7 +1306,8 @@ pettanr.driver = ( function(){
                        type:           pettanr.file.FILE_TYPE.FOLDER,
                        children:       [],
                        driver:         Driver,
-                       json:           pettanr.CONST.URL_ORIGINAL_PICTURES_JSON
+                       json:           pettanr.CONST.URL_ORIGINAL_PICTURES_JSON,
+                       id:                     MyArtistID
                },
                FILE_DATA_AUTHOR_ROOT = {
                        name:           'Authors',
@@ -1491,7 +1507,11 @@ pettanr.driver = ( function(){
                        if( _artist){
                                _data.artist = _artist = buildFileData( _artist, FILE_DATA_ARTIST_ROOT );
                                addChildData( _artist, _data );
-                               _artist.id === MyArtistID && addChildData( FILE_DATA_MY_PICTURES_ROOT, _data );
+                               if( _artist.id === MyArtistID ){
+                                       addChildData( FILE_DATA_MY_PICTURES_ROOT, _data );
+                                       //FILE_DATA_MY_PICTURES_ROOT.type = pettanr.driver.FILE_TYPE.ARTIST;
+                                       //FILE_DATA_MY_PICTURES_ROOT.id = MyArtistID;
+                               }
                        }
                }
                return _data;
@@ -1534,6 +1554,9 @@ pettanr.driver = ( function(){
                _getAPI: function(){
                        return FileAPI;
                },
+               _getMyPicturesData: function(){
+                       return FILE_DATA_MY_PICTURES_ROOT;
+               },
                FILE_TYPE: {
                        COMIC:                          FileAPI.createFileTypeID(),
                        PANEL:                          FileAPI.createFileTypeID(),
@@ -1573,12 +1596,12 @@ pettanr.cabinet = pettanr.view.registerApplication( function(){
        this.displayName = 'Comic list';
        this.ID          = 'Comiclist';
        this.rootElement = elmContainer;
-       this.onOpen = function( _w, _h, _option ){
-               finder = finder || pettanr.finder.createFinder( elmContainer, pettanr.driver.createComicTree() );
-               finder.open( _w, _h - pageHeaderH, _option );
+       this.onOpen = function( _w, _h ){
+               finder = finder || pettanr.finder.createFinder( pettanr.cabinet, elmContainer, pettanr.driver.createComicTree() );
+               finder.resize( _w, _h - pageHeaderH );
        }
        this.onClose = function(){
-               finder.close();
+               // finder.close();
        }
        this.onPaneResize = function( _w, _h){
                finder.resize( _w, _h - pageHeaderH );
@@ -1595,14 +1618,14 @@ pettanr.gallery = pettanr.view.registerApplication( function(){
        this.displayName = 'Pictures';
        this.ID          = 'pictures';
        this.rootElement = elmContainer;
-       this.onOpen = function( _w, _h, _option ){
-               finder = finder || pettanr.finder.createFinder( elmContainer, pettanr.driver.createPictureTree() );
-               finder.open( _w, _h - pageHeaderH, _option );
+       this.onOpen = function( _w, _h ){
+               finder = finder || pettanr.finder.createFinder( pettanr.gallery, elmContainer, pettanr.driver.createPictureTree() );
+               finder.resize( _w, _h - pageHeaderH );
        }
        this.onClose = function(){
-               finder.close();
+               // finder.close();
        }
-       this.onWindowResize = function( _w, _h){
+       this.onPaneResize = function( _w, _h){
                finder.resize( _w, _h - pageHeaderH );
        }
 });
@@ -1616,7 +1639,7 @@ pettanr.backyard = pettanr.view.registerApplication( function(){
        }
        this.onClose = function(){
        }
-       this.onWindowResize = function( _w, _h){
+       this.onPaneResize = function( _w, _h){
        }
 });
 pettanr.backyard.addToLancher();
@@ -1694,29 +1717,49 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                ARTIST_ROOT_FILE = ARTIST_TREE.getRootFile(),
                instance = this,
                winW, winH,
-               containerW, containerH, wrapX,
-               jqWrap, jqContainer, jqItemOrigin,
-               itemW, itemH,
-               jqName, jqButton, buttonW,
+               wrapX,
+               elmWrap = document.getElementById( 'image-gruop-wrapper' ),
+               elmContainer = document.getElementById( 'image-icon-container' ),
+               containerW,
+               containerH = pettanr.util.getElementSize( elmContainer ).height,                
+               elmIconOrigin = ( function(){
+                       var ret = document.createElement( 'div' ),
+                               data = document.createElement( 'div' );
+                       ret.appendChild( data );
+                       ret.className = 'image-gruop-item';
+                       data.className = 'image-gruop-item-title';
+                       return ret;
+               })(),
+               jqContainer,
+               size = pettanr.util.getElementSize( elmIconOrigin ),
+               itemW = size.width,
+               itemH = size.height,
+               elmName = document.getElementById( 'gruop-name-display' ),
+               elmButton = document.getElementById( 'image-gruop-button' ),
+               buttonW = pettanr.util.getElementSize( elmButton ).width,
                //onUpdateFunction,
                _g_onUpdateFunction,
                onEnterInterval = null;
+
+       elmButton.onclick = clickOK;
        
        var BASE_PATH = pettanr.LOCAL === true ? 'resource_pictures\/' : pettanr.CONST.PETTANR_ROOT_PATH + 'resource_pictures\/',
                THUMB_PATH = BASE_PATH, // + 'thumbnail/',
                LIMIT_FILESIZE = 1024 * 10; // 10KB
 
        var ImageGroupIconClass = function( INDEX, file ){
-               var JQ_ICON_WRAP = jqItemOrigin.clone( true),
+               var elmIconWrap = elmIconOrigin.cloneNode( true ),
+                       elmIconTitle = pettanr.util.getElementsByClassName( elmIconWrap, 'image-gruop-item-title' )[ 0 ],
                        data = pettanr.driver._getAPI().getFileData( file ),
                        SRC = [ BASE_PATH, data.id, '.', data.ext ].join( ''),
                        LOW_SRC = data.filesize && data.filesize > LIMIT_FILESIZE ? [ THUMB_PATH, data.id, '.', data.ext ].join( '') : null,
                        reversibleImage = null,
                        onEnterFlag = false,
                        imgW, imgH;
-               JQ_ICON_WRAP.children( 'div').eq( 0 ).html( data.filesize + 'bytes' );
-               jqContainer.append( JQ_ICON_WRAP.css( { left: INDEX * itemW}));
-               
+               elmContainer.appendChild( elmIconWrap );
+               elmIconWrap.style.left = ( INDEX * itemW ) + 'px';
+               elmIconTitle.appendChild( document.createTextNode( data.filesize + 'bytes' ));
+
                function onImageLoad( url, _imgW, _imgH ){
                        if( reversibleImage === null) {
                                alert( url);
@@ -1724,15 +1767,18 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                        }
                        data.width = imgW = _imgW || data.width || 64;
                        data.height = imgH = _imgH || data.height || 64;
-                       JQ_ICON_WRAP.children( 'div').eq( 1).html( imgW +'x' +imgH);
+                       elmIconTitle.firstChild.data = imgW + 'x' + imgH;
                        var zoom = 128 /( imgW > imgH ? imgW : imgH),
-                               h = Math.floor( imgH *zoom ),
-                               w = Math.floor( imgW *zoom );
-                       reversibleImage.elm.style.width = w +'px';
-                       reversibleImage.elm.style.height = h +'px';
-                       reversibleImage.elm.style.margin = Math.floor( itemH /2 -h /2)+'px 0 0';
-                       reversibleImage.resize( w, h);
-                       JQ_ICON_WRAP.click( onClick );
+                               MATH_FLOOR = Math.floor
+                               h = MATH_FLOOR( imgH *zoom ),
+                               w = MATH_FLOOR( imgW *zoom );
+                       reversibleImage.elm.style.cssText = [
+                               'width:', w, 'px;',
+                               'height:', h +'px;',
+                               'margin:', MATH_FLOOR( itemH /2 -h /2 ), 'px ', MATH_FLOOR( itemW /2 -w /2 ), 'px 0'
+                       ].join('');
+                       reversibleImage.resize( w, h );
+                       elmIconWrap.onclick = onClick;
                }
                
                function onClick( e ){
@@ -1764,14 +1810,15 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                this.onEnter = function(){
                        if( onEnterFlag === true ) return;
                        reversibleImage = pettanr.image.createReversibleImage( LOW_SRC || SRC, itemW, itemH, onImageLoad );
-                       JQ_ICON_WRAP.children( 'img' ).replaceWith( reversibleImage.elm );
-                       onEnterFlag = true;                                             
+                       elmIconWrap.appendChild( reversibleImage.elm );
+                       onEnterFlag = true;
                }
                this.destroy = function(){
                        reversibleImage && reversibleImage.destroy();
-                       JQ_ICON_WRAP.remove();
+                       pettanr.util.removeAllChildren( elmIconWrap );
+                       elmContainer.removeChild( elmIconWrap );
                        file.destroy();
-                       reversibleImage = JQ_ICON_WRAP = data = null;
+                       reversibleImage = elmIconWrap = elmIconTitle = data = file = null;
                        delete this.destroy;
                }
        }
@@ -1806,28 +1853,30 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
        // this.rootElement = elmWrap;
        this.displayName = 'premiumStage';
        this.ID          = 'premiumStage';
-       this.rootElement = document.getElementById( 'image-gruop-wrapper' );
+       this.rootElement = elmWrap;
        this.MIN_WIDTH   = 320;
        this.MIN_HEIGHT  = 320;
        this.init = function(){
-               instance.jqWrap = jqWrap = $( '#image-gruop-wrapper').hide();
-               jqContainer = $( '#image-icon-container').mousewheel( onMouseWheel);
-               containerH = pettanr.util.getElementSize( jqContainer.get( 0)).height;
-               jqItemOrigin = $( $( '#imageGruopItemTemplete').remove().html());
-               var itemSize = pettanr.util.getElementSize( jqItemOrigin.get( 0));
-               itemW = itemSize.width;
-               itemH = itemSize.height;
-               jqName = $( '#gruop-name-display');
-               jqButton = $( '#image-gruop-button').click( clickOK);
-               buttonW = pettanr.util.getElementSize( jqButton.get( 0)).width;
-               
+               jqContainer = $( elmContainer ).mousewheel( onMouseWheel );
                delete instance.init;
        }
-       this.jqWrap = null;
-       this.onOpen = function( _windowW, _windowH, _artistID, _onUpdateFunction ){
+       this.onOpen = function( _windowW, _windowH, _ARTISTIDorFILE, _onUpdateFunction ){
                instance.init && instance.init();
+               
+               var _data, _artistID = -1;
+               
+               if( pettanr.driver.isPettanrFileInstance( _ARTISTIDorFILE ) === true ){
+                       _data = pettanr.driver._getAPI().getFileData( _ARTISTIDorFILE );
+                       if( _ARTISTIDorFILE.getType() === pettanr.driver.FILE_TYPE.ARTIST || pettanr.driver._getMyPicturesData() === _data ){
+                               _artistID = _data.id || -1;
+                       }
+               } else
+               if( Type.isNumber( _ARTISTIDorFILE ) === true ){
+                       _artistID = _ARTISTIDorFILE;
+               }
+               
                //onUpdateFunction = _onUpdateFunction;
-               if( _onUpdateFunction){
+               if( _onUpdateFunction ){
                        _g_onUpdateFunction = pettanr.util.createGlobalFunction( _onUpdateFunction);
                } else {
                        _g_onUpdateFunction = null;
@@ -1842,39 +1891,43 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                if( _artistFile !== null ){
                        for( i=0, l=_artistFile.getChildFileLength(); i<l; ++i ){
                                ICON_ARRAY.push( new ImageGroupIconClass( i, _artistFile.getChildFileByIndex( i ) ));
-                       }                       
+                       }
+                       elmName.firstChild.data = _artistFile.getName() + l;
+                       _artistFile.destroy();
                }
-
+               
                wrapX = 0;
                containerW = l * itemW;
                
                winW = _windowW;
                winH = _windowH;
                var w = winW > containerW ? winW : containerW,
-                       h = _windowH > containerH ? containerH : _windowH;
+                       h = _windowH > containerH ? containerH : _windowH,
+                       MATH_FLOOR = Math.floor;
+               
+               onEnterShowImage();
                
-               jqWrap.show();
                jqContainer.css( {
                        width:          w,
                        height:         0,
                        left:           0,
-                       top:            Math.floor( _windowH /2)
+                       top:            MATH_FLOOR( _windowH /2)
                }).stop().animate( {
                        height:         h,
-                       top:            Math.floor( _windowH /2 -h /2)
+                       top:            MATH_FLOOR( _windowH /2 -h /2)
                });
                
-               jqButton.css( {
-                       left:           Math.floor( winW /2 - buttonW /2),
-                       top:            Math.floor( _windowH /2 + containerH /2 +10)
-               });
-               
-               onEnterShowImage();
+               elmButton.style.cssText = [
+                       'left:', MATH_FLOOR( winW /2 - buttonW /2), 'px;',
+                       'top:', MATH_FLOOR( _windowH /2 + containerH /2 +10), 'px'
+               ].join('');
        }
        this.onPaneResize = function( _windowW, _windowH ){
                var w = _windowW > containerW ? _windowW : containerW,
                        h = _windowH > containerH ? containerH : _windowH,
-                       offsetW = Math.floor( _windowW /2 -winW /2);
+                       MATH_FLOOR = Math.floor,
+                       offsetW = MATH_FLOOR( _windowW /2 -winW /2);
+                       
                winW = _windowW;
                winH = _windowH;
                if( offsetW <= 0){ // smaller
@@ -1883,7 +1936,7 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                                width:                          w
                        }).animate( {
                                left:                           0,
-                               top:                            Math.floor( _windowH /2 -h /2)
+                               top:                            MATH_FLOOR( _windowH /2 -h /2)
                        });                                     
                } else {
                        jqContainer.css( { // bigger
@@ -1891,22 +1944,20 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
                                width:                          w,
                                borderLeftWidth:        offsetW
                        }).animate( {
-                               top:                            Math.floor( _windowH /2 -h /2),
+                               top:                            MATH_FLOOR( _windowH /2 -h /2),
                                borderLeftWidth:        0
                        });
                }
-               jqButton.css( {
-                       left:           Math.floor( _windowW /2 -buttonW /2),
-                       top:            Math.floor( _windowH /2 +containerH /2 +10)
-               });
+               elmButton.style.cssText = [
+                       'left:', MATH_FLOOR( _windowW /2 -buttonW /2), 'px;',
+                       'top:', MATH_FLOOR( _windowH /2 +containerH /2 +10), 'px'
+               ].join('');
                onEnterShowImage();
        }
        this.onClose = function(){
                jqContainer.stop().animate( {
                                height: 0,
                                top:    Math.floor( winH /2 )
-                       }, function(){
-                               jqWrap.hide();
                        });
                while( ICON_ARRAY.length > 0 ){
                        ICON_ARRAY.shift().destroy();