/******************************************************************************** * F_util.js * JavaScript functions by Flying @ Flying's World, Nov 2001. ********************************************************************************///========================================// Modified from Ultimate Client Sniffer// @ http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html// by Flying//// Capability:// (1) Browser vendor://	isNN, isIE, isOpera, isHotJava, isWebTV, isTVNav, isAOLTV// (2) Browser version numbers://	major (integer), minor (float)// (3) Browser vendors and major version numbers://	isNN2, isNN3, isNN4, isNN4up, isNN6, isNN6up, isGecko,//	isIE3, isIE4, isIE4up, isIE5, isIE5up, isIE5_5, isIE5_5up, isIE6, isIE6up,//	isHotJava3, isHotJava3up,//	isOpera2, isOpera3, isOpera4, isOpera5, isOpera5up// (4) JavaScript version numbers and support://	js (float),//	hasDOM// (5) OS platforms and version numbers://	onWin, onWin16, onWin32, onWin31, onWin95, onWinNT, onWin98, onWinMe, onWin2k, onWinXP//	onOS2,//	onMac, onMac68k, onMacPPC,//	onUnix,//	onSun, onSun4, onSun5, onSunx86,//	onIrix, onIrix5, onIrix6,//	onHPUX, onHPUX9, onHPUX10,//	onAIX, onAIX1, onAIX2, onAIX3, onAIX4//	onLinux, onSco, onUnixware, onMpras, onReliant,//	onDEC, onSinix, onFreeBSD, onBSD,//	onVMS//// Bug:// This code will crash IE3 on Mac if the page containing this script is reloaded.// If you want to avoid this problem, turn off replace the object-oriented code with plain boolean variables.function clientInfo() {	// Browser agent information	var agent = navigator.userAgent.toLowerCase();			// Browser versions	this.major = parseInt(navigator.appVersion);	this.minor = parseFloat(navigator.appVersion);			// Browser vendors and versions	this.isNN    = ((agent.indexOf("mozilla") != -1) &&	                (agent.indexOf("spoofer") == -1) &&	                (agent.indexOf("compatible") == -1) &&	                (agent.indexOf("opera") == -1) &&	                (agent.indexOf("webtv") == -1) &&	                (agent.indexOf("hotjava") == -1) );	this.isNN2   = (this.isNN && (this.major == 2));	this.isNN3   = (this.isNN && (this.major == 3));	this.isNN4   = (this.isNN && (this.major == 4));	this.isNN4up = (this.isNN && (this.major >= 4));	this.isNNav  = (this.isNN && 	                ((agent.indexOf(";nav") != -1) || (agent.indexOf("; nav") != -1)) );	this.isNN6   = (this.isNN && (this.major == 5));	this.isNN6up = (this.isNN && (this.major >= 5));	this.isGecko = (agent.indexOf("gecko") != -1);	this.isIE      = ((agent.indexOf("msie") != -1) &&	                  (agent.indexOf("opera") == -1) );	this.isIE3     = (this.isIE && (this.major < 4));	this.isIE4     = (this.isIE && (this.major == 4) && (agent.indexOf("msie 4") != -1));	this.isIE4up   = (this.isIE && (this.major >= 4));	this.isIE5     = (this.isIE && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));	this.isIE5up   = (this.isIE && (! this.isIE3) && (! this.isIE4));	this.isIE5_5   = (this.isIE && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));	this.isIE5_5up = (this.isIE && (! this.isIE3) && (! this.isIE4) && (! this.isIE5));	this.isIE6     = (this.isIE && (this.major == 4) && (agent.indexOf("msie 6.") != -1));	this.isIE6up   = (this.isIE && (! this.isIE3) && (! this.isIE4) && (! this.isIE5) && (! this.isIE5_5));	this.isAOL  = (agent.indexOf("aol") != -1);	// isAOL, isAOL3 and isAOL4 are not reliable on AOL4	this.isAOL3 = (this.isAOL && this.isIE3);	this.isAOL4 = (this.isAOL && this.isIE4);	this.isAOL5 = (agent.indexOf("aol 5") != -1);	this.isAOL6 = (agent.indexOf("aol 6") != -1);	this.isWebTV = (agent.indexOf("webtv") != -1);	this.isTVNav = ((agent.indexOf("navio") != -1) || (agent.indexOf("navio_aoltv") != -1));	this.isAOLTV = this.isTVNav;	this.isHotJava    = (agent.indexOf("hotjava") != -1);	this.isHotJava3   = (this.isHotJava && (this.major == 3));	this.isHotJava3up = (this.isHotJava && (this.major >= 3));		// JavaScript versions	if (this.isNN2 || this.isIE3)		this.js = 1.0;	else if (this.isNN3)		this.js = 1.1;	else if (this.isOpera5up)		this.js = 1.3;	else if (this.isOpera5)		this.js = 1.1;	else if ((this.isNN4 && (this.minor <= 4.05)) || this.isIE4)		this.js = 1.2;	else if ((this.isNN4 && (this.minor > 4.05)) || this.isIE5)		this.js = 1.3;	else if (this.isHotJava3up)		this.js = 1.4;	else if (this.isNN6 || this.isGecko)		this.js = 1.5;	else if (this.isNN6up)		this.js = 1.5;	else if (this.isIE5up)		this.js = 1.3;	// IE5up on Mac is 1.4 (check the below in the "OS platforms" section)	else		this.js = 0.0;	// unidentified JavaScript support	this.hasDOM = (this.isNN6up || this.isIE5up);		// OS platforms	this.onWin   = ((agent.indexOf("win") != -1) ||	                (agent.indexOf("16bit") != -1) );	this.onWin31 = ((agent.indexOf("windows 3.1") != -1) ||	                (agent.indexOf("16bit") != -1) ||	                (agent.indexOf("windows 16-bit") != -1) );	this.onWin95 = ((agent.indexOf("win95") != -1) ||	// not reliable if is Opera	                (agent.indexOf("windows 95") != -1) );	this.onWinNT = ((agent.indexOf("winnt") != -1) ||	                (agent.indexOf("windows nt") != -1) );	this.onWin98 = ((agent.indexOf("win98") != -1) ||	// not reliable	                (agent.indexOf("windows 98") != -1) );		this.onWin2k = (agent.indexOf("windows nt 5.0") != -1);	this.onWinMe = (agent.indexOf("win 9x 4.90") != -1);	this.onWinXP = (agent.indexOf("windows nt 5.1") != -1);	this.onWin16 = ((agent.indexOf("win16") != -1) ||	                (agent.indexOf("16bit") != -1) ||	                (agent.indexOf("windows 3.1") != -1) ||	                (agent.indexOf("windows 16-bit") != -1) );	this.onWin32 = (this.onWin95 || this.onWinNT || this.onWin98 ||	                ((this.major >= 4) && (navigator.platform == "Win32")) ||	                (agent.indexOf("win32") != -1) ||	                (agent.indexOf("32bit") != -1) );	this.onOS2 = ((agent.indexOf("os/2") != -1) ||	              (navigator.appVersion.indexOf("OS/2") != -1) &&	              (agent.indexOf("ibm-webexplorer") != -1) );	this.onMac    = (agent.indexOf("mac") != -1);	if (this.onMac && this.isIE5up)	// hack IE5up JavaScript version for Mac		this.js = 1.4;	this.onMac68k = (this.onMac &&	                 ((agent.indexOf("68k") != -1) ||	                  (agent.indexOf("68000") != -1) ) );	this.onMacPPC = (this.onMac &&	                 ((agent.indexOf("ppc") != -1) ||	                  (agent.indexOf("powerpc") != -1) ) );	this.onSun    = (agent.indexOf("sunos") != -1);	this.onSun4   = (agent.indexOf("sunos 4") != -1);	this.onSun5   = (agent.indexOf("sunos 5") != -1);	this.onSunx86 = (this.onSun && (agent.indexOf("i86") != -1));	this.onIrix  = (agent.indexOf("irix") != -1);	this.onIrix5 = (agent.indexOf("irix 5") != -1);	this.onIrix6 = ((agent.indexOf("irix 6") != -1) ||	                (agent.indexOf("irix6") != -1) );	this.onHPUX   = (agent.indexOf("hp-ux") != -1);	this.onHPUX9  = (this.onHPUX && (agent.indexOf("09.") != -1));	this.onHPUX10 = (this.onHPUX && (agent.indexOf("10.") != -1));	this.onAIX  = (agent.indexOf("aix") != -1);	this.onAIX1 = (agent.indexOf("aix 1") != -1);	this.onAIX2 = (agent.indexOf("aix 2") != -1);	this.onAIX3 = (agent.indexOf("aix 3") != -1);	this.onAIX4 = (agent.indexOf("aix 4") != -1);	this.onLinux = (agent.indexOf("linux") != -1);	this.onSCO = ((agent.indexOf("sco") != -1) ||	              (agent.indexOf("unix_sv") != -1) );	this.onUnixware = (agent.indexOf("unix_system_v") != -1);	this.onMpras = (agent.indexOf("ncr") != -1);	this.onReliant = (agent.indexOf("reliantunix") != -1);	this.onDEC = ((agent.indexOf("dec") != -1) ||	              (agent.indexOf("osf1") != -1) ||	              (agent.indexOf("dec_alpha") != -1) ||	              (agent.indexOf("alphaserver") != -1) ||	              (agent.indexOf("ultrix") != -1) ||	              (agent.indexOf("alphastation") != -1) );	this.onSinix = (agent.indexOf("sinix") != -1);	this.onFreeBSD = (agent.indexOf("freebsd") != -1);	this.onBSD = (agent.indexOf("bsd") != -1);	this.onUnix = ((agent.indexOf("x11") != -1) ||	               this.onSun || this.onIrix || this.onHPUX || this.onSCO || this.onUnixware ||	               this.onMpras || this.onReliant || this.onDEC || this.Sinux || this.onAIX ||	               this.onLinux || this.onBSD || this.onFreeBSD );	this.onVMS = ((agent.indexOf("vax") != -1) || (agent.indexOf("openvms") != -1));}// Obtain client platform informationvar F_client = new clientInfo();//========================================// Reload the page if window is resized (to counter rendering bug in NN4)function F_nnReloadOnResize( e, initURL ) {	if (! F_client.isNN4) return;	if (e == "_init") {		this.url = initURL;		this.pageWidth  = window.innerWidth;		this.pageHeight = window.innerHeight;		window.onresize = F_nnReloadOnResize;	} else if ((this.pageWidth  != window.innerWidth) ||	           (this.pageHeight != window.innerHeight) ) {		window.location = this.url;	}}//========================================function F_wndResizeView( wnd, width, height ) {	var defBrowserWidth  =  10;	var defBrowserHeight = 120;	if (F_client.isNN4up) {		docWidth  = wnd.innerWidth;		docHeight = wnd.innerHeight;	} else if (F_client.isIE4up) {		docWidth  = wnd.document.body.clientWidth;		docHeight = wnd.document.body.clientHeight;	} else {		if (F_client.js >= 1.2) {			wnd.resizeTo(width + defBrowserWidth, height + defBrowserHeight);	// estimated			return true;		} else {			return false;		}	}	offx = width  - docWidth;	offy = height - docHeight;	wnd.resizeBy(offx, offy);	return true;}//========================================function F_wndSetStatus( msg ) {	window.status = msg; 	return true;}//========================================function F_wndOpenWindow( url, wndId, features ) {	/* Possible features:		toolbar, location, status, menubar, scrollbars, resizable, width, height	 */ 	return window.open(url, wndId, features);}//========================================function F_exploreDOM() {	this.done = true;	nodes = document.documentElement.lastChild.childNodes;	str = "";	for (i = 0; i < nodes.length; i++) {		str += "'" + nodes[i].nodeName + "'\t'" + nodes[i].nodeType + "'\t'" + nodes[i].id  + "'\n";	}	alert(str);}