/*
 * file	:	gecko_activex_detector.js
 *
 * created by:	John Ma (john.ma@insinc.com)	2007-01-17
 *
 * comments:	This part of javacript code is used to detect if user using
 *		Gecko browser on Window machine. If it is, check if the browser
 *		has activex enabled. In case the activex has not been installed,
 *		redirect the page to an activex install page.
 *
*/

//
// this is the redirect site (where all the activex installers located)
//
var install_site = "http://www4.insinc.com/ibc/firefox/index.php";

if ( navigator.appVersion.indexOf("Win") != -1 && navigator.userAgent.indexOf("Gecko") != -1 ) {

	var geckoax_installed = false;

	//
	// if the activex is not installed, load another page
	//
	if (navigator.plugins && navigator.plugins.length){
		for ( x=0; x< navigator.plugins.length; x++ ){
			if (navigator.plugins[x].name.indexOf('ActiveX') != -1 ) {
				geckoax_installed = true;
			}
		}
	}

	if (!geckoax_installed){
		window.location = install_site;
	}
}

