<!--
    function getBrowserID()
    {
        // Decide browser version
        var isOp = (navigator.userAgent.toLowerCase().indexOf('opera 7.') > -1);
        var isNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
        var isNs6 = (document.getElementById) ? true : false;
        var isIe4 = (document.all) ? true : false;
        var isIe5 = false; 
        var isIe55 = false; // Added additional variable to identify IE5.5+

        if( isIe4) 
        {
            var versNum = parseFloat( navigator.userAgent.match(/MSIE (\d\.\d+)\.*/i)[1] );
            if( versNum >= 5 )
            {
                isIe5=true;
                isIe55 = ( versNum >= 5.5 && !isOp) ? true : false;
                if( isNs6 ) isNs6 = false;
            }
            if( isNs6 ) isIe4 = false;
        }

        if( isIe55 ) return "ie55";
        else if( isIe5 ) return "ie5";
        else if( isIe4 ) return "ie4";
        else if( isNs6 ) return "ns6";
        else if( isNs4 ) return "ns4";
        else if( isOp  ) return "opera";
    }

    
    function isNS()
    {
        var browserID = getBrowserID();
        return( browserID == "ns4" );
    }

    function isIE()
    {
        var browserID = getBrowserID();
        return( browserID == "ie55" || browserID == "ie5" || browserID == "ie4" );
    }

    function doLogout(userID, userType)
    {
        exitThis( "/login.htm" );
    }

    function emptyPage()
    {
        return "<HTML><BODY BGCOLOR='white'></BODY></HTML>";
    }

    /***
    * browser dependent write procedure:
    *   id - is ID of some SPAN or DIV
    *   nestref - is ID of parent SPAN or DIV (currently unused )
    *   text - HTML to fill this area with
    *   wnd - window name where to write (currently unused )
    */
    function layerWrite(id,nestref,text,wnd)
    {
        if( wnd == null ) wnd = "self";

        var targetDiv = null;
        if( document.all )
        {
            targetDiv = document.all[ id ];
            targetDiv.innerHTML = text;
        }
        else if( document.getElementById )
        {
            targetDiv = document.getElementById( id );
			if( targetDiv != null ) targetDiv.innerHTML = text;
        }
        else if( document.layers )
        {
			var newDiv;
			var w = 450, h=1000;

			// Netscape 4
			// NOTE: referenced SPAN or DIV must be referenced in STYLE cluster
            targetDiv = getLayerRef( id, document );
            targetDiv.document.write( text );
            targetDiv.document.close();
        }
    }

    /***
     * get reference to nested layer for ns4
     */
    function getLayerRef( lyr,doc ) 
    {
        if( document.layers )
        {
            var theLyr;
            for (var i=0; i < doc.layers.length; i++) 
            {
                theLyr = doc.layers[i];
                if (theLyr.name == lyr)
                {
                    return theLyr;
                }
                else if (theLyr.document.layers.length > 0) 
                {
                    // Recursive!
                    if( (theLyr = getLyrRef(lyr,theLyr.document)) != null )
                            return theLyr;
                }
          }
            return null;
      }
    }

    
    /***
    * checks if string is blank
    */
    function isBlank(s)
    {
        if( s == null ) return true;
        var ret = s.search("[^\s\n\t]");

        return( ret == -1 );
    }

    /***
    * checks if string is blank - using the password definition
    */
    function isBlankPassword(s)
    {
        if( s == null ) return true;

        // unlike the standard strings, a space in considered to be non-blank
        var ret = s.search("[^\n]");
        return( ret == -1 );
    }

    function isAlphaNumericChar( charCode )
    {
        // if the character is not a number, AND it's not an uppercase char, AND it's not a lowercase char, then return false
        if( ( charCode >= 48 && charCode <= 57 ) ||
            ( charCode >= 65 && charCode <= 90 ) || 
            ( charCode >= 97 && charCode <= 122 ) )
        {
            return true;
        }
        return false;
    }

    /***
    *   checks name (first,last,middle) and user Id for validity
    */
    function isValidName(s)
    {
        if( s == null ) return false;

        // Find any characters outside the allowed ranges
        // letters, numbers, space,apostrophe,dash,underscore,period,comma)
        var ret = s.search("[^A-Za-z0-9\x20\x27\x2D\x2E\x5F]");

        // if we find any, return false
        return( ret == -1 );
    }


    /***
    *   checks teacher note for printable characters
    */
    function isValidNotes(s)
    {
        if( s == null ) return false;

        // match any characters outside the range of x20 to x7E
        var ret = s.search("[^\x20-\x7E]");

        // if we find any, return false
        return( ret == -1 );
    }

    
    function isValidAssignmentName(s)
    {
        if( s == null ) return false;

        // Find any characters outside the allowed ranges
        // letters, numbers, space,apostrophe,dash,underscore,period,comma)
        var ret = s.search("[^A-Za-z0-9\x20\x27\x2C-\x2E\x5F\)\(/]");

        // if we find any, return false
        return( ret == -1 );
    }


    /***
    *   checks name (first,last,middle) and user Id for validity
    */
    function isValidTitle(s)
    {
        if( s == null ) return false;

        // Find any characters outside the allowed ranges
        // letters, numbers, space,apostrophe,dash,underscore,period,comma)
        var ret = s.search("[^A-Za-z0-9\x20\x27\x2C-\x2E\x5F]");

        // if we find any, return false
        return( ret == -1 );
    }


    /***
    *   checks password for validity
    */
    function isValidPassword(s)
    {
        if( s == null ) return false;

        // Find any invalid characters
        // < space, ", &, \, or > ~
        var ret = s.search("[\x00-\x1F\x22\x26\x5C\x7F-\xFF]");

        // if we find any, return false
        return( ret == -1 );
    }

    function showMsgInvalidName(s)
    {
        alert( s + " contains invalid characters\nPlease enter valid " + s);
    }

    function showPageTip( sFile )
    {
        open(sFile,"guide","height=450,width=640,resizable=yes,scrollbars=yes");
    }


    // -----------------------------------------------------------------------------------------------
    // URL Encoding and Decoding functions
    // -----------------------------------------------------------------------------------------------

    /***
    *   Encodes a string to url format
    */
    function urlEncode ( str )
    {
        var hexchars = "0123456789ABCDEF";
        var enc = "";

        for( var i = 0; i < str.length; i++ )
        {
            if( str.charAt(i) == ' ' )
            {
                enc += "+";
            }
            else if ( ( str.charAt(i) < '0' && str.charAt(i) != '-' && str.charAt(i) != '.') ||
                   (str.charAt(i) < 'A' && str.charAt(i) > '9') ||
                   (str.charAt(i) > 'Z' && str.charAt(i) < 'a' && str.charAt(i) != '_') ||
                   (str.charAt(i) > 'z'))
            {
                enc += "%";
                enc += hexchars.charAt( (str.charCodeAt(i) >> 4) );
                enc += hexchars.charAt( (str.charCodeAt(i) & 15) );
            }
            else
                enc += str.charAt(i);
        }
        return enc;
    }

    /***
    *   Convert a hex string to its int value
    */
    function axtoi( str )
    {
        var ch;
        var n = 0;

        for( var i = 0; i < str.length; i++ )
        {
            ch = str.charAt(i);
            if ( ch >= '0' && ch <= '9' )
                ch = ch.charCodeAt(0) - 48;
            else if ( ch >= 'a' && ch <= 'f' )
                ch = ch.charCodeAt(0) + 10 - 65;
            else if ( ch >= 'A' && ch <= 'F' )
                ch = ch.charCodeAt(0) + 10 - 65;
            else
                ch = 0;
            n = 16 * n + ch;
        }
        return n;
    }

    
    /***
    *   Test if the char is a hex
    */
    function isxdigit( x )
    {
        return (x >= 'A' && x <= 'F' || x >= 'a' && x <= 'f' || x >= '0' && x <= '9');
    }


    /***
    *   Decodes a url formated string to plain text
    */
    function urlDecode( str )
    {
        var dec = "";

        for( var i = 0; i < str.length; i++ )
        {
            if( str.charAt(i) == '+' )
            {
                dec += " ";
            }
            else if ( str.charAt(i) == '%' && i <= (str.length-2) && isxdigit( str.charAt(i+1) ) && isxdigit( str.charAt(i+2) ) )
            {
                dec += String.fromCharCode( axtoi( (str.charAt(i+1) + str.charAt(i+2)) ) );
                i += 2;
            }
            else
                dec += str.charAt(i);
        }
        return dec;
    }

    // -----------------------------------------------------------------------------------------------
    /***
    *   Method exists solely to handle the dispatch of tip requests - this allows logging of requests
    */
    function showHelpTip(sURL)
    {
        showPageTip(sURL);
    }


    // -----------------------------------------------------------------------------------------------
    /***
    *   Method exists solely to handle the dispatch of logging out calls
    */
    function exitThis(sURL)
    {
        location = sURL;
    }


    // -----------------------------------------------------------------------------------------------
    /***
    *   Method exists solely to display the error message for a too-long parameter
    */
    function alertTooLong(parameter)
    {
        var strAlertMessage = "Please choose a shorter " + parameter + ".";
        alert(strAlertMessage);
    }



