/*/////////  For Flash Detection ////////////////////////////////*/
var flashVersion = 0;

function getFlashVersion() {
	var latestFlashVersion = 8;
	var agent = navigator.userAgent.toLowerCase(); 
	
	/* NS3 needs flashVersion to be a local variable*/
	if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
		flashVersion = 0;
	}
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            	if (flashPlugin.description.indexOf(i + '.') != -1) {
	               flashVersion = i;
    	           break;
        	    }
			}
		}
	}
	/* IE4+ Win32:  attempt to create an ActiveX object using VBScript*/
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		var doc = '<scr' + 'ipt language="VBScript"\> \n';
			doc += 'On Error Resume Next \n';
			doc += 'Dim obFlash \n';
			doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
			doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
			doc += '   If IsObject(obFlash) Then \n';
			doc += '      flashVersion = i \n';
			doc += '      Exit For \n';
			doc += '   End If \n';
			doc += 'Next \n';
			doc += '</scr' + 'ipt\> \n';
			document.write(doc);
	}
		
	/* Can't detect in all other cases */
	else {
		flashVersion = flashVersion_UNKNOWN;
	}

	return flashVersion;
}

flashVersion_UNKNOWN = -1;


function flash(fv,src,color,width,height,noflash){
	var EC;
	var requiredVersion = fv;
	var flashVersion = getFlashVersion();
 
	if (flashVersion >= requiredVersion) {
		document.write (
		'<div style="z-index: -99;">' +
		'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"' + 'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"' + 
		'width="595" height="215" id="deaflympicsheader_slide" align="middle">' +
		'<param name="allowScriptAccess" value="sameDomain" />' +
		'<param name="wmode" value="opaque" />' +
		'<param name="movie" value="deaflympicsheader_slide.swf" /><param name="quality"' + 
		'value="high" /><param name="bgcolor" value="#ffffff" />' +
		'<embed src="deaflympicsheader_slide.swf" wmode="opaque" quality="high" bgcolor="#ffffff"' + 
		'width="595" height="215" name="deaflympicsheader_slide" align="middle"' + 'allowScriptAccess="sameDomain"' + 'type="application/x-shockwave-flash"' + 'pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
		'</object>' +
		'</div>');			
	}else{ 
		 document.write (
		 '<img src="images/main_img.jpg" width="596" height="215" />');
	}
}
