$(document).ready(function(){
	if (!DetectFlashVer(8, 0, 0)) {	
	   window.location.href = 'no-flash.html';
	   return;
	}
	
	if (isNewWindow()){
		if(window.opener){
			innerFlash();
		} else {
			var tempUrl = window.location.href;	
			window.location.href = 'splash.htm';
			callOpen(tempUrl, screen.availWidth-8, screen.availHeight-33);
		}		
	} else {
		innerFlash();
	}
});	

function innerFlash(){	
		$('#main').css('display', 'block');
		$('#main-media').media({
			version: '8,0', width: '100%', height: '100%', autoplay: true, src: 'swf/base.swf',	caption: false,
			flashvars: { 'lg': 'pt', 'urlBase': ''},
			//<?php echo @$_REQUEST['lg']; ?>
			attrs: { id: 'flashSite'},
			params: {
				allowScriptAccess: 'sameDomain',
				//wmode: 'transparent',	
				bgColor:"#041936",	
				//menu: false, 
				quality: 'high'					
			}
		});
}

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

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

function callOpen(openPage, width, height){
	window.open(openPage, "unaeventos", "'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=0,width="+width+",height="+height+ "'");
}
