/******************************************
--  This site was designed and implemented by Miller Systems.
--  (c) Copyright 2002.  All rights reserved.
--  http://www.millersystems.com
--  Miller Systems, Inc. Boston MA 02116
******************************************/

var isIE = (document.all)?true:false;
var isNS4 = (document.layers)?true:false;
var isNS6 = ((!isIE) && (document.getElementById))?true:false;
var isMac = (navigator.userAgent.indexOf("Mac") != -1)?true:false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1)?true:false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1)?true:false;

minFlashVer = 4;

//////////////////////////////
// checkFlashActiveX()
// - uses VBScript for ActiveX controls
//////////////////////////////
if (isIE) {
	document.write(
	'<SCR'+'IPT language=VBScript\>'+'\n'+
	'Function checkFlashActiveX()'+'\n'+
		'Dim flashEnabled, currentFlashVer'+'\n'+
		'flashEnabled = false'+'\n'+
		'currentFlashVer = 10'+'\n'+
		'Do While currentFlashVer >= minFlashVer'+'\n'+
			'On Error Resume Next'+'\n'+
			'flashEnabled = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.\" & currentFlashVer & \"\")))'+'\n'+
			'If flashEnabled = true Then Exit Do'+'\n'+
			'currentFlashVer = currentFlashVer - 1'+'\n'+
		'Loop'+'\n'+
		'checkFlashActiveX = flashEnabled'+'\n'+
	'End Function'+'\n'+
	'<\/SCR'+'IPT\>'
	);
}

//////////////////////////////
// checkFlashActiveX()
// - uses JavaScript for Netscape style plug-ins
//////////////////////////////
function checkFlashPlugin() {
	var plugin = ((navigator.mimeTypes) && (navigator.mimeTypes["application/x-shockwave-flash"]))?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;
	if (plugin) {
		var pluginDesc = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin.description;
		var currentFlashVer = parseInt(pluginDesc.charAt(pluginDesc.indexOf(".")-1));
		if (currentFlashVer >= minFlashVer) return true;
	}
	return false;
}

//////////////////////////////
// detectFlash()
// - returns true if flash detected
//////////////////////////////
function detectFlash() {
	var flashCapable = false;
	if (location.search.indexOf("noflash")!=-1) return false;
	
	if (isOpera) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="437" height="383">');
	document.write('	<param name="movie" value="/bin/flash/home/home_animation.swf">');
	document.write('	<param name="wmode" value="transparent">');
	document.write('	<param name="loop" value="true">');
	document.write('	<param name="quality" value="high">');
	document.write('	<param name="bgcolor" value="#FFFFFF">');
	document.write('	<embed src="/bin/flash/home/home_animation.swf" loop="true" wmode="transparent" quality="high" bgcolor="#FFFFFF" width="437" height="383" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
	document.write('</object><br />');
	
	}
	
	if (isNS4 || isNS6) {
		flashCapable = checkFlashPlugin();
	}
	if (isIE && isWin) {
		flashCapable = checkFlashActiveX();
	}
	if (isIE && isMac) {
		var browserVer = parseFloat(navigator.appVersion.substr(navigator.appVersion.indexOf("MSIE") + 4));
		if (browserVer>=5) {
			flashCapable = checkFlashPlugin();
		} else {
			flashCapable = true;
		}
	}
	return flashCapable;
}



