// Cutdown client-side JavaScript client sniff. Leaves out stuff we don't really need// (1) browser vendor: //     is_nav, is_ie, is_opera, is_webtv, is_other (ie it's not one of the browsers we specifically test for) // (2) browser version number: //     is_major (integer indicating major version number: 2, 3, 4 ...) //     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...) // (3) browser vendor AND major version number //     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav5, is_nav5up, is_ie3, is_ie4, is_ie4up // (4) JavaScript version number: //     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...) // (5) OS platform and version: //     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98 //     is_os2 //     is_mac, is_mac68k, is_macppc //     is_unix //     is_vms //// Then checks for Flash and Director if we're in Netscape browsers// convert all characters to lowercase to simplify testing var agt=navigator.userAgent.toLowerCase(); // *** BROWSER VERSION *** Note: On IE5, these return 4, so use is_ie5 or is_ie5up to detect IE5. var is_major = parseInt(navigator.appVersion); var is_minor = parseFloat(navigator.appVersion); // Note: Opera and WebTV spoof Navigator. var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1)); var is_nav2 = (is_nav && (is_major == 2)); var is_nav3 = (is_nav && (is_major == 3)); var is_nav4 = (is_nav && (is_major == 4)); var is_nav4up = (is_nav && (is_major >= 4)); //Careful though - just coz it works in nav4 it doesn't necessarily work in Nav5var is_nav5 = (is_nav && (is_major == 5)); //Netscape 6 var is_nav5up = (is_nav && (is_major >= 5)); var is_ie   = (agt.indexOf("msie") != -1); var is_ie3  = (is_ie && (is_major < 4)); var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) ); var is_ie4up  = (is_ie  && (is_major >= 4)); var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) ); var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4); var is_5up = (is_ie5up || is_nav5up);var is_hotjava = (agt.indexOf("hotjava")!=-1);var is_opera = (agt.indexOf("opera") != -1); var is_webtv = (agt.indexOf("webtv") != -1); var is_firefox = (agt.indexOf("firefox") != -1);// *** JAVASCRIPT VERSION CHECK *** var is_js; if (is_nav2 || is_ie3) is_js = 1.0 else if (is_nav3 || is_opera) is_js = 1.1 else if ((is_nav4 && (is_minor <= 4.05)) || is_ie4) is_js = 1.2 else if ((is_nav4 && (is_minor > 4.05)) || is_ie5) is_js = 1.3 else if (is_nav5) is_js = 1.4 // NOTE: In the future, update this code when newer versions of JS are released. For now, we try to provide some upward compatibility // so that future versions of Nav and IE will show they are at *least* JS 1.x capable. Always check for JS version compatibility  with > or >=. else if (is_nav && (is_major > 5)) is_js = 1.4 else if (is_ie && (is_major > 5)) is_js = 1.3 // HACK: no idea for other browsers; always check for JS version with > or >= else is_js = 0.0; // *** PLATFORM ***var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );var is_os2   = ((agt.indexOf("os/2")!=-1) || (navigator.appVersion.indexOf("OS/2")!=-1) || (agt.indexOf("ibm-webexplorer")!=-1));var is_mac    = (agt.indexOf("mac")!=-1);var is_linux = (agt.indexOf("linux")!=-1);var is_flash = false;var is_flash_version = 0;var is_director = false;//CheckPlugins if in Netscapeif (is_nav) {	var intPlugins = navigator.plugins.length;	if (intPlugins > 0)	{		var intCtr = 0;		var objPlugin;		while (intCtr < intPlugins)	{			objPlugin = navigator.plugins[intCtr];			if (is_flash == false) {				if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] &&  						navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin && (objPlugin.description.indexOf("Flash")!=-1)) {					intPos = objPlugin.description.indexOf("Flash");					is_flash_version = parseInt(objPlugin.description.substring((intPos+6), (intPos+7)));					if (is_flash_version > 2 ) is_flash = true;						}			}			if (is_director == false) {				is_director = navigator.mimeTypes && navigator.mimeTypes["application/x-director"] && navigator.mimeTypes["application/x-director"].enabledPlugin?true:false;			}			intCtr++;		} // end of while loop	}}//this function deals with redirecting from friendly URLs e.g natwest.com/corporate/. it ensures sniffer is invokedvar path;//is assigned the incoming redirect path - passed across from relevant index pagesfunction redirect(destination){	if (is_nav5up){ 				alert("We are currently testing our website with the Netscape 6 browser. At this stage, we cannot guarantee that you will be able to experience the full benefits of the website");	path = destination;}else if (((is_nav4 || is_ie4up) && is_win) || ( is_nav4 && is_mac)){	path = destination;}else{	path = "/index_holding.htm?path="+destination;	}window.location.replace(path);}