// We create a global variable to hold the user agent information
// and we convert all characters in the string to lowercase in order to simplify testing 

	
	var zxBrowser;
	var zxBrowserVersion;
	var zxScreenWidth;
	var zxScreenHeight;
	var ua = navigator.userAgent.toLowerCase(); 


// I use the user agent string to get information about the browser name
// Although the browsers that support Flash player plug-in may be limited
// I need more information in this area

	if ((ua.indexOf('mozilla')!=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1) && (ua.indexOf('webtv')==-1)  && (ua.indexOf('hotjava')==-1))
	{
	zxBrowser="Netscape";	
	}
	else if ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1))
	{
	zxBrowser="Internet+Explorer";
	}
	else if (ua.indexOf("opera") != -1)
	{
	zxBrowser="Opera";
	}
	else if (ua.indexOf("webtv") != -1)
	{
	zxBrowser="WebTV";
	}
	else if (ua.indexOf("aol") != -1)
	{
	zxBrowser="Aol";
    	}
	else if ((ua.indexOf("navio") != -1) || (ua.indexOf("navio_aoltv") != -1))
	{
	zxBrowser="TVNavigator";
	}
	else if (ua.indexOf("hotjava") != -1)
	{
	zxBrowser="HotJava";
	}
	else if (ua.indexOf("konqueror") != -1) 
	{
	zxBrowser="Konqueror";
	}
	else
	{
	zxBrowser="Other+Browsers";
	}

// Netscape gives correct information about its version number (navigator.appVersion)
// But Netscape 6 returns 5 in navigator.appVersion
// We have to check the user agent string for correct information about Netscape 6
// and Internet Explorer, Opera etc.
	
	// is it Netscape? (except Netscape 6) if it is so we will parse the navigator.appVersion string
	if ((ua.indexOf('mozilla')!=-1) && (ua.indexOf('netscape6')==-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1) && (ua.indexOf('webtv')==-1)  && (ua.indexOf('hotjava')==-1))
	{
	zxBrowserVersion=parseFloat(navigator.appVersion);
	}
	else if (ua.indexOf("netscape6") != -1) 
	// if it is NS 6 we can get version info from the 
	// Gecko specific navigator.vendorSub property
	{
	zxBrowserVersion=parseFloat(navigator.vendorSub);
	}
	else if (ua.indexOf("msie") != -1) 
	// Welcome to the strange world of Microsoft's version numbering
	// If it is an IE we will check the value declared vafter "MSIE" in the user agent string
	// We will find the "MSIE" string and we will extract the version number following the space, up to ";"
	{
		var msieIndex = ua.indexOf ( "msie " ); // Pay attention to the space after msie
		zxBrowserVersion = parseFloat(ua.substring (msieIndex+5, ua.indexOf (";", msieIndex )))
	}
	else if ((ua.indexOf("opera") != -1) && (ua.indexOf ( "opera/" ) != -1))
	// is it Opera? If it is Opera and if it is identified as Opera 
	// We will find the "Opera/" string and we will extract the version number following the "/", up to "("
	{
		var operaIndex = ua.indexOf ( "opera/" ); 
		zxBrowserVersion = parseFloat(ua.substring (operaIndex+6, ua.indexOf ("(", operaIndex )))
	}
	else 
	// I will set it as "Unavailable" for other browsers
	{
	zxBrowserVersion="Unavailable";
	}


// ===========Display (screen) related variables===========
 
	if (window.screen) // old browsers do not support it
	{
	zxScreenWidth= window.screen.width;
	zxScreenHeight= window.screen.height;
	}