/* detectFlash
* by Wojtek Tilbury
*/

// ** Detect Flash 5.0 Player or use 'FlashRenderOption' cookie **

	var UseFlash = 0;
	if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ) {
		// Check for Flash version 5 or greater in Netscape
		var plugin = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
		if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=5)
			UseFlash = 1;
	} else if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && 
		  navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
		  // Assume any Windows IE except for Windows 3.1 supports the OBJECT tag
		  UseFlash = 1;
	}
	// Allow the cookie to override
	if (document.cookie && (document.cookie.indexOf("FlashRenderOption=P") >= 0)) {
		UseFlash = 1;
	} else if (document.cookie && (document.cookie.indexOf("FlashRenderOption=I") >= 0)) {
		UseFlash = 0;
	}

	// Call this function to set the cookie for the media type (Flash)
	function SetCookieType(ctype, newurl){
		document.cookie='FlashRenderOption='+ctype+';path=/;'
		if (newurl=="") {
			if ( navigator.appName.indexOf("Microsoft") != -1 ) {
				parent.history.go(0);
			} else if ( navigator.userAgent.indexOf("Mozilla/2") != -1 ) {
				parent.location = parent.location;
			} else {
				parent.location.reload(); }
		} else {
			parent.location = newurl;
		}
	}

//end
