var FlashVersion = 0;
var IsIE = 0;

function init() {	
	if (navigator.plugins &&
	    navigator.plugins.length > 0 &&
	    navigator.plugins["Shockwave Flash"]) {
	
	    var WordList = navigator.plugins["Shockwave Flash"].description.split(" ");
	
	    for (var index = 0; index < WordList.length; ++index) {
	        if (isNaN(parseInt(WordList[index])))  continue;
	        FlashVersion = WordList[index];
	    }
	}	
	
	if ((FlashVersion < 6) || (!bShowSite)) showFallback();
	
	logFlashVersion(FlashVersion);	
} 


function logFlashVersion(ver) {
    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') {
		xmlhttp = new XMLHttpRequest();
	}

	if (xmlhttp) {
		xmlhttp.open("GET", "/all/statistic/flash/?version=" + ver + "&statistic=v2", true);
		xmlhttp.send(null);
	}
}	

function showSite() {
	var sProps = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,left=" + Math.round((screen.width - iWidth) / 2) + ",top=" + Math.round((screen.height - iHeight) / 2) + ",width=" + iWidth + ",height=" + iHeight;
	var sSiteURL = "flash/default.asp?";
	sSiteURL = sSiteURL + "language=" + escape(sLanguage);
	sSiteURL = sSiteURL + "&market=" + escape(sMarket);
	sSiteURL = sSiteURL + "&browser=" + escape((IsIE == 1) ? "ie" : "other");	
	sSiteURL = sSiteURL + "&instance=" + escape(sInstance);
	sSiteURL = sSiteURL + "&variant=" + escape(sVariant);
	sSiteURL = sSiteURL + "&section=" + escape(sSection);
	sSiteURL = sSiteURL + "&bandwidth=dsl";			
	sSiteURL = sSiteURL + "&width=" + escape(iWidth);	
	sSiteURL = sSiteURL + "&height=" + escape(iHeight);	
	var site = window.open(sSiteURL,"site", sProps);
	site.focus();		
}

function showFallback() {
	window.document.getElementById("buttons").style.display = "none";
	window.document.getElementById("introText1").style.display = "none";
	window.document.getElementById("introText2").style.display = "none";
	window.document.getElementById("fallback").style.display = "block";
}