function MyTouch(){
	MyTouch.prototype.constructor = function(){
		MyTouch.prototype.Menu = "lbMenu";
		MyTouch.prototype.IDDayTime = "DayTime";
		MyTouch.prototype.IDOrgasm = "Orgasm";
		MyTouch.prototype.CommandOrgasm = "OrgasmCommnd";
		MyTouch.prototype.CommandMove = "move";
		MyTouch.prototype.CommandNextArea = "nextarea";
		MyTouch.prototype.CommandBeforeArea = "beforearea";
		MyTouch.prototype.CommandTalk = "talk";
		MyTouch.prototype.CommandTalk2 = "talk2";
		MyTouch.prototype.CommandLock = "lock";
		MyTouch.prototype.CommandLock2 = "lock2";
		MyTouch.prototype.CommandItem = "item"
		MyTouch.prototype.CommandStore = "store";
		MyTouch.prototype.CommandSleep = "sleep";
		MyTouch.prototype.CommandSex = "sex";
		MyTouch.prototype.CommandEat = "eat";
		MyTouch.prototype.CommandOnani = "onani";
		MyTouch.prototype.CommandWaer = "waer";
		MyTouch.prototype.CommandWaer2 = "waer1";
		MyTouch.prototype.CommandWaer3 = "waer2";
		MyTouch.prototype.CommandWaer4 = "waer3";
		MyTouch.prototype.CommandUnder = "under";
		MyTouch.prototype.CommandUnder2 = "under2";
		MyTouch.prototype.CommandMakuru = "makuru";
		MyTouch.prototype.CommandMakuruW = "makuru1";
		MyTouch.prototype.CommandMakuruU = "makuru2";
		MyTouch.prototype.CommandMakuruR = "makuru3";
		MyTouch.prototype.CommandKigaeru = "kigaeru";
		MyTouch.prototype.CommandKigae1 = "kigae1";
		MyTouch.prototype.CommandNugu = "nugu";
		MyTouch.prototype.CommandNugasu = "nugasu";
		MyTouch.prototype.CommandSounyuu = "sounyuu";
		MyTouch.prototype.CommandShasei = "shahsei";
		MyTouch.prototype.CommandBoxnone = "boxnone";
		MyTouch.prototype.CommandBattle = "battle";
		MyTouch.prototype.CommandStatus = "Status";
		MyTouch.prototype.CommandNextDay = "nextday";
		MyTouch.prototype.CommandOption = "Option";
		MyTouch.prototype.CommandBtlAttack = "Attack";
		MyTouch.prototype.CommandBtlItem = "BattleItem";
		MyTouch.prototype.Commandjanken = "janken";
		MyTouch.prototype.CommandGuard = "Guard";
		MyTouch.prototype.CommandBtlEscape = "Escape";
		MyTouch.prototype.MenuMove = "movemenu";
		MyTouch.prototype.CommandReturn = "Return";
		MyTouch.prototype.CommandMenuReturn = "menuRetrun";
		MyTouch.prototype.MsgBox = "msgBox";
		MyTouch.prototype.messageCount = 0;
		MyTouch.prototype.Message = [];
		MyTouch.prototype.OpeningFlg = true;
		MyTouch.prototype.fontSize = "10.5pt";
		MyTouch.prototype.paddings = "5pt";
		MyTouch.prototype.NextAreaFlg = false;
		MyTouch.prototype.BeforeAreaFlg = false;
	}
	this.constructor();
	
	//枠＆タッチ設定
	MyTouch.prototype.setBoxTouch = function(parent){
		this.mainMenu(parent);
		this.messageBox(parent);
	}

	//ボックス生成共通
	MyTouch.prototype.setCommonBox = function(parent,menuId="",xpos="0px",ypos="0px"){
		if((typeof parent)=="string")parent = _self.Elm(parent,_self.TypeID);
		var elm_div = _self.GetInitBox();
		elm_div.x = xpos;
		elm_div.y = ypos;
		elm_div = _self.SetBoxParam(elm_div,menuId,"120px");
		elm_div.linecolor = "solid 1px #C0C0C0";
		_self.AddBoxData(elm_div);
		if(Array.isArray(parent))_self.SettingBox(parent[0],elm_div.Name,"");
		if(!Array.isArray(parent))_self.SettingBox(parent,elm_div.Name,"");
		_self.Elm("."+menuId).style.fontSize = myBT.fontSize;
		_self.Elm("."+menuId).style.paddings = "2px;";
		_self.Elm("."+menuId).style.borderRadius="5px";
	}
	
	//メインメニュー
	MyTouch.prototype.mainMenu = function(parent){
		myBT.setCommonBox(parent,"debug","10px");
		myBT.setCommonBox(parent,"menu1","10px");
		_self.Elm("menu1",_self.TypeID).classList.add("mainmenu");
		_self.AddCommand("menu1",myBT.Menu,"コマンド");
		_self.AddCommand("menu1",myBT.CommandMove,"移動");
		_self.AddCommand("menu1",myBT.CommandNextArea,"次の階へ");
		_self.AddCommand("menu1",myBT.CommandBeforeArea,"前の階へ"); 
		_self.AddCommand("menu1",myBT.CommandTalk,"話す");
		_self.AddCommand("menu1",myBT.CommandTalk2,"命令/行動");
		_self.AddCommand("menu1",myBT.CommandLock,"見る");
		_self.AddCommand("menu1",myBT.CommandItem,"道具");
		_self.AddCommand("menu1",myBT.CommandStore,"露店");
		_self.AddCommand("menu1",myBT.CommandSleep,"寝る");
		//_self.AddCommand("menu1",myBT.CommandRest,"休憩");
		_self.AddCommand("menu1",myBT.CommandBattle,"敵を探す");
		_self.AddCommand("menu1",myBT.CommandSex,"押し倒す");
		_self.AddCommand("menu1",myBT.CommandEat,"食事");
		_self.AddCommand("menu1",myBT.CommandOnani,"オナニー");
		_self.AddCommand("menu1",myBT.CommandMakuru,"捲る");
		_self.AddCommand("menu1",myBT.CommandMakuruW,"シャツを捲る");
		_self.AddCommand("menu1",myBT.CommandMakuruU,"スカートを捲る");
		_self.AddCommand("menu1",myBT.CommandMakuruR,"戻る");
		_self.AddCommand("menu1",myBT.CommandKigaeru,"着替える");		
		_self.AddCommand("menu1",myBT.CommandKigae1,"ネグリジェ");		
		_self.AddCommand("menu1",myBT.CommandNugu,"脱衣");
		_self.AddCommand("menu1",myBT.CommandNugasu,"脱がす");
		_self.AddCommand("menu1",myBT.CommandSounyuu,"挿入");
		_self.AddCommand("menu1",myBT.CommandShasei,"射精");
		_self.AddCommand("menu1",myBT.CommandWaer,"ローブ");
		_self.AddCommand("menu1",myBT.CommandWaer2,"ブラウス");
		_self.AddCommand("menu1",myBT.CommandWaer3,"スカート");
		_self.AddCommand("menu1",myBT.CommandWaer4,"タイツ");
		_self.AddCommand("menu1",myBT.CommandUnder,"ブラジャー");
		_self.AddCommand("menu1",myBT.CommandUnder2,"パンティー");
		_self.AddCommand("menu1",myBT.CommandBoxnone,"枠を消す");
		_self.AddCommand("menu1",myBT.CommandStatus,"ステータス");
		_self.AddCommand("menu1",myBT.CommandNextDay,"次の日へ");
		_self.AddCommand("menu1",myBT.CommandOption,"オプション");
		_self.AddCommand("menu1",myBT.CommandBtlAttack,"戦う");
		_self.AddCommand("menu1",myBT.Commandjanken,"勝負！");
		_self.AddCommand("menu1",myBT.CommandLock2,"視姦");
		_self.AddCommand("menu1",myBT.CommandGuard,"守る");
		_self.AddCommand("menu1",myBT.CommandBtlItem,"アイテム");
		_self.AddCommand("menu1",myBT.CommandBtlEscape,"逃げる");		
		_self.AddCommand("menu1",myBT.CommandMenuReturn,"戻る");		
		//処理
		//メニュー非表示処理
		this.MenuViewHiddenProc = function(){
			if(_self.GetBoxStatus(myBT.CommandMove)||_self.GetBoxStatus(myBT.CommandSex)||_self.GetBoxStatus(myBT.CommandBtlAttack)||_self.GetBoxStatus(myBT.CommandWaer)||_self.GetBoxStatus(myBT.Commandjanken)||_self.GetBoxStatus(myBT.CommandEat)||_self.GetBoxStatus(myBT.CommandTalk)){
				myBT.MenuHidden();
			}else{
				if(!myRpg.BattleFlg)myBT.MenuView();
				if(myRpg.BattleFlg)myBT.BattleMenuView();
			}
		}
		_self.Elm(myBT.Menu,_self.TypeID).onmousedown = function(){
			if(!_self.CheckTouchEvent()){
				myBT.MenuViewHiddenProc();
			}
		}
		_self.Elm("."+myBT.Menu).ontouchdown = function(){
			myBT.MenuViewHiddenProc();
		}
		myBT.MenuHidden();//非表示
		if(!this.OpeningFlg)myBT.MenuView();//表示
		_self.Elm("menu1",_self.TypeID).style.backgroundColor="rgba(0,0,0,0.8)";
	}
	
	//メニューボックス非表示
	MyTouch.prototype.MenuHidden = function(){
		_self.HiddenBox(myBT.CommandMove);
		_self.HiddenBox(myBT.CommandNextArea);
		_self.HiddenBox(myBT.CommandBeforeArea);
		_self.HiddenBox(myBT.CommandTalk);
		_self.HiddenBox(myBT.CommandTalk2);
		_self.HiddenBox(myBT.CommandLock);
		_self.HiddenBox(myBT.CommandItem);
		_self.HiddenBox(myBT.CommandStore);
		_self.HiddenBox(myBT.CommandSleep);
		_self.HiddenBox(myBT.CommandRest);
		_self.HiddenBox(myBT.CommandSex);
		_self.HiddenBox(myBT.CommandEat);
		_self.HiddenBox(myBT.CommandOnani);
		_self.HiddenBox(myBT.CommandMakuru);
		_self.HiddenBox(myBT.CommandMakuruW);
		_self.HiddenBox(myBT.CommandMakuruU);
		_self.HiddenBox(myBT.CommandMakuruR);			
		_self.HiddenBox(myBT.CommandNugasu);
		_self.HiddenBox(myBT.CommandSounyuu);
		_self.HiddenBox(myBT.CommandShasei);
		_self.HiddenBox(myBT.CommandWaer);
		_self.HiddenBox(myBT.CommandWaer2);
		_self.HiddenBox(myBT.CommandWaer3);
		_self.HiddenBox(myBT.CommandWaer4);
		_self.HiddenBox(myBT.CommandUnder);		
		_self.HiddenBox(myBT.CommandUnder2);		
		_self.HiddenBox(myBT.CommandMenuReturn);
		_self.HiddenBox(myBT.CommandKigaeru);
		_self.HiddenBox(myBT.CommandKigae1);
		_self.HiddenBox(myBT.CommandNugu);
		_self.HiddenBox(myBT.CommandWaer2);
		_self.HiddenBox(myBT.CommandBoxnone);
		_self.HiddenBox(myBT.CommandBattle);
		_self.HiddenBox(myBT.CommandStatus);
		_self.HiddenBox(myBT.CommandNextDay);
		_self.HiddenBox(myBT.CommandOption);
		_self.HiddenBox(myBT.CommandBtlAttack);
		_self.HiddenBox(myBT.Commandjanken);
		_self.HiddenBox(myBT.CommandLock2);		
		_self.HiddenBox(myBT.CommandBtlItem);
		_self.HiddenBox(myBT.CommandGuard);
		_self.HiddenBox(myBT.CommandBtlEscape);
	}
	//メニューボックス表示
	MyTouch.prototype.MenuView = function(){
		if(!myST.SexFlg)_self.ViewBox(myBT.CommandMove);
		if(myBT.NextAreaFlg)_self.ViewBox(myBT.CommandNextArea);
		if(myBT.BeforeAreaFlg)_self.ViewBox(myBT.CommandBeforeArea);
		if(!myST.SexFlg)_self.ViewBox(myBT.CommandTalk);
		if(!myST.SexFlg)_self.ViewBox(myBT.CommandTalk2);
		//if(!myST.SexFlg)_self.ViewBox(myBT.CommandLock);
		if(!myST.SexFlg)_self.ViewBox(myBT.CommandStatus);
		//if((!myST.SexFlg)&&(myRpg.StoreFlg))_self.ViewBox(myBT.CommandStore);
		//if((!myST.SexFlg)&&(myRpg.RestFlg)&&((myRpg.RestCount!=0)||(myRpg.RestNojukuFlg)))_self.ViewBox(myBT.CommandSleep);
		//if((!myST.SexFlg)&&(myRpg.RestFlg))_self.ViewBox(myBT.CommandOnani);//寝るときにオナニーも出来るようにする。
		/*if(myST.SexFlg)_self.ViewBox(myBT.CommandMakuru);
		if(myST.SexFlg)_self.ViewBox(myBT.CommandNugasu);
		if(myST.SexFlg){
			if(myProc.moveIndex==1)_self.ViewBox(myBT.CommandSounyuu);
			if(_self.sample2_flg)_self.HiddenBox(myBT.CommandSounyuu);
			if(myST.ShaseiFlg)_self.ViewBox(myBT.CommandShasei);
			if(_self.sample2_flg)_self.HiddenBox(myBT.CommandShasei);
		}*/
		//if(myProc.moveIndex==73)_self.ViewBox(myBT.CommandKigaeru);
		//if(myST.SexFunc==0x11)_self.ViewBox(myBT.CommandSex);
		//if(myRpg.FieldFlg)_self.ViewBox(myBT.CommandBattle);
		//_self.ViewBox(myBT.CommandEat);
		//_self.ViewBox(myBT.CommandItem);
		//_self.ViewBox(myBT.CommandNugu);
		//_self.ViewBox(myBT.CommandMakuru);
		//_self.ViewBox(myBT.CommandNextDay);	
		//if(_self.product_flg&&(!_self.sample2_flg))_self.ViewBox(myBT.CommandSounyuu);//イチャラブモード以外
		//if(myST.EventSelect["win"]==8)_self.ViewBox(myBT.CommandLock2);
		//_self.ViewBox(myBT.Commandjanken);
		//_self.ViewBox(myBT.CommandBoxnone);
		_self.ViewBox(myBT.CommandOption);
	}
	//着替えメニュー
	MyTouch.prototype.MenuKigae = function(){
		myBT.MenuHidden();
		_self.HiddenBox(myBT.Menu);
		_self.ViewBox(myBT.CommandKigae1);
		_self.ViewBox(myBT.CommandMenuReturn);
		if(myImg.GetIndexPos("shatu")!=imgNegurije){
			_self.Elm(myBT.CommandKigae1,_self.TypeID).innerText = "ネグリジェ";
		}else{
			_self.Elm(myBT.CommandKigae1,_self.TypeID).innerText = "魔導士の服";
		}
	}
	
	//メニューコマンド捲る
	MyTouch.prototype.MenuMakuru = function(){
		_self.HiddenBox(myBT.Menu);
		myBT.MenuHidden();
		_self.ViewBox(myBT.CommandMakuruW);
		_self.ViewBox(myBT.CommandMakuruU);
		_self.ViewBox(myBT.CommandMakuruR);		
	}
	
	//メニュー挿入
	MyTouch.prototype.MenuSounyuu2 = function(){
		_self.HiddenBox(myBT.Menu);
		myBT.MenuHidden();
		_self.ViewBox(myBT.CommandSounyuu);	
	}	
	
	//メニューボックス表示
	MyTouch.prototype.MenuNugu = function(){
		myBT.MenuHidden();
		_self.HiddenBox(myBT.Menu);
		//GirlPrison2では使用しない
		//_self.ViewBox(myBT.CommandWaer);
		_self.ViewBox(myBT.CommandWaer2);
		_self.ViewBox(myBT.CommandWaer3);
		//_self.ViewBox(myBT.CommandWaer4);
		_self.ViewBox(myBT.CommandUnder);
		_self.ViewBox(myBT.CommandUnder2);
		_self.ViewBox(myBT.CommandBoxnone);
		_self.ViewBox(myBT.CommandMenuReturn);
	}	
	//メニューボックス表示
	MyTouch.prototype.MenuNugasu = function(){
		_self.HiddenBox(myBT.CommandMove);
		_self.HiddenBox(myBT.CommandTalk);
		_self.HiddenBox(myBT.CommandLock);
		_self.HiddenBox(myBT.CommandSex);
		_self.HiddenBox(myBT.CommandMakuru);
		_self.HiddenBox(myBT.CommandSounyuu);
		if(myST.SexFlg)_self.ViewBox(myBT.CommandWaer);
		if(myST.SexFlg)_self.ViewBox(myBT.CommandUnder);		
	}
	//メニューボックス表示
	MyTouch.prototype.MenuSounyuu = function(){
		_self.HiddenBox(myBT.CommandMove);
		_self.HiddenBox(myBT.CommandTalk);
		_self.HiddenBox(myBT.CommandLock);
		_self.ViewBox(myBT.CommandSex);
		_self.ViewBox(myBT.CommandMakuru);
		if(myST.SexFlg){
			if(myProc.moveIndex==1)_self.ViewBox(myBT.CommandSounyuu);
		}
		if(myST.SexFlg)_self.ViewBox(myBT.CommandWaer);
		if(myST.SexFlg)_self.ViewBox(myBT.CommandUnder);		
	}
	//戦闘用メニュー表示
	MyTouch.prototype.BattleMenuView = function(){
		myBT.MenuHidden();
		_self.ViewBox(myBT.CommandBtlAttack);
		_self.ViewBox(myBT.CommandGuard);
		_self.ViewBox(myBT.CommandBtlItem);
		_self.ViewBox(myBT.CommandBtlEscape);
	}
	
	//移動先メニュー
	MyTouch.prototype.moveMenu = function(parent,movedata){
		_self.Elm(myBT.Menu,_self.TypeID).onmousedown();
		_self.HiddenBox(myBT.Menu);
		myBT.setCommonBox(parent,myBT.MenuMove,"10px");
		_self.ViewBox(myBT.MenuMove);
		//移動メニューを一度クリア
		_self.Elm(myBT.MenuMove,_self.TypeID).innerHTML = "";
		for(var loop in movedata){
			var lcID = "move"+movedata[loop][0];
			var lcName = movedata[loop][1];
			_self.AddCommand(myBT.MenuMove,lcID,lcName);
			myBT.setCommandProcessing(lcID,function(){
				var spos = String("move").length;
				var no = this.id.substr(spos,this.id.length-spos);
				movedata[loop][2](no);
				_self.Elm(myBT.CommandReturn,_self.TypeID).onmousedown();
			});
		}
		_self.AddCommand(myBT.MenuMove,myBT.CommandReturn,"戻る");		
		//処理
		_self.Elm(myBT.CommandReturn,_self.TypeID).onmousedown = function(){
			_self.HiddenBox(myBT.MenuMove);
			_self.ViewBox(myBT.Menu);
		}
		_self.Elm(myBT.MenuMove,_self.TypeID).style.backgroundColor = "rgba(0,0,0,0.8)";	
	}
	
	//コマンド処理設定
	MyTouch.prototype.setCommandProcessing = function(key,func){
		var elmKey = "."+key;
		if(_self.CheckTouchEvent()) {
			//タッチ対応
			_self.Elm(elmKey).ontouchdown = func;
		} else {
			//タッチ非対応
			_self.Elm(elmKey).onmousedown = func;
		}
	}

	//コマンド処理設定取得
	MyTouch.prototype.getCommandProcessing = function(key){
		var elmKey = "."+key;
		let process = null;
		if(_self.CheckTouchEvent()) {
			//タッチ対応
			process = _self.Elm(elmKey).ontouchdown;
		} else {
			//タッチ非対応
			process = _self.Elm(elmKey).onmousedown;
		}
		
		return process;
	}	
	//メッセージボックス
	MyTouch.prototype.messageBox = function(parent){
		var boxWidth = (_self.width_hi-350)>=50?350:325;
		var x_pos = (_self.width_hi-boxWidth)/2+"px";
		var y_pos = _self.height_hi<500?"335px":"360px";
		this.setCommonBox(parent,myBT.MsgBox,x_pos,y_pos);
		var data = _self.GetBoxData(myBT.MsgBox);
		data.width = boxWidth+"px";
		data.height = "150px";
		_self.ChangeBox("msgBox");
		_self.Elm(myBT.MsgBox,_self.TypeID).style.backgroundColor = "rgba(0,0,0,0.8)";		
	}
	
	//メッセージ表示
	MyTouch.prototype.setMessage = function(msg,mouseDown=true){
		if(myProc.talkLock){
			return;
		}
		//メッセージボックスが非表示なら先に行かない。
		if(!_self.GetBoxStatus(myBT.MsgBox)){
			if(!myST.EDFlg)return;
		}
		if(myBT.messageCount<msg.length){
			myBT.Message = msg;
			document.onmousedown = null;
			_self.setTimer(function(mouseDown){
				var func = function(){
					if(mouseDown)myBT.setMessage(myBT.Message);
				}
				if(_self.CheckTouchEvent()) {
					document.ontouchdown = func;
				}else{
					document.onmousedown = func;
				}
				
			},100,mouseDown);
			var vCheck = msg[myBT.messageCount];
			if(!Array.isArray(vCheck)){
				myBT.showMessage(msg[myBT.messageCount]);
			}else if(vCheck[0]=="FUNC"){
				vCheck[1]();
			}
			myBT.messageCount++;
		}else{
			if(_self.CheckTouchEvent()) {
				document.ontouchdown = null;
			}else{
				document.onmousedown = null;
			}
			myBT.messageCount = 0;
		}
	}
	
	//デバッグメッセージ
	MyTouch.prototype.debugMessage = function(msg){
		if(_self.debug){
			debugView.innerText += msg;
		}
	}
	
	//メッセージ表示用
	MyTouch.prototype.showMessage = function(msg){
		if(myProc.OrgasmModeFlg)msg = msg+"<br>タッチ回数:"+myProc.TouchCount;
		_self.Elm(myBT.MsgBox,_self.TypeID).innerHTML = msg!=""?msg+"<br>▼":"▼";
		if(myProc.OutPutFlg){
			while(msg.indexOf("<br>")!=-1){
				msg = msg.replace("<br>","\n",msg);
			}
			myProc.MsgData += msg+"\n";
		}
	}
	
	//読み書きデータ枠作成
	MyTouch.prototype.saveLoadBox = function(parent,index){
		var boxWidth = 300;
		var x_pos = (_self.width_hi-boxWidth)/2+"px";
		var y_pos = 20+index*105+"px";		
		myBT.setCommonBox(parent,"saveLoad"+index,x_pos,y_pos);
		var data = _self.GetBoxData("saveLoad"+index);
		data.width = boxWidth+"px";
		data.height = 100+"px";
		_self.ChangeBox("saveLoad"+index);		
		return "saveLoad"+index;
	}
	
	//OptionMessage
	MyTouch.prototype.optionMessage = function(parent,msg){
		var elm = _self.Elm("OptionMessage",_self.TypeID);
		if(elm == undefined){
			var x_pos = "0px";
			var y_pos = "0px";		
			myBT.setCommonBox(parent,"OptionMessage",x_pos,y_pos);
			var data = _self.GetBoxData("OptionMessage");
			data.width = _self.width_hi+"px";
			data.height = _self.height_hi+"px";
			_self.ChangeBox("OptionMessage");
			elm = _self.Elm("OptionMessage",_self.TypeID);
			elm.style.textAlign = "center";
		}
		elm.innerHTML = null;
		elm.innerHTML += "<br><br><br><br><br><br>";
		elm.innerHTML += msg;
		elm.innerHTML += "<br>";
		elm.innerHTML += "画面タッチでメッセージを閉じます。<br>";
		myBT.setCommandProcessing("OptionMessage",function(){
			_self.HiddenBox("OptionMessage");
		});
		elm.style.backgroundColor = "rgba(0,0,0,0.8)";
		_self.ViewBox("OptionMessage");
		return "OptionMessage";		
	}	
	
	//YesNoBox
	MyTouch.prototype.yesNoBox = function(parent,msg,func,func2=null){
		if(parent==null)parent = _self.Elm("operation",_self.TypeID);
		var elm = _self.Elm("YesNoBox",_self.TypeID);
		if(elm == undefined){
			var x_pos = "0px";
			var y_pos = "0px";		
			myBT.setCommonBox(parent,"YesNoBox",x_pos,y_pos);
			var data = _self.GetBoxData("YesNoBox");
			data.width = _self.width_hi+"px";
			data.height = _self.height_hi+"px";
			_self.ChangeBox("YesNoBox");
			elm = _self.Elm("YesNoBox",_self.TypeID);
			elm.style.textAlign = "center";
		}
		elm.innerHTML = null;
		elm.innerHTML += "<br><br><br><br><br><br>";
		elm.innerHTML += msg;
		elm.innerHTML += "<br>";
		elm.innerHTML += "<span id='Yes'>はい</span>　　　<span id='No'>いいえ</span>";
		_self.AddEventForId("Yes",function(e){
			_self.HiddenBox("YesNoBox");
			func();
		});
		_self.AddEventForId("No",function(e){
			_self.HiddenBox("YesNoBox");
			if(func2!=null)func2();
		});			
		elm.style.backgroundColor = "rgba(0,0,0,0.8)";
		_self.ViewBox("YesNoBox");
		return "YesNoBox";		
	}
	
	//選択肢
	MyTouch.prototype.selectBox = function(parent,select,newLineCount=5){
		var idarray = [];
		var elm = _self.Elm("selectBox",_self.TypeID);
		if(elm == undefined){
			var x_pos = "0px";
			var y_pos = "0px";		
			myBT.setCommonBox(parent,"selectBox",x_pos,y_pos);
			var data = _self.GetBoxData("selectBox");
			data.width = _self.width_hi+"px";
			data.height = _self.height_hi+"px";
			_self.ChangeBox("selectBox");
			elm = _self.Elm("selectBox",_self.TypeID);
			elm.style.textAlign = "center";
		}
		elm.innerHTML = null;
		for(var loop=0;loop<newLineCount;loop++){
			elm.innerHTML += "<br>";
		}
		for(var loop in select){
			var serColor = "";
			if(select[loop][2]!==undefined){
				if(select[loop][2] == "color")serColor = "color:red;";
			}
			elm.innerHTML += "<span id='select"+loop+"' style='font-size:14pt;"+serColor+"'>【"+select[loop][0]+"】</span><br><br><br>";
			idarray[loop] = "select"+loop;
		}
		elm.style.backgroundColor = "rgba(0,0,0,0.8)";
		_self.ViewBox("selectBox");
		return idarray;		
	}
	//選択肢
	MyTouch.prototype.EndingBox = function(parent,Msg="Thank you for playing!!"){
		var x_pos = "0px";
		var y_pos = "0px";		
		myBT.setCommonBox(parent,"EndingBox",x_pos,y_pos);
		var data = _self.GetBoxData("EndingBox");
		data.width = _self.width_hi+"px";
		data.height = _self.height_hi+"px";
		//data.opacity = 0;
		parent.style.opacity = "";
		parent.style["opacity"] = "";
		parent.style.backgroundColor = "rgba(0,0,0,0)";
		_self.ChangeBox("EndingBox");
		var elm = _self.Elm("EndingBox",_self.TypeID);
		elm.style.backgroundColor = "rgba(0,0,0,0.5)";
		_self.HiddenBox("EndingBox");	
		elm.style.textAlign = "center";
		elm.innerHTML = "<br><br><br><br><br><br><br><br><br>"+Msg;
		_self.ViewBox("EndingBox");		
	}

	MyTouch.prototype.DayTime = function(){
		var parent = _self.Elm("operation",_self.TypeID);
		var xpos = "250px";
		if(_self.width_hi<400)xpos = "200px";
		myBT.setCommonBox(parent,myBT.IDDayTime,xpos);
		MyTouch.prototype.chgDayTime = function(){
			var time = ["朝/昼","夕方","夜","深夜"];
			var len = myProc.movedata[0].length-1;
			//var option = "行動回数:"+myProc.DayActCount+"回<br>";
			var option = "";
			_self.Elm(myBT.IDDayTime,_self.TypeID).innerHTML = myProc.Day+"Day："+time[myImg.backCorrect]+"<br>"+option;
			_self.Elm(myBT.IDDayTime,_self.TypeID).style.backgroundColor = "rgba(0,0,0,0.8)";
			//_self.Elm(myBT.IDDayTime,_self.TypeID).innerHTML = myProc.Day+"Day<br>"+option;
			_self.ViewBox(myBT.IDDayTime);
		}
		myBT.chgDayTime();
	}
	
	MyTouch.prototype.OrgasmFunc = function(){
		var parent = _self.Elm("operation",_self.TypeID);
		var xpos = "250px";
		var ypos = "46px";
		if(_self.width_hi<400)xpos = "200px";
		myBT.setCommonBox(parent,myBT.IDOrgasm,xpos,ypos);
		//_self.AddCommandDiv(myBT.IDOrgasm,"OrgasmMode","タッチモード");
		_self.AddCommandDiv(myBT.IDOrgasm,"OrgasmMode","タッチモード:OFF");
		_self.AddCommandDiv(myBT.IDOrgasm,myBT.CommandOrgasm,"【モード切替】");
		_self.ViewBox(myBT.IDOrgasm);
	}
}
myBT = new MyTouch();