/*******************************************************************************
	JAVASCRIPT FUNCTIONS
	Hand-crafted by Chris Nott using time-honoured, traditional techniques

	file:			scripts/global.js
	author:		Chris Nott (cnott@blastradius.com).
	history:		2000/04/19		Created.
*******************************************************************************/


/*******************************************************************************
	Flash Detection Function
*******************************************************************************/

function flashDetection() {
	var hasFlash = false;
	if (is.ie4up && is.win32) {
		hasFlash = ieFlashDetect();
	}
	else if (navigator.plugins && navigator.plugins.length > 0) {
		plugin = navigator.plugins['Shockwave Flash'];
		hasFlash6 = (plugin && plugin.description.indexOf('6') != -1);
		hasFlash6 = (plugin && plugin.description.indexOf('7') != -1);
		hasFlash6 = (plugin && plugin.description.indexOf('8') != -1);
		hasFlash = (hasFlash6);
	}
	return hasFlash;
	
	var flashVersion = 0;

}

/*******************************************************************************
	Display Type Selection Function
*******************************************************************************/

function attemptFlash() {

	var hasFlash = flashDetection();
	if (hasFlash == true) {
		flashCheck = DISPLAYTYPE_FLASH;
		setDisplayTypeCookie(DISPLAYTYPE_FLASH);
		return true;
	} else {
		return false;
	}
}

function setDisplayTypeCookie(value) {
	var expires = new Date();
	expires.setTime(expires.getTime() + 22118400000);
	setCookie('flashCheck', value, expires, '/');
}

/*******************************************************************************
	Page Entry Detections - 4.0 Browser and Flash
*******************************************************************************/

var DISPLAYTYPE_FLASH = 'flash';
var DISPLAYTYPE_HTML = 'html';
var flashCheck = null;

if (location.href.indexOf('flash_detection_failed.html') == -1) {
	flashCheck = getCookie('flashCheck');
	if (flashCheck == null) {
		if (!document.all && !document.layers && !document.getElementById) location.href = "browser_detection_failed.html";
		attemptFlash();
	}
}

