
// Since IE gets "Press SPACEBAR or ENTER to activate and use this control" now....
// From: http://www.amarasoftware.com/flash-problem.htm
function handleExplorerIssue() {
	// Get all <object>s on the page
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++) {
		objects[i].outerHTML = objects[i].outerHTML;	// This line gets around the IE security fuckup
	}
}
//addEvent(window, 'load', handleExplorerIssue, false);
// Removed since it isn't working right now.	



function detectFlash8() {

	// IE flash detection
	function detectie() {
		for(var i=8; i>0; i--) {
			flashVersion = 0;
			try{
				var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				flashVersion = i;
				return flashVersion;
			}
			catch(e){
			}
		}
	}
	
	// Netscape flash detection
	function detectnn() {
		flashversion = 1;
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			flashinstalled = 2;
			if (x.description)
			{
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
		return flashversion;
	}
	
	// IE or Netscape?
	if (navigator.plugins && navigator.plugins.length) {
		fv = detectnn();	
	} else {
		fv = detectie();	
	}
	
	// We know what browser and what version, so lets do iieeeeet...
	objects = document.getElementsByTagName("object");
	for (var i = 0; i < objects.length; i++) {
//		objects[i].outerHTML = objects[i].outerHTML;	// This line gets around the IE security fuckup
		flashCode = new String(objects[i].innerHTML);
//		alert (flashCode);
		if (fv > 7) {
//			alert('ver 8');
//			flashCode = flashCode.replace('7.flv','8.flv');
			flashCode = flashCode.replace(/7\.flv/g, '8.flv');
		}
//		alert(flashCode);
		objects[i].innerHTML = flashCode;
	}
	
//	alert('done');

	



/*
	// At this point we have the version of flash
	if (fv > 7) {
		flashbox = document.getElementById('flash');
		flashbox.innerHTML = '';
		flashbox.innerHTML = eight;
	} else {
		// Nothing, stick with default.	
	}
	// This is because IE recently had activeX changes made
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML;
	}
*/

} // var detectFlash8 ends.


//window.onload = detectFlash;
addEvent(window, 'load', detectFlash8, false);