		
		function detectBrowser()
		{			
			//debugger;
			
			var btnLogin = document.getElementById("_btn_Login");
			
			//disable the button as precaution
			try
			{
				btnLogin.disabled = true;
			} 
			catch(e) {}


			//Detect OS
			var IsOSOK = true;
			var agt = navigator.userAgent.toLowerCase();

		    // *** PLATFORM *** 
			var win   = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
			// NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all 
			// Win32, so you can't distinguish between Win95 and WinNT. 
			var win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1)) ;
			// is this a 16 bit compiled version? 
			var win16 = ((agt.indexOf("win16")!=-1) || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("windows 16-bit")!=-1) );
			var win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) || (agt.indexOf("windows 16-bit")!=-1) );
			// NOTE: Reliable detection of Win98 may not be possible. It appears that: 
			//       - On Nav 4.x and before you'll get plain "Windows" in userAgent. 
			//       - On Mercury client, the 32-bit version will return "Win98", but 
			//         the 16-bit version running on Win98 will still return "Win95". 
			//alert(agt.indexOf("windows 98"))
			var win98 = ((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1)) 
			var winnt = ((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1)) 
			var win32 = (win95 || winnt || win98 || ((this.major >= 4) && (navigator.platform == "Win32")) || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
			
			if (win98 || winnt) IsOSOK = false;
			//Done Detecting OS
			

			// Detect the browsername - MDWeb supported by IE 5.5 or above
			var browsername = "N/A"
			browsername = navigator.appName;
			if (browsername.indexOf("Microsoft")!=-1) 
				browsername="MSIE"
			
			//detect the browserversion
			var browserversion = getBrowserVersion();
	
			
			//alert('IsOSOK:' + IsOSOK + '\nbrowsername:' + browsername + '\nbrowserversion:' + browserversion + '\nAgt:' + navigator.userAgent.toLowerCase());

			//Decide if to allow login
			if (browsername=="MSIE")
			{
				if (parseFloat(browserversion) < 6 && !IsOSOK)
				{
					alert("You must use Microsoft Internet Explorer 6 or above with this version of windows.");
					return;
				}
				else if (parseFloat(browserversion) < 5.5)
				{
					alert("You must use Microsoft Internet Explorer 5.5 or above.");
					return;
				}
				
				
				try
					{
						btnLogin.disabled = false;
					} 
				catch(e) {}
				

			}
			else
			{
				alert("You must use Microsoft Internet Explorer.");
				return;
			}		
		
		
		}


//======================================================================================================================================================
		
		function getBrowserVersion()
		{
		
			var retVal = 0;
		
		
			if (navigator.appVersion.indexOf("MSIE")>=0)
			{
				retVal = parseFloat(navigator.appVersion.split("MSIE")[1]);
			}
				
			return retVal;
			
		}
		
//======================================================================================================================================================

		function setFocus()
		{
			try 
			{
				document.getElementById("_txt_Username").focus();				
			}
			catch (e) {}
		}
		
		