var is_flash   = false;

var is_flash_2 = false;
var is_flash_3 = false;
var is_flash_4 = false;
var is_flash_5 = false;
var is_flash_6 = false;
var is_flash_7 = false;
var is_flash_8 = false;
var is_flash_9 = false;

var flash_ver  = false;

var detect_min_ver = 2;
var detect_max_ver = 9;

function detectIE() {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	for( var count = detect_min_ver; count <= detect_max_ver; count++ ) {
		document.write( 'is_flash_' + count + ' = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.' + count + '"))) \n' );
	}
	document.write('<\/SCR' + 'IPT\> \n');
	for( var count = detect_min_ver; count <= detect_max_ver; count++ ) {
		if( eval('is_flash_' + count ) == true ) {
			flash_ver = count;
		}
	}
	if( flash_ver > 0 ) {
		is_flash = true;
	}
}

function detectNS() {
	if( navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash'] ) {
		var is_version_2 = navigator.plugins['Shockwave Flash 2.0'] ? ' 2.0' : "";
		var flash_description = navigator.plugins['Shockwave Flash' + is_version_2].description;
		var flash_version = parseInt( flash_description.substring( 16 ) );
		if( flash_version > 0 ) {
			flash_ver = flash_version;
			is_flash = true;
		}
	}
}

function detect() {

	if( navigator.plugins ) {
		detectNS();
	} 
	if( ( ! is_flash ) && navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && ( navigator.appVersion.indexOf( 'Win' ) != -1 ) ) {
		detectIE();
	}
	
}

detect();

if( ! oClientInfo ) {
	
	var oClientInfo = new ClientInfo();
	
}

if( ! ( oClientInfo.is_ie5_5up || oClientInfo.is_gecko ) ) {
	
	if( FLASH_MODE ) { 
		window.location.href = ROOT_URL + 'index.php/' + SITE_LANG + '/nobrowser/';
	}
	
} else if( ! ( is_flash && ( flash_ver >= 7 ) ) ) {
		
	if( FLASH_MODE || NO_BROWSER ) {
		window.location.href = ROOT_URL + 'index.php/' + SITE_LANG + '/noflash/';
	}
	
} else {

	if( ! FLASH_MODE ) {
		window.location.href = ROOT_URL + 'flash.php/' + SITE_LANG + '/' + ( ( FLASH_SCENE.length > 0 ) ? ( FLASH_SCENE + '/' ) : '' );
	}

}