APPID = 1;
WINID = 1;
CONID = 1;
WININDEX = 2;
THEME = 'elite';
TASK = {};
// --- EVENT ---
RESOLUTIONCHANGE = {};

function perpImg(src, func) {
	$('<img src="'+src+'?v='+FA_VERSION+FA_FIXPACK+'">').appendTo('#perpimg').on('load', func);
}
$.fn.extend({     
	center:function() {     
		this.css({'left':$(window).width()/2-this.outerWidth()/2+'px','top':$(window).height()/2-this.outerHeight()/2+'px'});
		return this;
	}     
});
$(document).ready(function(e) {
	//if(navigator.userAgent.indexOf("Chrome")!=-1 || navigator.userAgent.indexOf("Firefox")!=-1) {
	if(navigator.userAgent.indexOf("Chrome")!=-1) {
		$('#notChrome').html('Okey, please wait...');
		perpImg('images/start-logo.png', function() {
			$('#tb,#notChrome').remove();
			$('#startlogo').show().css({'animation':'startlogoAni 1s linear forwards'}).center();
			setTimeout(function() {
				$('#startlogoLight').css({'animation':'startlogoLightAni 5s ease infinite'});
				$('#loadingBar').css({'top':$('#startlogo').outerHeight()+$('#startlogo').offset().top+70+'px','left':$('#startlogo').offset().left+50+'px'}).fadeIn(500, function() {
					// --- 加载程序 ---
					$.ajax({type:'GET',cache:false,url:'apps/com.elitecloud.system/boot.js?v='+FA_VERSION+FA_FIXPACK,dataType:'script'});
				});
			}, 1000);
		});
	}
}).on('contextmenu', function() {
	return false;
});
$(window).on('resize', function() {
	$('#startlogo').center();
	$('#loadingBar').css({'top':$('#startlogo').outerHeight()+$('#startlogo').offset().top+70+'px','left':$('#startlogo').offset().left+50+'px'});
});