
   function browserName()
      {
         var fSlash = /\//g;
         var bSlash = /\\/g;

         var userAgent = navigator.userAgent.replace(fSlash, " ").replace(bSlash, " ");
         var appName   = window.navigator.appName;
    
         /////////////////////////////////////
         //Reg Exp test cases for browsers
         /////////////////////////////////////
         var bMSIE      = userAgent.match(/(MSIE)\s+(\d+\.\d+)/i);
         var bNetscape  = userAgent.match(/(Netscape\n*)\s+(\d+\.\d+)/i);
         var bNetscape6 = userAgent.match(/(Netscape6)\s+(\d+\.\d+)/i);
         var bNetscape7 = userAgent.match(/(Netscape7)\s+(\d+\.\d+)/i);
         var bCamino    = userAgent.match(/(Camino)\s+(\d+\.\d+)/i);
         var bOpera     = userAgent.match(/(Opera)/i);
         var bSafari    = userAgent.match(/(Safari)/i);
         var bKonqueror = userAgent.match(/(Konqueror)/i);
         var bLynx      = userAgent.match(/(Lynx)/i);
         var bFirefox   = userAgent.match(/(Firefox)/i);
         var bMozilla   = userAgent.match(/^(Mozilla)\s+(\d+\.\d+)/i);

        if (bMSIE) 
           {
              //alert("bMSIE: " + bMSIE[0]);
              //alert("bMSIE: " + bMSIE[1]);
              //alert("bMSIE: " + bMSIE[2]);

              bName = "Microsoft Internet Explorer";
              bVer  = bMSIE[2];
           }
        else if (bNetscape)
           {
              bName = bNetscape[1];
              bVer  = bNetscape[2];
           }
        else if (bNetscape6)
           {
              bName = bNetscape6[1];
              bVer  = bNetscape6[2];
           }
        else if (bNetscape7)
           {
              bName = bNetscape7[1];
              bVer  = bNetscape7[2];
           }
        else if (bCamino)
           {
              bName = bCamino[1];
              bVer  = bCamino[2];
           }
        else if (bOpera) 
           {
              bName = bOpera[1];
              bVer  = "";
           }
        else if (bSafari)
           {

              bName = bSafari[1];
              bVer  = ""; 
           }
        else if (bKonqueror)
           {
              bName = bKonqueror[1];
              bVer  = "";
           }
        else if (bLynx)
           {
              bName = bLynx[1];
              bVer  = "";
           }
        else if (bFirefox)
           {
              bName = bFirefox[1];
              bVer  = navigator.vendorSub; 
           }
        else if (bMozilla)
           {
              //alert("bMozilla: " + bMozilla[0]);
              //alert("bMozilla: " + bMozilla[1]);
              //alert("bMozilla: " + bMozilla[2]);

              var bMozillaVer = bMozilla[2].match(/^(5)/);

              if (appName == "Netscape" && bMozillaVer)
                 {
                    bName = "Mozilla";
                 }
              else
                 {
                    bName  = appName;
                 }

              bVer  = bMozilla[2];
           }

         /////////////////////////////////////
         //Reg Exp test cases for OS
         /////////////////////////////////////
         var oWin95 = userAgent.match(/(Win95|Windows\s+95)/i);
         var oWin98 = userAgent.match(/(Win98|Windows\s+98)/i);
         var oWinXP = userAgent.match(/(WinXP|Windows\s+XP)/i);
         var oWinNT = userAgent.match(/(WinNT|Windows\s+nt)/i);
         var oWin2k = userAgent.match(/(WinNT\s+5\n+|Windows\s+NT\s+5\n*)/i);
         var oLinux = userAgent.match(/(Linux)/i);
         var oAIX   = userAgent.match(/AIX/);
         var oSunOS = userAgent.match(/(SunOS)/i);
         var oMac   = userAgent.match(/(Macintosh|68k|68000|PowerPC)/i);
         var oMacX  = userAgent.match(/(Mac\s+OS\s+X)/i);

         if (oWin95) 
            {
               bOS = " (Windows 95)";
            }
         else if (oWin98) 
            {
               bOS = " (Windows 98)";
            }
         else if (oWinXP) 
            {
               bOS = " (Windows XP)";

            }
         else if (oWin2k) 
            {
               bOS = " (Windows 2000)";
            }
         else if (oWinNT) 
            {
               bOS = " (Windows NT)";
            }
         else if (oLinux) 
            {
               bOS = " (Linux)";
            }
         else if (oAIX)
            {
               bOS = " (AIX)";
            }
         else if (oMacX) 
            {
               bOS = " (Macintosh OS X)";
            }
         else if (oMac) 
            {
               bOS = " (" + oMac[1] + ")";
            } 
         else
            {
               bOS = "";
            }

         document.writeln('<font face="Arial,Helvetica,Sans Serif" size="2" color="blue">' + bName + ' ' + bVer + bOS + '</font>');
      }

   function browserTest()
      {	
         var browser  = "BROWSER INFORMATION:\n";
         var propname = "";

         for (propname in navigator)
            {
               browser += propname + ": " + navigator[propname] + "\n";
            }

         document.writeln('<pre>' + browser +  '</pre>');
      }
	  
   function DoTheTest() 
   	  {
			document.cookie = 'TemporaryTestCookie=yes; path=/';	  
			var testcookie = '';
			if(document.cookie.length > 0) {
				var cookiename = 'TemporaryTestCookie=';
				var cookiebegin = document.cookie.indexOf(cookiename);
				var cookieend = 0;
				if(cookiebegin > -1) {
					cookiebegin += cookiename.length;
					cookieend = document.cookie.indexOf(";",cookiebegin);
					if(cookieend < cookiebegin) { 
						cookieend = document.cookie.length; 
					}
					testcookie = document.cookie.substring(cookiebegin,cookieend);
				}
			}
			if(testcookie == 'yes') { 
				document.writeln('<font face="Arial,Helvetica,Sans Serif" size="2" color="blue">Enabled</font>');
      		} else { 
				document.writeln('<font face="Arial,Helvetica,Sans Serif" size="2" color="red"><strong>Disabled</strong></font>'); 
			}
	 }
	

   function testPopup(type) 
      {     
         var pHeight = 250;
         var pWidth  = 720;

         if (type == "onclick")
            {
               var url   = 'onclickpopup.htm';   
               var pName = "TestPopup1";
            }
         else
            {
               var url   = 'onloadpopup.htm';
               var pName = "TestPopup2";
            }
         
         WinVar=window.open(url,pName,"resizable=Yes,width=" + pWidth + ",height=" + pHeight +",toolbar=Yes,scrollbars=Yes,menubar=Yes");    
      }    

   function localDateTime()
      {
         now = new Date();

         document.write("<font face='Arial,Helvetica,Sans Serif' size='-2'>" + now.toLocaleString() + "</font>");
      }

