    var winW = 1024, winH = 768;

    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth;
      winH = window.innerHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
      winH = document.body.offsetHeight;
     }
    }
    
    //alert(winW);
    //alert(winH);


    function DelMenu(menuid) {    
        document.getElementById(menuid).style.border = "none";
        document.getElementById(menuid).style.display = "none";
    }    
    
    function ShowMenu(element, menuid) {    
        setTipsPosition(element, menuid);
        document.getElementById(menuid).style.display = "block";
        
    }
    function setTipsPosition(element, menuid) {    
        // 計算說明的X座標 
        var end = element.offsetWidth + 800;
        
        if(end > winW)
            end = winW -element.offsetWidth;
        
        var top = calculateOffset(element) + 25;    
        var popup = document.getElementById(menuid);    
        popup.style.border = "gray 3px double";    
        popup.style.left = end + "px";    
        popup.style.top = top + "px";}
        // 計算說明的Y座標
    function calculateOffset(field) {    
        var offset = 0;    
        while(field) {	
        offset += field.offsetTop;	
        field = field.offsetParent;    
        }    
    return offset;}