if (isMobile()) {
	window.location.href = 'mobile.htm';
} else if (!DetectFlashVer(8, 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();
				setTimeout(function() {
					window.location.href = 'splash.htm';
				}, 5000);
			}
		} 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},
		params: {
			allowScriptAccess: 'sameDomain',
			allowFullScreen: true,
			bgColor:"#ffffff",
			quality: 'high'
		}
	});
}

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


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