﻿<!--
/*	*****************************************
	getFlash version 1.1 for oce.com web sites
	by Tim van den Hombergh
	
	Functions:
	- Advanced flash detection script for all browers and OSs
	Settings by default:
	- FlashVersion = 6
	- Max flash version = 7
	- NetscapeActive = disabled
	Required fields:
	- flashFilePath
	- width
	- height
	Optional fields
	- altImagePath
	- altHyperLink
	- altImageText
	- optionalImageTag
	*****************************************
*/ 


var actualVersion = 0
var maxVersion = 7
var flash4Installed = false;		// boolean. true if flash 4 is installed
var flash5Installed = false;		// boolean. true if flash 5 is installed
var flash6Installed = false;		// boolean. true if flash 6 is installed
var flash7Installed = false;		// boolean. true if flash 7 is installed

// Write VBscript detection if we're not on mac.
if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
	document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');	
	document.write('</SCR' + 'IPT\> \n');
}


function getFlash(flashVersion,flashFilePath,width,height,transparant,netscapeActive,altImagePath,altHyperLink,altImageText,optionalImageTag){
	var MM_FlashCanPlay = false
	if (!flashVersion) flashVersion = 6
	if (!altImageText) altImageText = ""
	if (!optionalImageTag) optionalImageTag = ""
	
	var MM_contentVersion = flashVersion
	
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    	for (var i = 0; i < words.length; ++i)
    	{
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
    	}
		
		MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
	} else {
		// Loop through all versions we're checking, and set actualVersion to highest detected version
		for (var i = 4; i <= maxVersion; i++) {	
			if (eval("flash" + i + "Installed") == true) actualVersion = i;
		}
		// Check if the contentVersion >= actualVersion; if so return MM_FlashCanPlay=true
		if (actualVersion >= MM_contentVersion) MM_FlashCanPlay = true
	}
	
	//return flash object if flash = true
	if ( MM_FlashCanPlay ) {
		object = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
		object += '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ';
		object += ' ID="script" WIDTH="'+width+'" HEIGHT="'+height+'" ALIGN="">';
		object += ' <PARAM NAME=movie VALUE="'+flashFilePath+'"> <PARAM NAME=quality VALUE=high>'; 
		if (transparant) object += '<param name=WMode value=Transparent>'
		object += ' <EMBED src="'+flashFilePath+'" quality=high';
		object += ' swLiveConnect=FALSE WIDTH="'+width+'" HEIGHT="'+height+'" NAME="script" ALIGN=""';
		object += ' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">';
		object += ' </EMBED>';
		object += ' </OBJECT>';
	
	// return alt image object if flash = false and flashBanner = true
	} else if(altImagePath){ 
		if (altHyperLink) object = '<a href='+altHyperLink+'><img src='+altImagePath+' width='+width+' height='+height+' border=0 alt="'+altImageText+'" '+ optionalImageTag +'></a>';
		else object += '<img src='+altImagePath+' width='+width+' height='+height+' border=0 alt="'+altImageText+'">';
	
	// return no flash detected if flash = false and flashBanner = false
	} else{
		object  = '<table border="0" cellpadding="0" cellspacing="0" width="'+width+'" height="'+height+'">'
    	object += '<TR><TD align="center" valign="middle">'
		
		object += '<table border="0" cellpadding="0" cellspacing="0" width="100%">'
   		object += '<TR><TD class="content" align="left" colspan="2" valign="middle">'
		object += '<img src="http://www3.oce.com/scripts/im_flashplayer.gif" align="right">'
		object += '<br><br><br><br>To view this page in full you need (a newer version of) the Macromedia Flash player.'
   		object += '</TD></TR>'
    	object += '<TR><TD class="content" width="100%" align="center"><BR><BR><strong><a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">Download&raquo;&nbsp;</a></strong></TD><TD class="content" align="center">&nbsp;</TD>'
   		object += '</TD></TR>'
   		object += '</table>'		
		object += '</TD></TR>'
   		object += '</table>'
	}
	return object
}
//-->
