if (isMobile()) {
	window.location.href = 'mobile.htm';
} else if (!DetectFlashVer(9, 0, 0)) {
	window.location.href = 'no-flash.htm';
} else {
	$(document).ready(function(){
		if (isNewWindow()) {
			if (window.opener) {
				innerFlash();
				window.opener.location.href = 'splash.htm';
				var windowWidth = getWindowWidth();
				var windowHeight = getWindowHeight();
				window.moveTo((screen.width / 2) - (windowWidth / 2 + 4), (screen.height / 2) - (windowHeight / 2 + 30));
			} else {
				checkWindow("index.html")

				setTimeout(function() {
					window.location.href = 'splash.htm';
				}, 1000);
			}
		} else {
			innerFlash();
		}		
	});
}

function innerFlash(){
	$('#main').css('display', 'block');
	$('#main-media').media({
		version: '8,0', width: '100%', height: '100%', autoplay: true, src: 'swf/site.swf',	caption: false,
		attrs: { id: 'flashSite'},
		flashvars: { 'lg': _lg, 'urlBase': _url, 'urlSwf': _url + 'site/swf/'},
		params: {
			allowScriptAccess: 'sameDomain',
			bgColor:"#000000",
			quality: 'high'
		}
	});
}

function isMobile(){
	if (screen.width < 400){
		return true;
	}
}

function isNewWindow(){
	if (screen.width > maxWidth || screen.width < maxHeight){
		return true;
	}
}