/********************************************************************* * * Flash Dispatcher -- a scriptable detector for Flash Player * *    Modified: 1st Oct 2000 - Cristiano Rastelli - Area Web *              - removed commented parts; *              - updated paths to current configuration *              - renamed functions * *********************************************************************//* vvvvvvvvvvvvvvvv	UPDATE THESE VALUES vvvvvvvvvvvvvv */var contentURL =  "intro.html"	//  real-content page with SWF filevar contentVersion = "5.0"			//    flash-player plugin version requiredvar upgradeURL = "/FlashDK/upgradeFlash.html"	//  page telling the user to UPGRADE the pluginvar installURL = "/FlashDK/installFlash.html"	//  page telling the user to INSTALL the pluginvar altURL = "home.html"					//  alternative page/section - no plugin requiredvar snifferURL = "/FlashDK/FlashDetector.swf";   //  URL of the Flash self-detecting movie ("sniffer").var FlashPluginsPage = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";/* --------------------------------------------------- *//*  FlashDetect() -- construct an object representing Flash Player status *//*	This object properties are: 		installed = true/false		implementation = "Plug-in"/"Activex"		version = 		autoInstallable = true/false 	Called also to report version to the user (See <UpgradeFlash.html>)   *//* These values are set by the "FlashSelector.vbs" script */var FlashControlInstalled;	    // is the Flash ActiveX control installed?var FlashControlVersion;	    // ActiveX control version if installedfunction FlashDetect() {    if (navigator.plugins && navigator.plugins.length > 0)  {		this.implementation = "Plug-in";		this.autoInstallable = false;					// Check whether the Flash plug-in is installed:		if (navigator.plugins["Shockwave Flash"]) {	  		this.installed = true;	    	// Get the plug-in version and revision:	    	var words =			navigator.plugins["Shockwave Flash"].description.split(" ");		    for (var i = 0; i < words.length; ++i) {				if (isNaN(parseInt(words[i])))				continue;					this.version = words[i];				this.revision = parseInt(words[i + 1].substring(1));		    }		} else {		    this.installed = false;		}    }    else if (FlashControlInstalled != null) {		this.installed = FlashControlInstalled;		this.implementation = "ActiveX";		this.version = FlashControlVersion;		this.autoInstallable = true;    } else if (FlashDetectedSelf()) {		this.installed = true;		this.implementation = "Plug-in";		this.autoInstallable = false;    }    this.canPlay = FlashCanPlay;}/* MAIN FUNCTION *//* FlashSelect() -- get Flash Player status and redirect appropriately */function FlashSelect() {    var player = new FlashDetect()	var cooker	// boolean, used to know if set cookies or not    if (player.installed)  {	// Property says: Player is installed		if (player.canPlay(contentVersion)) {			cooker = true			location = contentURL;		} else {		    cooker = player.autoInstallable		    location = player.autoInstallable ? contentURL : upgradeURL;		}    }  else if (!player.installed)  {	// Property says: Player is not installed		location = installURL;	//  Send the user to the "install page"    } else if (player.installed == null) { // property can not be defined, so try with the self-detecting movie...		var embed_sniffer =          "<embed hidden=\"true\" type=\"application/x-shockwave-flash\"" +		  " width=\"500\" height=\"200\"" +		  " bgcolor=\"\#FFFFFF\"" +		  " src=\"" + snifferURL + "?" +		  "contentURL=" + contentURL + "&" +		  "contentVersion=" + contentVersion + "&" +		  "upgradeURL=" + upgradeURL + "\"" +		  " loop=\"false\" menu=\"false\"" +		  " pluginspage=\"" + FlashPluginsPage + "\"" +  ">" +	      "</embed>";		document.open();		document.write("<html><head><title>");		document.write("Checking for the Flash Player... Please wait.");		document.write("</title></head>");		document.write("<body bgcolor=\"\#FFFFFF\">");		document.write("<table width=\"100%\" height=\"80%\" border=\"0\"><tr align=\"center\" valign=\"middle\"><td>");		document.write(embed_sniffer);		document.write("</td></tr></table>");		document.write("</body>");		document.write("</html>");		document.close();    } else {								// Here choose one out of two...		location = installURL;	//  Send the user to the "install page"		// location = altURL;	//	Send the user to a standard HTML section of the site		    }	return cooker}/* FlashRememberIfDetectedSelf() -- record that Flash Player detected itself */function FlashRememberIfDetectedSelf() {    // the sniffer appends an empty search string to the URL to indicate that it is the referrer    if (document.location.search.indexOf("?") != -1) {   		var varFlashCookieExpires = new Date();		varFlashCookieExpires.setTime(varFlashCookieExpires.getTime() + 1000 * 60 * 60 * 24 * 365 );		document.cookie = 'FlashDetectedSelf=true ; expires=' + expires.toGMTString();    }}/********************************************************************* * THE FOLLOWING FUNCTIONS ARE NOT PUBLIC.  DO NOT CALL THEM DIRECTLY. *********************************************************************//* FlashCanPlay() -- check whether installed Flash Player can play content */function FlashCanPlay(contentVersion) {    var canPlay;    if (this.version) { 		canPlay = (parseInt(contentVersion) <= this.version)    } else {		canPlay = FlashDetectedSelf()    }    return canPlay;}/* FlashDetectedSelf() -- recall whether Flash Player has detected itself */function FlashDetectedSelf() {    return (document.cookie.indexOf("FlashDetectedSelf") != -1);}
