//設定クラス
function Core(){
	
	//コンストラクタ
	this.constructor = function(){
		this.Data = [];
		this.Main = null;
		this.TypeClass = 1;
		this.TypeID = 2;
		this.TypeName = 1;
		BaseJsLoaded = true;
	}
		
	//設定データ構造取得
	this.GetDataStruct = function(){
		var DataStruct = {
			Name:null,
			Value:null,
			Init:null,
			Buff:null,
			flg:false,
			Type:null,
		}
		
		return DataStruct;
	}
	
	//要素作成
	this.CreateElm = function(Tag,Key){
		var elm = document.createElement(Tag);
		elm.id = Key;
		return elm;
	}
	
	//要素取得
	this.Elm = function(Key,Type=null){
		var res = null;
		var classFlg = (Key.indexOf("#")!==-1);
		var idFlg = (Key.indexOf(".")!==-1);
		var nameFlg = (Key.indexOf("&")!==-1);
		if(classFlg||(Type==1)){
			if(classFlg)Key = Key.substr(1,Key.length-1);
			res = document.getElementsByClassName(Key);
		}
		else if(idFlg||(Type==2)){
			if(idFlg)Key = Key.substr(1,Key.length-1);
			res = document.getElementById(Key);
		}
		else if(nameFlg||(Type==3)){
			if(nameFlg)Key = Key.substr(1,Key.length-1);
			res = document.getElementsByName(Key);
		}
		else{
			res = document.getElementsByTagName(Key);
		}
		
		return res;
	}
	
	//初期化処理
	this.Initailize = function(DataList){
		//データ設定
		for(var loop=0;loop<DataList.length;loop++){
			this.AddData(DataList[loop],DataList[loop].type);
		}
	}
	
	//データ追加
	this.AddData = function(Data,Type=null){
		Data.Type = Type
		this.Data[Data.Name] = Data;
	}
	
	//データ取得
	this.GetData = function(Key,Type=null){
		var res = null;
		if(this.Data[Key]!=undefined){
			if(this.Data[Key].Type == Type)res = this.Data[Key];
		}
		return res;
	}
	
}