// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)



function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
	var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
	
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	   var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
		
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}
	return flashVersion;
}

flashVersion_DONTKNOW = -1;

var requiredVersion = 6;

function makeFlash(id,w,h,src,wmode,bg,fvar,hidecss,loadcss,tagstart,tagend)
	{
	if (flashVersion ==0)
		{flashVersion = getFlashVersion();}
	if (flashVersion >= requiredVersion)
		{	
			document.writeln(tagstart);
			document.writeln('<object id="'+id+'" width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">');
			document.writeln('<param name="menu" value="false"><param name="movie" value="'+src+'"><param name="wmode" value="'+wmode+'"><param name="bgcolor" value="'+bg+'"><param name="FlashVars" value="'+fvar+'">');
			document.writeln('<embed name="'+id+'" src="'+src+'" width="'+w+'" height="'+h+'" flashvars="'+fvar+'" wmode="'+wmode+'" bgcolor="'+bg+'" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
			document.writeln('</object>');
			document.writeln(tagend);
			if (hidecss!='')
				{
					document.writeln('<style type="text/css">');
					document.writeln(hidecss+'{display:none;}');
					document.writeln('</style>');
				}			
		}
		
	else
		{
			if (loadcss!='')
				{
					document.writeln('<style type="text/css">');
					document.writeln('@import url("/img/css/'+loadcss+'.css");');;
					document.writeln('</style>');					
				}
		}
	}
	
	var oInterval;
	var intervalSetted=false;
	var iActiveId = 0
	function fnShowHide(sDiv, sClassName)
	{
		if(document.getElementById(sDiv))document.getElementById(sDiv).className = sClassName
		
	}
	function fnOver(iId)
	{
		if(intervalSetted){
			clearTimeout(oInterval);
			intervalSetted=false;
		}
		fnShowHide('mt' + iActiveId, 'disp-none')
		iActiveId = iId
		fnShowHide('mt' + iActiveId, 'disp-block')
		
	}
	function fnOutTimeout()
	{
		if(intervalSetted){
			clearTimeout(oInterval);
			intervalSetted=false;
		}
		oInterval = setInterval("fnOut()",2000);
		intervalSetted=true;
	}
	function fnOut()
	{
		if(intervalSetted){
			clearTimeout(oInterval);
			intervalSetted=false;
		}
		fnShowHide('mt' + iActiveId, 'disp-none');
		iActiveId = 0;
	}

function clearit(obj, val){
	if(obj.value == val){
		obj.value = '';
	}
}

function fnShowHideLogin()
{
	if(document.getElementById('ul').className =='disp-block' ){fnShowHide('ul', 'disp-none')}else{fnShowHide('ul', 'disp-block')}
}


function SetClientFlashInfo() {
var flashScriptPage = "/SetExplorerInfo.aspx?type=";
flashVersion = getFlashVersion();
if (flashVersion >= requiredVersion)
	flashScriptPage = flashScriptPage + "flash";
else
	flashScriptPage = flashScriptPage + "jscript";

var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
		xmlhttp = new XMLHttpRequest();
	} catch (e) {
		xmlhttp=false;
	}
}
if (!xmlhttp && window.createRequest) {
	try {
		xmlhttp = window.createRequest();
	} catch (e) {
		xmlhttp=false;
	}
}

	xmlhttp.open("GET", flashScriptPage, true);
/*	xmlhttp.onreadystatechange=function() {
	if (xmlhttp.readyState==4) {
	alert(xmlhttp.responseText)
	}
	}*/
	xmlhttp.send(null)
}			

function makeFlashForSplash(id,w,h,src,wmode,bg,fvar,hidecss,loadcss,tagstart,tagend)
	{
	if (flashVersion ==0)
		{flashVersion = getFlashVersion();}
	if (flashVersion >= requiredVersion)
		{	
			document.writeln(tagstart);
			document.writeln('<object id="'+id+'" width="'+w+'" height="'+h+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0">');
			document.writeln('<param name="menu" value="false"><param name="menu" value="false"><param name="movie" value="'+src+'"><param name="wmode" value="'+wmode+'"><param name="bgcolor" value="'+bg+'"><param name="FlashVars" value="'+fvar+'">');
			document.writeln('<embed name="'+id+'" src="'+src+'" width="'+w+'" height="'+h+'" flashvars="'+fvar+'" wmode="'+wmode+'" bgcolor="'+bg+'" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
			document.writeln('</object>');
			document.writeln(tagend);		
		}
		
	else
		{
			document.location.href = 'splash.htm';
		}
	}
	
function checkMainPageMiddleFlash(mainFlashHtmlPlaceholderControlId,hidecss)
	{
	if (flashVersion ==0)
		{flashVersion = getFlashVersion();}
	if (flashVersion >= requiredVersion)
	{	
		if (hidecss!='')
		{
			document.writeln('<style type="text/css">');
			document.writeln(hidecss+'{display:none;}');
			document.writeln('</style>');
		}			
	}		
	else
		{
			if (document.getElementById(mainFlashHtmlPlaceholderControlId) != null){
				document.getElementById(mainFlashHtmlPlaceholderControlId).style.display = 'none';
				//document.removeChild(document.getElementById(mainFlashHtmlPlaceholderControlId));
			}
		}
	}
