
window.onload = function(){
    popUp('popup1');
};



function popUp(id){
    var obj   = document.getElementById(id      );
    var child = document.getElementById(id+'_child');
    
    for(var i=0; i<child.childNodes.length; i++){
        var a = child.childNodes[i];
        
        if(a.tagName == 'A'){
            a.onmouseover = function(){ this.style.backgroundColor = '#999'; this.style.color = 'white'; };
            a.onmouseout  = function(){ this.style.backgroundColor = ''    ; this.style.color = '';      };
        }
    }
    
    /*************/
    // title
    obj.onmouseover = function(){ child.flg = true ; child.style.display = 'block'; }; // open
    obj.onmouseout  = function(){ child.flg = false; close();                       }; // close
    
    /*************/
    // child
    child.onmouseover = function(){ child.flg = true;           };
    child.onmouseout  = function(){ child.flg = false; close(); }; // close
    
    /*************/
    // close
    function close(){
        setTimeout(function(){
            if(child.flg == false) child.style.display = 'none';
        }, 100);
    }
}


