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

function innerFlash(){
	$('#main').css('display', 'block');
	$('#main-media').media({
		version: '9,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/',_idR:_idR},
		params: {
			allowScriptAccess: 'sameDomain',
			bgColor:"#000000",
			quality: 'high',
			allowFullScreen: true
		}
	});
}

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

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

				
