var maxVersion = 7;             // highest version we can actually detect
for (var i = 2; i <= maxVersion; i++) 
  eval("var flash" + i + "Installed = false");
  
var actualVersion = 0;          // version the user really has
var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
var jsVersion = 1.0;            // the version of javascript supported
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows

// This is a js1.1 code block, so make note that js1.1 is supported.
jsVersion = 1.1;

// Write vbscript detection on ie win. IE on Windows doesn't support regular
// JavaScript plugins array detection.
if(isIE && isWin){
  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  document.write('on error resume next \n');
  for (var i = 2; i <= maxVersion; i++) 
	document.write('flash'+i+'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))) \n');
	
  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
  for (var i = 2; i <= maxVersion; i++) {  
	  if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
}
else
{
	var flashVersion = 0
  // If navigator.plugins exists...
  
  if (navigator.plugins) {
  
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {
        
		//alert (navigator.plugins["Shockwave Flash"])
      // Some version of Flash was found. Time to figure out which.
      
      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);
      
      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      // We can get the major version by grabbing the character before the period
      // note that we don't bother with minor version detection. 
      // Do that in your movie with $version or getVersion().
      actualVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
     
      // We found the version, now set appropriate version flags. Make sure
      // to use >= on the highest version so we don't prevent future version
      // users from entering the site.
    }
  }
}
function detectFlash() {  		
	
	if (m_flaVer != '') return;
	
	var str = window.location.search;
	if (str =="") {
		// no param then just add lengue_id
		str   = window.location.host +window.location.pathname+"?flaVer="+actualVersion
	}
	else{	
		str   = window.location.host +window.location.pathname+window.location.search+"&flaVer="+actualVersion
	}	
	//alert("str   " + str )
	
	window.location.assign("http://"+str)
}