var scale=false;
if (isMobile()) {
	window.location.href = 'no-flash.html';
} else if (!DetectFlashVer(8, 0, 0)) {
	window.location.href = 'no-flash.html';
} else {
	$(document).ready(function(){
		if (isNewWindow()) {
			if (window.opener) {
				scale=true;
				innerFlash();
				window.opener.location.href = 'splash.html';
				var windowWidth = getWindowWidth();
				var windowHeight = getWindowHeight();
				window.moveTo((screen.width / 2) - (windowWidth / 2 )+ 4, (screen.height / 2) - (windowHeight / 2 )+ 30);
			} else {
				scale=true;
				checkWindow();
				setTimeout(function() {
					window.location.href = 'splash.html';
				}, 10000);
			}
		} else {
			scale=false;
			innerFlash();
		}		
	});
}

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;
	}
}

function innerFlash(){
	$('#main').css('display', 'block');
	$('#main-media').media({
		version: '10,0', width: '100%', height: '100%', autoplay: true,
		src: 'main.swf',	
		caption: false,
		attrs: { id: 'flashSite'},
		params: {
						
			scale: ((scale)?'showall':'noscale'),
			allowScriptAccess: 'sameDomain',
			allowFullScreen: true,
			bgColor: "#0A5737",
			quality: 'high'					
		}
					
	});
}