<!--
// flashDetect script v1.1
// detection vars
var f2 = false;
var f3 = false;
var f4 = false;
var f5 = false;
var f6 = false;
var actualVer = 0;
var correctVer = false;

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  document.write('f2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
  document.write('f3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
  document.write('f4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
  document.write('f5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
  document.write('f6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
  document.write('</SCR' + 'IPT\> \n');
}

function flashDetect(minVer, maxVer) {
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {
      var isVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVer2].description;
      var flashVer = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
      f2 = flashVer == 2;    
      f3 = flashVer == 3;
      f4 = flashVer == 4;
      f5 = flashVer == 5;
      f6 = flashVer >= 6;
    }
  }
  
  for (var i = 2; i <= maxVer; i++) {  
    if (eval("f" + i) == true) actualVer = i;
  }

  if(navigator.userAgent.indexOf("WebTV") != -1) actualVer = 3;  

  if (actualVer >= minVer) {
	correctVer = true;         
  } else {  

  }
}

function displayContent(minVer, fParams, imgParams, imgLink){
	if(correctVer) {
		var undefined;
		if(fParams["width"] === undefined){
			fWidth = 1;
		}else{
			fWidth = fParams["width"];
		}
		if(fParams["height"] === undefined){
			fHeight = 1;
		}else{
			fHeight = fParams["height"];
		}
		if(fParams["id"] === undefined){
			fId = "flash01"
		}else{
			fId = fParams["id"];
		}
		//generate codebase
		var codebase = "";
		switch(minVer){
			case 2:
				codebase = "http://active.macromedia.com/flash2/cabs/swflash.cab#version=2,0,0,12";
				break;
			case 3:
				codebase = "http://active.macromedia.com/flash2/cabs/swflash.cab#version=3,0,0,0";
				break;
			case 4:
				codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,28,0";
				break;
			case 5:
				codebase = "http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0";
				break;
			case 6:
				codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0";
				break;
			default:
				codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0";
				break;
		}
		
		// build object tag
		var flashTag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="'+codebase+'" width="'+fWidth+'" height="'+fHeight+'" id="'+fId+'">';
		var embedTag = "";
		flashSrc = fParams["movie"];
		flashTag += '<param name="movie" value="'+flashSrc+'">';
		for (param in fParams){
			if (param != "height" && param != "width" && param != "id" && param != "movie"){
				flashTag += '<param name="'+param+'" value="'+fParams[param]+'">';
				embedTag += ' '+param+'="'+fParams[param]+'"';
			}
		}
		//build embed tag
		flashTag += '<embed src="'+flashSrc+'" height="'+fHeight+'" width="'+fWidth+'" name="'+fId+'" '+embedTag+' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
		flashTag += '</object>';
		document.write(flashTag);
	}else{
		var startLinkTag = "";
		var endLinkTag = "";
		if (imgLink != ""){
			startLinkTag = '<a href=\"'+imgLink+'">';
			endLinkTag = '</a>';
		}
	    var imgTag = startLinkTag+'<img';
		for (param in imgParams){
			imgTag += ' '+param+'="'+imgParams[param]+'"';
		}
		imgTag += '>'+endLinkTag;
	    document.write(imgTag);
	}
}

function dfSetup(minFlashVer, maxFlashVer, fParameters, iParameters, iLnk){
	// init vars
	actualVer = 0;
	correctVer = false;
	// call functions
	flashDetect(minFlashVer, maxFlashVer);
	displayContent(minFlashVer, fParameters, iParameters, iLnk);
}
//-->
