    var gmyWin=null;
    var isFirefox;
    var isIE;

    /*------------------------------------------------------------*/
    function myOpenWindow(winURL, winName, winFeatures, winObj) {
    /*------------------------------------------------------------*/
        var theWin; // this will hold our opened window

        // first check to see if the window already exists
        if (winObj != null) {
            // the window has already been created, but did the user close it?
            // if so, then reopen it. Otherwise make it the active window.
            if (!winObj.closed) {
                winObj.focus();
                return winObj;
            }
        // otherwise fall through to the code below to re-open the window
        }
        // if we get here, then the window hasn't been created yet, or it
        // was closed by the user.
        theWin = window.open(winURL, winName, winFeatures);
        return theWin;
    }
    /*--------------------------------------------------------*/
    function openChat(n) {
    /*--------------------------------------------------------*/

        checkBrowserType();
        if( isFirefox ) {
            gmyWin=myOpenWindow("/chat/chat.php?a="+n,"myWin","width=730,height=431,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,resizable=yes",gmyWin);
        } else {
            gmyWin=myOpenWindow("/chat/chat.php?a="+n,"myWin","width=730,height=455,toolbar=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,resizable=yes",gmyWin);
        }
        gmyWin.location.visible = !gmyWin.location.visible;
//        alert(gmyWin.location.visible);
    }
    /*--------------------------------------------------------*/
    function checkBrowserType() {
    /*--------------------------------------------------------*/
        var ff = "Netscape";
        var ie = "Microsoft Internet Explorer";
        isFirefox = (navigator.appName == ff);
        isIE = (navigator.appName == ie); 
    }

