var Param = {

	host_url : "/icss-web",

    /**
	 * 应用名
	 */
	ctx : "/icss-web",
	/**
	 * 页面缓存对象
	 */
	storage : window.localStorage,
	/**
	 * uri所有参数Json方式存储
	 */
	uriParams : {},
	/**
	 * 缺省读取问诊信息请求URI
	 */
	questionInitActionUri : "",
	/**
	 * 缺省读取问诊信息
	 */
	methodType : "new",
	/**
	 * 用户相关信息
	 */
	user : {
		loginId: "",
		name: "",
		appId: null,
		resource: "pc",
		token:""
	},
	/**
	 * 列表属性设置
	 */
	lang : {
		"sProcessing": "处理中...",
		"sLengthMenu": "每页 _MENU_ 项",
		"sZeroRecords": "没有匹配结果",
		"sInfo": "当前显示第 _START_ 至 _END_ 项，共 _TOTAL_ 项。",
		"sInfoEmpty": "当前显示第 0 至 0 项，共 0 项",
		"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
		"sInfoPostFix": "",
		"sSearch": "搜索:",
		"sUrl": "",
		"sEmptyTable": "表中数据为空",
		"sLoadingRecords": "载入中...",
		"sInfoThousands": ",",
		"oPaginate": {
			"sFirst": "首页",
			"sPrevious": "上页",
			"sNext": "下页",
			"sLast": "末页",
			"sJump": "跳转"
		},
		"oAria": {
			"sSortAscending": ": 以升序排列此列",
			"sSortDescending": ": 以降序排列此列"
		}
	},
		  
	/**
	 * 初始化请求uri参数
	 */
	initUriParam : function (uri) {
		Param.uriParams = {};
		Param.uriParamSplit(uri);
	},

	/**
	 * 初始化页面参数
	 */
	initPageParam : function() {
		var uri = window.parent.location.search;
		Param.indexUriParamSplit(uri);
	},
/**
	 * 表单ajax提交参数定义
	 */
	formPost : {
		isToken: true,
		formName: '.form-horizontal',
		url: '',
		callback: {}
	},
	/**
	 * 一般ajax提交参数定义
	 */
	normalPost : {
		isToken: true,
		p: {},
		url: '',
		callback: {}
	},
	
	/**
	 * uri参数转Json对象
	 */
	indexUriParamSplit : function (uri) {
		if (uri.indexOf("?") == -1) return;
		uri = uri.substr(uri.indexOf("?") + 1);
		var uriParamArray = uri.split("&");

		var p = {};
		var p_json = {};
		$.each(uriParamArray, function(i, item) {
			p = item.split("=");
			p_json[p[0]]=p[1];
			Param.uriParams = $.extend(Param.uriParams, p_json);
		});
	},
	
	/**
	 * uri参数转Json对象
	 */
	uriParamSplit : function (uri) {
		if (uri.indexOf("?") == -1) return;
		uri = uri.substr(uri.indexOf("?") + 1);
		var uriParamArray = uri.split("&");
		var p = {};
		var p_json = {};
		$.each(uriParamArray, function(i, item) {
			p = item.split("=");
			p_json[p[0]]=p[1];
			var contentId = getContentId();
			if (contentId == "") {
				Param.uriParams = $.extend(Param.uriParams, p_json)
			} else{
				!Param.uriParams[contentId] && (Param.uriParams[contentId]={});
				Param.uriParams[contentId] = $.extend(Param.uriParams[contentId], p_json);
			}
			
		});
	},
	
	clear : function(id){
		if(Param.uriParams[id]){
      delete Param.uriParams[id];
		}
	},
	
	copy : function(param,id){
		Param.uriParams[id] = param;
	},
	
	getParam : function(paramName,contentId){
		!contentId&&(contentId = getContentId());
		if (Param.uriParams[contentId] && paramName in Param.uriParams[contentId]){
			return Param.uriParams[contentId][paramName];
		}else{
			return Param.uriParams[paramName];
		}
	},
	
	setParam : function(param,contentId){
		!contentId&&(contentId = getContentId());
		!Param.uriParams[contentId] && (Param.uriParams[contentId]={});
		$.extend(Param.uriParams[contentId],param);
	},
	
	/**
	 * 登录后页面保存返回信息
	 * @param data
	 */
	initPageUser : function (data) {
		Param.user.loginId = data.loginId;
		Param.user.name = data.name;
		Param.user.appId = data.appId;
		Param.user.resource = data.resource;
		Param.user.token = data.token;
        Param.user.loginUnitId = data.loginUnitId;
	},
};