	function baiOpenWindow(page, width, height, scroll, resize)
	{
		if (scroll)
			scroll = 'yes';
		else
			scroll = 'no';

		if (resize)
			resize = 'yes';
		else
			resize = 'no';

		var load = window.open(page, '', 'height=' + height + ',width=' + width + ',scrollbars=' + scroll + ',resizable=' + resize + ',menubar=no,toolbar=no,location=no,status=no');
	}

	var detectableWithVB = false;

	function showPlugin()
	{
		if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) 
		{
			document.location.href = document.location.href + "?lg=1";
			return;
		}

		navigator.plugins.refresh(true);
		var pluginType = "application/x-igloader;version=1.2.0.0";
		mimetype = navigator.mimeTypes[pluginType];
		//alert(mimetype);
		var pluginFound = detectPluginHostControl();
		if ((mimetype && mimetype.enabledPlugin && mimetype.type==pluginType) || (pluginFound==true))
		{
			//alert('Launching');
			//window.scrollTo(0,100000);
			//window.scrollBy(0,100000);
			document.location.href = document.location.href + "?lg=1";
		}
		else
		{
			document.getElementById('getwebgame').style.visibility = "visible";
			setTimeout('showPlugin()',2000);
		}
	}

	function reloadPlugin(DoRefresh)
	{
		if (DoRefresh)
			navigator.plugins.refresh(true);

		showPlugin();
		document.location.href = window.location.href;
	}

	function detectPluginHostControl()
	{
		if (detectableWithVB)
		{
			var pluginFound = false;
			pluginFound = detectActiveXControl('Mozilla.PluginHostCtrl.11');
			return pluginFound;
		}
	}

	function getMozillaPlugin()
	{	
		navigator.plugins.refresh(true);
		var pluginType = "application/x-igloader;version=1.2.0.0";
		mimetype = navigator.mimeTypes[pluginType];
		if ((mimetype && mimetype.enabledPlugin && mimetype.type==pluginType) || (pluginFound==true))
		{
		}
		else
		{
			window.location.href = "http://igloader.com/download/igLoader_setup.exe";
		}
	}

//	if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) 
//	{
//		document.writeln('<script language="VBscript">');
//		document.writeln('\'do a one-time test for a version of VBScript that can handle this code');
//		document.writeln('detectableWithVB = False');
//		document.writeln('If ScriptEngineMajorVersion >= 2 then');
//		document.writeln('  detectableWithVB = True');
//		document.writeln('End If');
//		document.writeln('\'this next function will detect most plugins');
//		document.writeln('Function detectActiveXControl(activeXControlName)');
//		document.writeln('  on error resume next');
//		document.writeln('  detectActiveXControl = False');
//		document.writeln('  If detectableWithVB Then');
//		document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
//		document.writeln('  End If');
//		document.writeln('End Function');
//		document.writeln('</scr' + 'ipt>');
//	}
