var requiredVersion = 6;			
var useRedirect = true; 			
var flashPage = "eStore,wciProcess,HomeFlash.html";
var noFlashPage = "eStore,wciProcess,HomeNoFlash.html";
var upgradePage = "eStore,wciProcess,HomeNoFlash.html";

var flash2Installed = false;		
var flash3Installed = false;		
var flash4Installed = false;		
var flash5Installed = false;		
var flash6Installed = false;		
var maxVersion = 6;				
var actualVersion = 0;				
var hasRightVersion = false;		
var jsVersion = 1.0;			
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;		
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; 
jsVersion = 1.1;
if(isIE && isWin){ 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \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('</SCR' + 'IPT\> \n'); 
}
function detectFlash(){	

	if (navigator.plugins){							
		if (navigator.plugins["Shockwave Flash 2.0"] 	
		|| navigator.plugins["Shockwave Flash"]){		

			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;		
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
		}
	}
	
	for (var i = 2; i <= maxVersion; i++) {	
		if (eval("flash" + i + "Installed") == true) actualVersion = i;
	}
		if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;	
	
	if (actualVersion >= requiredVersion) { 	
		hasRightVersion = true;						
		

	} else {	
		hasRightVersion = false;
	}
   return (hasRightVersion);
}

function BrowserInfo() { 
  var agent = navigator.userAgent.toLowerCase(); 
  this.major = parseInt(navigator.appVersion); 
  this.minor = parseFloat(navigator.appVersion); 
  this.op = (agent.indexOf("opera")!= -1); 
} 

function GetBannerHorizPos() {
  //Some Browser Detection 
  var is = new BrowserInfo(); 
  //Determine the Available Width on the page 
  var fWidth; 

  //For old IE browsers 
  if(document.all)
    fWidth = document.body.clientWidth; 
  //For DOM1 browsers 
  else if(document.getElementById &&!document.all) 
     fWidth = innerWidth; 
  else if(document.getElementById) 
    fWidth = innerWidth; 
  //For Opera 
  else if (is.op) 
    fWidth = innerWidth; 
  //For old Netscape 
  else if (document.layers) 
    fWidth = window.innerWidth; 
  var layerleft; 

  //alert("Width = " + fWidth);
  layerleft = (fWidth - 764) / 2;
  if (layerleft < 0)
    layerleft = 0;
  return(layerleft);
}


function RepositionBanner() {
  //if NS4.7, reload the page (which will reposition the item anyway). 
  //Note, some NS versions have a bug that calls a resize event upon
  //loading the page, which would lead to an endless loop, thus the timeout.
  if(document.layers)
     setTimeout('location.reload()', 1000);
  else { 
    el = document.getElementById('etoile');
    var layerleft = GetBannerHorizPos();
    el.style.left = layerleft + 'px';
    el.style.visibility = 'visible';
    el.visibility = 'show';
    }
}

function ShowFloatingBanner() {
  var layerleft = GetBannerHorizPos(); 

   if (detectFlash()) {
   document.write('<div id="etoile" style="position:absolute; width:765px;height:227px; z-index:1; left: ' + layerleft + 'px; top: 0px; visibility: visible;">');
   document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase=');
   document.write('"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=');
   document.write('6,0,0,0" WIDTH="765" HEIGHT="227" ALIGN="">');
   document.write('<PARAM NAME=movie VALUE="fleur.swf">');
   document.write('<PARAM NAME=quality VALUE=high>');
   document.write('<PARAM NAME=wmode VALUE=transparent>');
   document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
   document.write('<param name="LOOP" value="false">');
   document.write('<EMBED src="etoile.swf" WIDTH="765" HEIGHT="227" loop="false"ALIGN="" quality=high wmode=transparent bgcolor=#FFFFFF TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
   document.write('</EMBED>');
   document.write('</OBJECT>');
   document.write('</div>');
   window.onresize = RepositionBanner;
   }
}