// ---------------------------------------------------------------------------------------------------
//  DEPRECATED FUNCTIONS
// ---------------------------------------------------------------------------------------------------

    /***
    *   Footer frame as string (for specifying as "SRC" for "footerFrame")
    */
    function getFooterFrame()
    {
        return  "<HEAD><META HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=iso-8859-1'>" +
                "<LINK REL=StyleSheet HREF='/common/footer.css' TYPE='text/css' MEDIA=screen></HEAD>" +
                "<BODY BACKGROUND='/images/footer.gif'><SPAN ID='tipSpan'>" +
                getFooterFont() + "Please wait..." + getFooterClose() + "</SPAN></BODY>";
    }

    /***
    *   Header frame as string (for specifying as "SRC" for "headerFrame")
    */
    function getHeaderFrame( sMsg )
    {
        return  "<!DOCTYPE HTML PUBLIC '-//w3c//dtd html 4.0 transitional//en'><HTML>" +
                "<HEAD><META HTTP-EQUIV='Content-Type' CONTENT='text/html; CHARSET=iso-8859-1'>" +
                "<LINK REL=StyleSheet HREF='/common/header.css' TYPE='text/css' MEDIA=screen></HEAD>" +
                "<BODY BACKGROUND='/images/header.gif'><SPAN ID='InfoSpan'>" +
                getHeaderFont() + sMsg + getHeaderClose() + "</SPAN></BODY></HTML>";
    }

    // -----------------------------------------------------------------------------------------------
    /***
    *   check whether footer initialized (deprecated)
    */
    function checkFooter()
    {
        return true;
    }


    function getMainFont()
    {
        return "<FONT FACE='verdana, arial, helvetica' SIZE='2'>";
    }

    function getFooterFont()
    {
        var ret;
        if(isNS())
        {
            ret="<SPAN class='FooterTextDynamicFont'>";
        }
        else
        {
            ret="";
        }
        
        return ret;
    }

    function getHeaderFont()
    {
        var ret;
        if(isNS())
        {
            ret="<SPAN class='HeaderTextFont'>";
        }
        else
        {
            ret="";
        }
        
        return ret;
    }

    function getFooterClose()
    {
        var ret;

        if(isNS())
        {
            ret="</SPAN>"
        }
        else
        {
            ret="";
        }
        
        return ret;
    }
    
    function getHeaderClose()
    {
        var ret;

        if(isNS())
        {
            ret="</SPAN>"
        }
        else
        {
            ret="";
        }
        
        return ret;
    }

    function clearFooter( wnd )
    {
        layerWrite("tipSpan",null,"");
    }

    function showFooterTip( s, wnd )
    {
        if(arguments.length==1)
           layerWrite("tipSpan",null,getFooterFont() + s + getFooterClose() );
        else
           layerWrite("tipSpan",null,getFooterFont() + s + getFooterClose() );
    }

    function showHeaderTip( s )
    {
        layerWrite("InfoSpan",null,getHeaderFont() + "<B>" + s + "</B>" + getHeaderClose());
    }

    /***
    *   Function to be called as "onResize" event handler to fix NS resize problem
    *   all frames must follow generic conventions to take effect.
    */
    function doResize()
    {
        /*
        if( isNS() )
        {
            location.reload();
        }
        */
    }
//-->