(function(){
	var domain = document.domain||"";
	var protocol = location.protocol;
	var base= "";
	if(protocol == "file:"){
		base = location.protocol+"//" + location.host+ "/" + location.pathname.replace(/web\/.*/,"web/");
	}else if(location.host != "www.dbfen.com"){
		base = location.protocol+"//" + location.host;
	}

	/********************** 全局配置信息 start 导出全局变量 **************/
	//取到页面url
	window.getBaseUrl = function(){
		return base;
	};
	//////全局配置参数  <<<<<<<<<<<<<<<<<<<<<<<<<<<
	window.gConfig = {
		environment: "",//环境 local本地,调用测试数据
		timeout: 30 //最大超时时间,单位秒
	};
	window.console = window.console || {
		log: function(msg){},
		error: function(msg){},
		warn: function(){}
	}

	/********************* 全局配置信息 end ************************/
	//增加string的trim方法,ie8没有此方法
	String.prototype.trim = String.prototype.trim || function(){
		return this.replace(/^(\s|\u00A0)+|(\s|\u00A0)+$/g, "");
	}

	seajs.config({
		base : base,
		alias : {
			//"jquery" : "js/v2/frame/jquery_1.8.3.min.js",
			/***********************jquery插件模块*****************/
			"lib/jquery/paginator"	: "js/frame/jquery/paginator.js?{version}",//分页模块,
			"lib/jquery/form"		: "js/frame/jquery/form.js?{version}",//分页模块,
			"lib/jquery/layer"		: "js/frame/jquery/layer/layer.js?{version}",//,
			"lib/jquery/cookie"		: "js/frame/jquery/cookie.js?{version}",//cookie插件
			"lib/jquery/iframe"		: "js/frame/jquery/iframe.js?{version}",//iframe插件
			"lib/jquery/ztree"		: "js/frame/jquery/ztree/ztree.js?{version}",//树导航插件
			"lib/jquery/select"		: "js/frame/jquery/select.js?{version}",//下拉框美化插件
			"lib/jquery/scrollbar"	: "js/frame/jquery/scrollbar.js?{version}",//滚动条美化插件
			"lib/jquery/mousewheel"	: "js/frame/jquery/mousewheel.js?{version}",//鼠标滑动
			"lib/jquery/titletip"	: "js/frame/jquery/titletip.js?{version}",//title美化插件
            "lib/jquery/zclip"	    : "js/frame/jquery/zclip.js?{version}",//复制

			//模板引擎 dot
			"lib/dot"					: "js/frame/dot.js?{version}",

			/** 工具插件 */
			"lib/util/tree"			: "js/frame/util/tree.js?{version}",//消息通信插件

			/***********************dbfen网站基础共用的抽象组件*****************/
			"dbfen/client/com/dbfen"	: "js/com/dbfen.js?{version}",//基础共用模块,
			"dbfen/client/com/stat"		: "js/com/stat.js",//基础统计模块,
            "dbfen/client/com/grade"	: "js/com/grade.js?{version}",//等级模块,

			/***********************dbfen网站基础共用的api*****************/
			"dbfen/client/api/user"			: "js/api/user.js?{version}",//用户模块,
			"dbfen/client/api/device"		: "js/api/device.js?{version}",//设备模块,
            "dbfen/client/api/system"		: "js/api/system.js?{version}",//设备模块,
            "dbfen/client/api/disaster"	    : "js/api/disaster.js?{version}",//容灾备份,
			"dbfen/client/api/setting"		: "js/api/setting.js?{version}",//全局环境设置模块,
			"dbfen/client/api/task"			: "js/api/task.js?{version}",//任务模块,
			"dbfen/client/api/task/mysql"	: "js/api/task.mysql.js?{version}",//mysql模块,
			"dbfen/client/api/task/mssql"	: "js/api/task.mssql.js?{version}",//mssql模块,
            "dbfen/client/api/task/file"	: "js/api/task.file.js?{version}",//文件模块,
            "dbfen/client/api/task/oracle"	: "js/api/task.oracle.js?{version}"//oracle模块
		},
		vars: {
			version:"21010013"
		}
	});
	//调用模块
	seajs.use(["dbfen/client/com/stat","dbfen/client/api/system", "dbfen/client/com/dbfen", "lib/jquery/layer", "lib/jquery/cookie"]);
})();