
function get_the_browser(){
	if(navigator.userAgent.indexOf("Opera") != -1){ // 文字列に「Opera」が含まれている場合
	
		the_browser = "Opera";
	
	}
	else if(navigator.userAgent.indexOf("MSIE") != -1){ // 文字列に「MSIE」が含まれている場合
	
		the_browser = "MSIE";
	
	}
	else if(navigator.userAgent.indexOf("Firefox") != -1){ // 文字列に「Firefox」が含まれている場合
	
		the_browser = "Firefox";
	
	}
	else if(navigator.userAgent.indexOf("Netscape") != -1){ // 文字列に「Netscape」が含まれている場合
	
		the_browser = "Netscape";
	
	}
	else if(navigator.userAgent.indexOf("Safari") != -1){ // 文字列に「Safari」が含まれている場合
	
		the_browser = "Safari";
	
	}
	else{
	
		the_browser = "unknown";
	
	}
	
	return the_browser;
}

function display_virtical_text(){	
		
		formated_text = "";
		
		not_used = new Array();
		
		h_text_array = new Array();
		the_h_col = 0;
		the_h_row = 0;
		h_text_array[the_h_row] = new Array();
			
		if(tougo_text && tougo_line_break =="yes"){
			if(season_position == "with_togo"){
				
				
				var tougo_length = tougo_text.length;
				create_h_text_array(tougo_length,tougo_text,"tougo");
				
				var season_length = season_text.length;
				create_h_text_array(season_length,season_text,"season");
				
				
				line_break();
				
			}else{
					
				var tougo_length = tougo_text.length;
				create_h_text_array(tougo_length,tougo_text,"tougo");
					
				line_break();
			}
		}
			
		
			
		if(tougo_text && tougo_line_break == "no"){
			if(season_position == "with_togo"){
				var tougo_length = tougo_text.length;
				create_h_text_array(tougo_length,tougo_text,"tougo");
				
				
				var season_text02 = season_text +"　"; ///*******　　だめかもしれない。　そのときは　col　を空にして　一つふやす
				var season_length = season_text02.length;
				create_h_text_array(season_length,season_text02,"season");
			
			}else{
				
				var tougo_text02 = tougo_text +"　";
				
				var tougo_length = tougo_text02.length;
				create_h_text_array(tougo_length,tougo_text02,"tougo");
				
			}
		}		   
			
		if(tougo_text == ""){
			var not_used_arra = new Array("tougo","頭語");
			not_used.push(not_used_arra);
		}
		
		if(season_position == ""){
			var not_used_arra = new Array("season","季節");
			not_used.push(not_used_arra);
			
		}
		
		
		if(first_paragraph_text == ""){
			var not_used_arra = new Array("first_paragraph","第一段落");
			not_used.push(not_used_arra);
			
		}else{
		
		
			if(season_position == "with_the_first"){
					
				var season_length = season_text.length;
				create_h_text_array(season_length,season_text,"season");
					
				var first_paragraph_length = first_paragraph_text.length;
				create_h_text_array(first_paragraph_length,first_paragraph_text,"first_paragraph");
					
					
				line_break();
				
			}else{
				
				var first_paragraph_length = first_paragraph_text.length;
				create_h_text_array(first_paragraph_length,first_paragraph_text,"first_paragraph");
					
					
				
				line_break();
			
			}
		}
		
		
		if(before_name_text == ""){
			
			var not_used_arra = new Array("before_name","故人名・前");
			not_used.push(not_used_arra);
			
		}
		
		// prefix name serfix は　まとめて別ウィンドウで
		
			//
		
		if(name_line_break == "yes"){
			
			var before_name_text02 = "　" + before_name_text;
			
			var before_name_length = before_name_text02.length;
			create_h_text_array(before_name_length,before_name_text02,"before_name");
			
			
			var name_prefix_text_length = name_prefix_text.length;
			create_h_text_array(name_prefix_text_length,name_prefix_text,"name_prefix_text");
			
			var relation_length = relation_text.length;
			create_h_text_array(relation_length,relation_text,"relation");
			
			var original_name02 = "　" + original_name + "　";
			var original_name_length = original_name02.length;
			create_h_text_array(original_name_length,original_name02,"original_name");
			
			
			var name_serfix_text_length = name_serfix_text.length;
			create_h_text_array(name_serfix_text_length,name_serfix_text,"name_serfix_text");
			
			//$('notice').update(original_name);
			//$('notice').update(original_name02);
			
			
			
			line_break();
			
			
		}else{
			
			var before_name_length = before_name_text.length;
			create_h_text_array(before_name_length,before_name_text,"before_name");
			
			
			var name_prefix_text_length = name_prefix_text.length;
			create_h_text_array(name_prefix_text_length,name_prefix_text,"name_prefix_text");
			
			var relation_length = relation_text.length;
			create_h_text_array(relation_length,relation_text,"relation");
			
			var original_name02 = "　" + original_name;
			var original_name_length = original_name02.length;
			create_h_text_array(original_name_length,original_name02,"original_name");
			
			var name_serfix_text02 = name_serfix_text + "　";
			var name_serfix_text_length = name_serfix_text.length;
			create_h_text_array(name_serfix_text_length,name_serfix_text02,"name_serfix_text");
			//$('notice').update(original_name02);
	
		}
		
		
		
		
		kanji_age = "";
		
		
		if(isNaN(parseInt(the_age))){
				
			kanji_age = the_age;
				
		}else{
			kanji_age = convert_kanji_numeric(parseInt(the_age));
		}
			
			
			
		
		if(tenjyu == "yes"){
			
			
			
			tenju_text = kanji_age+"歳の天寿を全うして永眠いたしました";
			//$('notice').update(tenju_text);
			
			
			var tenju_length = tenju_text.length;
			create_h_text_array(tenju_length,tenju_text,"tenjyu");
			line_break();
			
			//     天寿が入るときに　second paragragh　は？？？
			
		}else{
			
			
			var not_used_arra = new Array("tenjyu","天寿全う");
			not_used.push(not_used_arra);
		}
		
		
		
		
		
		if(second_paragraph_text){
			
			var second_paragraph_text02 = second_paragraph_text;
			
			var second_paragraph_length = second_paragraph_text02.length;
			
			create_h_text_array(second_paragraph_length,second_paragraph_text02,"second_paragraph");
			
			line_break();
			
		}else{
			
			
			var not_used_arra = new Array("second_paragraph","第二段落");
			not_used.push(not_used_arra);
		}
		
	
		
		
		if(second_paragraph_plus_text){
			
			var second_paragraph_plus_text02 = second_paragraph_plus_text;
			
			var second_paragraph_plus_text02_length = second_paragraph_plus_text02.length;
			
			create_h_text_array(second_paragraph_plus_text02_length,second_paragraph_plus_text02,"second_paragraph_plus");
			
			line_break();
			
		}else{

			var not_used_arra = new Array("second_paragraph_plus","第二段落・追記");
			not_used.push(not_used_arra);
		}
	
	
	
	
	
		if(kaimyo_before_text == ""){
			
			
			var not_used_arra = new Array("kaimyo_before","戒名・前");
			not_used.push(not_used_arra);
		}
		
		if(hoyo_text == ""){
	
			var not_used_arra = new Array("hoyo","法要名");
			not_used.push(not_used_arra);
		}
		
		if(kaimyo_after_text == ""){
		
			
			var not_used_arra = new Array("kaimyo_after","戒名・後");
			not_used.push(not_used_arra);
		}
		
	
		if(kaimyo_line_break == "yes" && kaimyo != ""){
			if(kaimyo_before_text){
				
				var kaimyo_before_text02 = kaimyo_before_text + "";
				
				var kaimyo_before_text02_length = kaimyo_before_text02.length;
			
				create_h_text_array(kaimyo_before_text02_length,kaimyo_before_text02,"kaimyo_before");
				line_break();
				
				
				var kaimyo02 = "　" + kaimyo + "";
				
				var kaimyo02_length = kaimyo02.length;
			
				create_h_text_array(kaimyo02_length,kaimyo02,"kaimyo");
				line_break();
				
				
				
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text ;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
				
				
			}else{
				
				var kaimyo02 = "　" + kaimyo + "";
				
				var kaimyo02_length = kaimyo02.length;
			
				create_h_text_array(kaimyo02_length,kaimyo02,"kaimyo");
				
				line_break();
				
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
			}
		}
		if(kaimyo_line_break == "yes" && kaimyo == ""){
			if(kaimyo_before_text){
				
				var kaimyo_before_text02 = kaimyo_before_text + "";
				
				var kaimyo_before_text02_length = kaimyo_before_text02.length;
			
				create_h_text_array(kaimyo_before_text02_length,kaimyo_before_text02,"kaimyo_before");
				line_break();
				
				
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text ;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
				
			}else{
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
			}
		}
		
		
		

		
		if(kaimyo_line_break == "no" && kaimyo != ""){
			if(kaimyo_before_text){
				
				
				
				var kaimyo_before_text_length = kaimyo_before_text.length;
			
				create_h_text_array(kaimyo_before_text_length,kaimyo_before_text,"kaimyo_before");
				
				
				var kaimyo02 = "　" + kaimyo + "　";
				
				var kaimyo02_length = kaimyo02.length;
			
				create_h_text_array(kaimyo02_length,kaimyo02,"kaimyo");
				
				
				
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
				
				
		
			}else{
				
				var kaimyo02 =  kaimyo + "　";
				
				var kaimyo02_length = kaimyo02.length;
			
				create_h_text_array(kaimyo02_length,kaimyo02,"kaimyo");
				
				
				
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
				
			}
		}
		if(kaimyo_line_break == "no" && kaimyo == ""){
			if(kaimyo_before_text){
				
				var kaimyo_before_text_length = kaimyo_before_text.length;
			
				create_h_text_array(kaimyo_before_text_length,kaimyo_before_text,"kaimyo_before");
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
				
				
				
			}else{
				
				
				var hoyo_text_length = hoyo_text.length;
			
				create_h_text_array(hoyo_text_length,hoyo_text,"hoyo");
				
				
				
				//var kaimyo_after_text02 = kaimyo_after_text + "＠";
				var kaimyo_after_text02 = kaimyo_after_text;
				
				var kaimyo_after_text02_length = kaimyo_after_text02.length;
			
				create_h_text_array(kaimyo_after_text02_length,kaimyo_after_text02,"kaimyo_after");
			}
		}
	
	
	
		if(extra_text){
			
			line_break();
			
			//var extra_text02 = extra_text + "＠";
			var extra_text02 = extra_text;
				
			var extra_text02_length = extra_text02.length;
			
			create_h_text_array(extra_text02_length,extra_text02,"extra");
			
		}else{
			
			
			var not_used_arra = new Array("extra","追記");
			not_used.push(not_used_arra);
		}
		
		
		
		
		
		if(thelast_text){
			line_break();
			
			var thelast_text_length = thelast_text.length;
			
			create_h_text_array(thelast_text_length,thelast_text,"thelast");
			
		}else{
			
			var not_used_arra = new Array("thelast","締め括り");
			not_used.push(not_used_arra);
		}
		
		
		
		
		if(ketugo_text == ""){
		
			var not_used_arra = new Array("ketugo","結語");
			not_used.push(not_used_arra);
		}
		
		
		if(ketugo_text && tougo_line_break == "yes"){
			
			var space_amount = the_num_text_line - ketugo_text.length;
			
			var ketugo_text02 = "";
			
			for(var i = 0 ; i < space_amount ; i++){
				ketugo_text02 += "　";
				
			}
			ketugo_text02 += ketugo_text;
			
			
			line_break();
			var ketugo_text02_length = ketugo_text02.length;
			
			create_h_text_array(ketugo_text02_length,ketugo_text02,"ketugo");
			
			line_break();
		}
		if(ketugo_text && tougo_line_break == "no"){
			
			
			var ketugo_text02 = "　　"+ketugo_text;
			
			var ketugo_text02_length = ketugo_text02.length;
			
			create_h_text_array(ketugo_text02_length,ketugo_text02,"ketugo");
			
		}
		
		
		
		
		line_break();
		
		
		
		
		
		
		//$('notice').update(theyear);
		
		
		//themonth =12;
		
		theyear_kanji = convert_kanji_numeric(theyear - 1988);
		
		
		themonth_kanji = convert_kanji_numeric(themonth);
		
		
		line_break();
		var the_date_text = "　平成"+theyear_kanji+"年"+themonth_kanji+"月";
		
		var the_date_text_length = the_date_text.length;
			
		create_h_text_array(the_date_text_length,the_date_text,"date");
	
		line_break();
		
		
				
				
		var addres_rest = sender_data['banchi'] + sender_data['buill'];
		
		
		addres_rest = convert_kanji_letter(addres_rest);
		
		
		
		full_address = sender_data['todo']+sender_data['siku']+addres_rest;
		
		addres_length = full_address.length;
		var space_for_address = 3;
		var space_for_address_after = 5;
	
		var cutting_address = full_address;
		
		//var test = "";
	
		if(addres_length > the_num_text_line - (space_for_address + space_for_address_after)){
			
			while (0 < addres_length) {
			
				var cut_position = the_num_text_line - (space_for_address + space_for_address_after);
				
				var cut_address = cutting_address.slice(0, cut_position);
				
				//test += space_for_address+"";
				
				var pre_space = "";
				for(var i = 0 ; i < space_for_address; i++){
					
					pre_space += "　";
				}
				
				//test += ","+i+pre_space+","+"<br>";
				
				
				cut_address = pre_space + cut_address + "＠";
				/*
				for(var i = 0 ; i < space_for_address_after; i++){
					cut_address += "　";
				}
				*/
				
				
				var cut_address_length = cut_address.length;
				
				//test += cut_address_length + ","+cut_address+","+"<br>";
			
				create_h_text_array(cut_address_length,cut_address,"address");
		
				
				cutting_address = cutting_address.slice(cut_position);
				
				addres_length = cutting_address.length;
				space_for_address++;
				space_for_address_after--;
				
				if(space_for_address_after < 0){
					space_for_address_after = 0;
				}
			}
			
			
			
		}else{
			var pre_space = "";
			for(var i = 0 ; i < space_for_address; i++){
				pre_space += "　";
			}
			
			var full_address02 = pre_space + full_address;
			var full_address02_length = full_address02.length;
			create_h_text_array(full_address02_length,full_address02,"address");
		}
		
		
		line_break();
	
	
		//$('notice').update(test);
	
		
		
		
		
		
		
		var space_amount = the_num_text_line - sender_data['mosyu'].length;
			
		var space = "";
		for(var i = 0 ; i < space_amount ; i++){
			space += "　";
				
		}
		
		var mosyu = space + sender_data['mosyu'];
		
		var mosyu_length = mosyu.length;
		create_h_text_array(mosyu_length,mosyu,"mosyu");
			
		
		
		
	
	
		if(ps_text){
			line_break();
			line_break();
			
			var ps_text02 = "　"+ps_text;
			var ps_text02_length = ps_text02.length;
			create_h_text_array(ps_text02_length,ps_text02,"ps");
		}else{	
			
			var not_used_arra = new Array("ps","追伸");
			not_used.push(not_used_arra);
		}
		
		
		//var test = "";
		
		
		//$('notice').update(test);
		
		h_text_array = h_text_array.reverse();
		
		var formated_text_array_by_text_vartical = new Array();
		
		var the_value = "";
		for(var i = 0 ; i < h_text_array.length ; i++){
			
			for(var j = 0 ; j < the_num_text_line ; j++){
				var the_value = new Array();
				
				if(!h_text_array[i][j]){
	
					the_value['letter'] = "　";
					the_value['category'] = "";
				}else{
					
					the_value['letter'] = h_text_array[i][j]['letter'];
					the_value['category'] = h_text_array[i][j]['category'];
				}
				
				if(i == 0){
					formated_text_array_by_text_vartical[j] = new Array();
				}
				
				formated_text_array_by_text_vartical[j][i] = new Array();
				formated_text_array_by_text_vartical[j][i] = the_value;
		
			}
			
			//test += j + "<br>";
		}

		//$('notice').update(test);	
			
		var the_span = new Element('span');
		
	
		
		for(var i = 0 ; i < formated_text_array_by_text_vartical.length ; i++){
			
			var num_col = formated_text_array_by_text_vartical[i].length;
			
			for(var j = 0 ; j < formated_text_array_by_text_vartical[i].length ; j++){
				
				var h_space = Math.round(668/num_col);
				var v_space = Math.round(463/the_num_text_line);
				
				var h_position = h_space*j+30;
				
				var v_position = v_space*i+20;
				
				var the_text = "";
				if(formated_text_array_by_text_vartical[i][j]['letter'] == "　"){
					the_text = "";
				}else{
					the_text = formated_text_array_by_text_vartical[i][j]['letter'];
				}
													
				var the_id = i+"-"+j;
				var div = new Element('div', {id:the_id}).update(the_text);
				
				
				div.style.position = "absolute";
				div.style.textAlign = "center";
				div.style.height = v_space + "px";
				div.style.width = h_space + "px";
				div.style.fontSize = "16px";
				div.style.left = h_position + "px";
				div.style.top = v_position + "px";
				
				the_category = "";
				
				if(formated_text_array_by_text_vartical[i][j]['category']){
					
					div.style.cursor = "pointer";
					
					the_category = formated_text_array_by_text_vartical[i][j]['category'];
					
					div.className = the_category;
					
					var click_obj = { name: the_category };
					
					click_letter_exe = click_letter.bindAsEventListener(click_obj);
					
					Event.observe(div, 'click', click_letter_exe);
					
					
					var in_obj = { name: the_category };
					
					
					change_back_in = over_letter.bindAsEventListener(in_obj);
					
					Event.observe(div, 'mouseover', change_back_in);
					
				
					var out_obj = { c_name: the_category };
					
					change_back_out = out_letter.bindAsEventListener(out_obj);
					
					Event.observe(div, 'mouseout', change_back_out);
					
					
					
				}
				
				the_span.appendChild(div);
				//text +=  + ",";
				//the_tr.appendChild(the_td);
			}
			
			//the_tbody.appendChild(the_tr);
			
			
		}
		$('display_area').update();
		
		$('display_area').appendChild(the_span);
	//the_table.appendChild(the_tbody);
	
	
		var the_span = new Element('span').update("未使用部<br>");
		
		$('not_used_area').appendChild(the_span);
		
		
		for(var i = 0 ; i < not_used.length; i ++){
			
			var input = new Element("input", {type:"button", value:not_used[i][1]});
			
			
			
			var click_obj = { name:  not_used[i][0] };
					
			click_letter_exe = click_letter.bindAsEventListener(click_obj);
					
			Event.observe(input, 'click', click_letter_exe);
					
					
					
			/*
			if(the_browser == "MSIE"){
				input.setAttribute("onclick", new Function( "click_letter('"+ not_used[i][0] +"');"   ));
			}else{
				input.setAttribute("onclick", "click_letter('"+ not_used[i][0] +"')");
			}
			*/
			
			var br = new Element('br');
			
			$('not_used_area').appendChild(input);
			$('not_used_area').appendChild(br);
			
		}
		
	}
	
	
	
	

function save_the_text(){
		var the_parameter = "paper_type=" + paper_type+"&";
	
		the_parameter += "kiakie_file=" +kiakie_file +"&";
		the_parameter += "bill_record_id="+bill_record_id+"&";
		the_parameter += "sender_ID=" + sender_ID + "&";
		
		the_parameter += "pix=" + pix+"&";
		the_parameter += "tougo_id=" + tougo_id+"&";
		the_parameter += "ketugo_id=" + ketugo_id+"&";
		the_parameter += "tougo_line_break=" + tougo_line_break+"&";
		the_parameter += "first_paragraph_id=" + first_paragraph_id+"&";
		the_parameter += "first_paragraph_text=" + first_paragraph_text+"&";
		the_parameter += "name_prefix_text=" + name_prefix_text+"&";
		the_parameter += "before_name_id=" + before_name_id+"&";
		the_parameter += "before_name_text=" + before_name_text+"&";
		the_parameter += "second_paragraph_id=" + second_paragraph_id+"&";
		the_parameter += "second_paragraph_text=" + second_paragraph_text+"&";
		the_parameter += "second_paragraph_plus_id=" + second_paragraph_plus_id+"&";
		the_parameter += "second_paragraph_plus_text=" + second_paragraph_plus_text+"&";
		the_parameter += "kaimyo_before_id=" + kaimyo_before_id+"&";
		the_parameter += "kaimyo_before_text=" + kaimyo_before_text+"&";
		the_parameter += "kaimyo_after_id=" + kaimyo_after_id+"&";
		the_parameter += "kaimyo_after_text=" + kaimyo_after_text+"&";
		the_parameter += "extra_id=" + extra_id+"&";
		the_parameter += "extra_text=" + extra_text+"&";
		the_parameter += "thelast_id=" + thelast_id+"&";
		the_parameter += "thelast_text=" + thelast_text+"&";
		the_parameter += "ps_id=" + ps_id+"&";
		the_parameter += "ps_text=" + ps_text+"&";
		the_parameter += "name_serfix_text=" + name_serfix_text+"&";
		the_parameter += "name_line_break=" + name_line_break+"&";
		the_parameter += "kaimyo_line_break=" + kaimyo_line_break+"&";
		the_parameter += "flag=" + flag+"&";
		the_parameter += "tougo_text=" + tougo_text+"&";
		the_parameter += "ketugo_text=" + ketugo_text+"&";
		the_parameter += "season_id=" + season_id+"&";
		the_parameter += "season_text=" + season_text+"&";
		
		//the_parameter += "relashion_id=" + relashion_id+"&";
		the_parameter += "relation_text=" + relation_text+"&";
		the_parameter += "original_name=" + original_name+"&";
		the_parameter += "tenjyu=" + tenjyu+"&";
		the_parameter += "age=" + the_age+"&";
		
		
		the_parameter += "kaimyo=" + kaimyo+"&";
		the_parameter += "hoyo_text=" + hoyo_text+"&";
		
		//the_parameter += "kaimyo_after_soshina=" + kaimyo_after_soshina+"&";
		//the_parameter += "soshina=" + soshina+"&";
		
		the_parameter += "mosyu=" + sender_data['mosyu']+"&";
		the_parameter += "todo=" + sender_data['todo']+"&";
		the_parameter += "siku=" + sender_data['siku']+"&";
		the_parameter += "banchi=" + sender_data['banchi']+"&";
		the_parameter += "buill=" +sender_data['buill'] +"&";
		the_parameter += "year=" + theyear+"&";
		the_parameter += "month=" + themonth+"&";
		the_parameter += "prize=" + award_name+"&";
		the_parameter += "donation=" + donation_place+"&";
		the_parameter += "season_position=" + season_position+"";
		
		//$('notice').update(the_parameter);
	
		new Ajax.Request("../ajax/kiake/kiake.php", {
					method: "post",
					parameters: the_parameter,
					onCreate: function (){
						
						create_loading();
						$('save_message').update();
						
					},
					onSuccess: function(transport) {
	
						Element.remove("w_block");
						
						the_result = transport.responseText.evalJSON();
						
						kiakie_file = the_result['kiakie_file'];
						bill_record_id = the_result['bill_record_id'];
						kiakie_file = the_result['kiakie_file'];
						
						$('save_message').update("保存完了");
						
					}
		});
	
	}
	
	
	function show_horizontal_text(){
		
		var h_text_array_view =	h_text_array;
		
		//h_text_array_view = h_text_array_view.reverse();
		
		var test = "";
		for(var i = h_text_array_view.length-1; i >= 0 ; i--){
			for(var j = 0; j < 	h_text_array_view[i].length; j++){
				test += h_text_array_view[i][j]['letter'];
			}
			test += "<br>";
		}
		
		
		
		var div01 = new Element('div', {style:" margin-left:150px; text-align:left;"}).update(test);
		
		var input_close = new Element('input', {type:"button", value:"閉じる"});
		
		if(the_browser == "MSIE"){
			input_close.setAttribute("onClick", new Function( "close_block();"));
		}else{
			input_close.setAttribute("onClick", "close_block()");
		}
		
		var input_close02 = new Element('input', {type:"button", value:"閉じる"});
		
		if(the_browser == "MSIE"){
			input_close02.setAttribute("onClick", new Function( "close_block();"));
		}else{
			input_close02.setAttribute("onClick", "close_block()");
		}
		
		var the_br = new Element('br');
		 
		var a_tag = new Element('a', {href:"kiake_back/"+pix, target:"_blank"}).update("背景画像");
		
		var div = new Element('div');
		
		div.appendChild(input_close02);
		div.appendChild(the_br);
		
		div.appendChild(a_tag);
		div.appendChild(div01);
		div.appendChild(input_close);
		
		block_message_element(div)
	}
	 
	
	function change_background(type){
	
		switch(type){
			
			case "leeves":
				$('display_area').style.background = "url(kiake_back/kiake01.gif) no-repeat center";
				
				pix = "kiake01.gif";
			break;
			
			case "fuji":
				$('display_area').style.background = "url(kiake_back/fuji_web.jpg) no-repeat center";
				pix = "fuji_web.jpg";
			break;
			
			
			
			default:
				$('display_area').style.background = "url(kiake_back/flower_back.gif) no-repeat center";
				pix = "flower_back.gif";
		}
			
	}
	
	function change_letter(the_flag){
		
		if(!season_id){
			switch(themonth){
					case 12:
					case 1:
					case 2:
						var season_flag = "冬";
					break;
					
					case 3:
					case 4:
					case 5:
						var season_flag = "春";
					break;
					
					case 6:
					case 7:
					case 8:
						var season_flag = "夏";
					break;
					
					case 9:
					case 10:
					case 11:
						var season_flag = "秋";
		
					  break;
					
				}
				
				//$('notice').update(season_flag);
				
				var season_array = select_array(sentences,"category","季節");
	
				var selected_season_array = new Array();
				for(var i =0; i < season_array.length ; i++){
				
					if(season_array[i]['flag'].indexOf(season_flag) != -1){
						selected_season_array.push(season_array[i]);
					}
				}
				
			var current_season_id = selected_season_array[0]["original_key"];
		}
				
				
		shinto_tenri_flag = "no";
		
		var kaimyo_input_value = $F('kaimyo_input');
		
		if(kaimyo_input_value == "山田太郎" || kaimyo_input_value == ""){
			
			kaimyo_input_value = "＊＊＊戒＊＊＊名＊＊＊＊";
			
		}
			
		
		var input_kaimyo = new Element('input', {type:'text', id:"kaimyo_input", value:kaimyo_input_value});
		
		$('kaimyo_td').update();
		
		$('kaimyo_td').appendChild(input_kaimyo);
		
		
		
		switch(the_flag){
			case "saved":
				paper_type = thelast['paper_type'];
				pix = saved_data['pix'];
				tougo_id = saved_data['tougo_id'];
				ketugo_id = saved_data['ketugo_id'];
				tougo_line_break = saved_data['tougo_line_break'];
				first_paragraph_id = saved_data['first_paragraph_id'];
				name_prefix_text = saved_data['name_prefix'];
				before_name_id = saved_data['before_name_id'];
				second_paragraph_id = saved_data['second_paragraph_id'];
				second_paragraph_plus_id = saved_data['second_paragraph_plus_id'];
				kaimyo_before_id = saved_data['kaimyo_before_id'];
				hoyo_id = saved_data['hoyo_id'];
				kaimyo_after_id = saved_data['kaimyo_after_id'];
				extra_id = saved_data['extra_id'];
				thelast_id = saved_data['thelast_id'];
				thelast_text = saved_data['thelast_text'];
				ps_id = saved_data['ps_id'];
				name_serfix_text = saved_data['name_serfix'];
				name_line_break = saved_data['name_line_break'];
				kaimyo_line_break = saved_data['kaimyo_line_break'];
				flag = saved_data['flag'];
				tougo_text = saved_data['tougo_text'];
				ketugo_text = saved_data['ketugo_text'];
				season_id = saved_data['season_id'];
				season_text = saved_data['season_text'];
				first_paragraph_text = saved_data['first_paragraph_text'];
				before_name_text = saved_data['before_name_text'];
				relation_text = saved_data['relation_text'];
				original_name = saved_data['original_name'];
				tenjyu = saved_data['tenjyu'];
				the_age = saved_data['the_age'];
				second_paragraph_text = saved_data['second_paragraph_text'];
				second_paragraph_plus_text = saved_data['second_paragraph_plus_text'];
				kaimyo_before_text = saved_data['kaimyo_before_text'];
				kaimyo = saved_data['kaimyo'];
				hoyo_text = saved_data['hoyo_text'];
				kaimyo_after_text = saved_data['kaimyo_after_text'];
				extra_text = saved_data['extra_text'];
				ps_text = saved_data['ps_text'];
				theyear = parseInt(saved_data['theyear']);
				themonth = parseInt(saved_data['themonth']);
				award_name = saved_data['award_name'];
				donation_place = saved_data['donation'];
				season_position = saved_data['season_position'];
	
				sender_data['mosyu'] = saved_sender_data['mosyu'];
				sender_data['todo'] = saved_sender_data['todo'];
				sender_data['siku'] = saved_sender_data['siku'];
				sender_data['banchi'] = saved_sender_data['banchi'];
				sender_data['buill'] = saved_sender_data['buill'];
				
				$('mosyu').value = sender_data['mosyu'];
				$('todo').value = sender_data['todo'];
				$('siku').value = sender_data['siku'];
				$('banchi').value = sender_data['banchi'];
				$('buil').value = sender_data['buill'];
				
				$('name_prefix_text_menu').value = name_prefix_text;
				$('name_serfix_text_menu').value = name_serfix_text;
				
				$('name').value = original_name;
				
				if(name_line_break == "yes"){
					$('name_line_break_yes').checked = true;
				}else{
					$('name_line_break_no').checked = true;
				}
				
				
				
				
				
				if(relation_text == "父" || 
				   	relation_text == "母" ||
					relation_text == "祖父" ||
					relation_text == "祖母" ||
					relation_text == "夫" ||
					relation_text == "妻" ||
					relation_text == "叔父" ||
					relation_text == "叔母"
					
				   ){
					
					$('relation_menu').value = relation_text;
					
				}else{
					$('relation_text_direct').value = relation_text;
					$('relation_menu').value = "";
				}
				
				
				$('kaimyo_input').value = kaimyo;
				
				if(kaimyo_line_break == "yes"){
					$('kaimyo_line_break_yes').checked = true;
				}else{
					$('kaimyo_line_break_no').checked = true;
				}
				
				
								
				switch(pix){
			
					case "kiake01.gif":
						$('display_area').style.background = "url(kiake_back/kiake01.gif) no-repeat center";
						
						$('leeves').checked = true;
						
						
					break;
					
					case "fuji_web.jpg":
						$('display_area').style.background = "url(kiake_back/fuji_web.jpg) no-repeat center";
						$('fuji').checked = true;
					break;
					
				
					case "flower_back.gif":
						$('display_area').style.background = "url(kiake_back/flower_back.gif) no-repeat center";
						
						$('flower').checked = true;
						
					break;
					
					
					
				}
		
				
				
		
				break;
				
			case "female":
				season_position = "";
				
				tougo_id = 2;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 7;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 12;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 27;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 40;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 67;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 81;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 105;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = "";
				thelast_text = "";
				
				ps_id = "";
				ps_text = "";
			
			
			break;
			
			case "female_for_kids":
				season_position = "";
				
				tougo_id = 2;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 7;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 13;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 28;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 41;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = 58;
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 68;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 82;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 106;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = 116;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 133;
				ps_text = sentences[ps_id]['text'];
			
			
			break;
			
			case "child_grown":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 5;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "no";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = "";
				first_paragraph_text = "";
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 28;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 43;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = 59;
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 68;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 84;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 116;
				thelast_text = "";
				
				ps_id = "";
				ps_text = "";
			
			
			break;
			
			case "child_litte":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "no";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 15;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 23;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 44;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = 60;
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				kaimyo_line_break = "no";
				$('kaimyo_line_break_no').checked = true;
				
				kaimyo_before_id = 69;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 85;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 119;
				thelast_text = "";
				
				ps_id = "";
				ps_text = "";
			
			break;
			
			case "sick":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 4;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "no";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 12;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 29;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 42;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = 61;
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 70;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 86;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 120;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 136;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			case "donation":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 4;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 17;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 32;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 54;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 72;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 160;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 191;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 110;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = 128;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "";
				ps_text = "";
				
			break;
			
			case "donation_ps":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "no";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 8;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 23;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 33;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 160;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 87;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 101;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = 111;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 142;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			case "award":
				season_position = "";
				
				tougo_id = 1;
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3;
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "no";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 22;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 31;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 55;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = 62;
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 97;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 129;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 131;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			
			case "shinto":
				
				shinto_tenri_flag = "yes";
				
				var kaimyo_input_value = $F('kaimyo_input');
				
				if(kaimyo_input_value == "" || kaimyo_input_value == "＊＊＊戒＊＊＊名＊＊＊＊" ){
					kaimyo_input_value = "山田太郎";
				}
				
				var input_kaimyo = new Element('input', {type:'text', id:"kaimyo_input", size:8, value:kaimyo_input_value});
				
				$('kaimyo_td').update();
				
				
				
				var span01 = new Element('span').update('故');
				var span02 = new Element('span').update('命之霊');
				
				$('kaimyo_td').appendChild(span01);
				$('kaimyo_td').appendChild(input_kaimyo);
				$('kaimyo_td').appendChild(span02);
				
				kaimyo = "故" +  $F('kaimyo_input') + "命之霊";　
				
				　　　
				
				
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 17;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "yes";
				$('name_line_break_yes').checked = true;
				
				before_name_id = 26;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "故";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 46;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				//kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 162;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 88;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 122;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 138;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			case "tenri":
				
				shinto_tenri_flag = "yes";
				
				var kaimyo_input_value = $F('kaimyo_input');
				
				if(kaimyo_input_value == "" || kaimyo_input_value == "＊＊＊戒＊＊＊名＊＊＊＊" ){
					kaimyo_input_value = "山田太郎";
				}
				
				var input_kaimyo = new Element('input', {type:'text', id:"kaimyo_input", size:8, value:kaimyo_input_value});
				
				$('kaimyo_td').update();
				
				
				
				var span01 = new Element('span').update('故');
				var span02 = new Element('span').update('命之霊');
				
				$('kaimyo_td').appendChild(span01);
				$('kaimyo_td').appendChild(input_kaimyo);
				$('kaimyo_td').appendChild(span02);
				
				kaimyo = "故" +  $F('kaimyo_input') + "命之霊";　
				
				
			
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 17;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "yes";
				$('name_line_break_yes').checked = true;
				
				before_name_id = 26;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "故";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 47;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				//kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 162;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 88;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 122;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 138;
				ps_text = sentences[ps_id]['text'];
				
				
			break;
			
			case "christian":
		
				
		
		
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				first_paragraph_id = 17;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 31;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "故";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
					
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 48;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "no";
				$('kaimyo_line_break_no').checked = true;
				
				
				/*
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				*/
				kaimyo_before_id = "";
				kaimyo_before_text = "";
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				/*
				hoyo_id = 162;
				hoyo_text = sentences[hoyo_id]['text'];
				*/
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 89;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 123;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "138";
				ps_text = sentences[ps_id]['text'];
				
			break;
			
			case "tokai":
			
				season_position = "with_togo";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = current_season_id;
				season_text = sentences[season_id]['text'];
				
				
				first_paragraph_id = 8;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 26;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 37;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 64;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 79;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 103;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = 125;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "";
				ps_text = "";
				
				
			break;
			
			case "kansai":
					
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 14;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 25;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 42;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 71;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 160;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 95;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 113;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 137;
				ps_text = sentences[ps_id]['text'];
			break;
			
			case "no_maimyo":
			
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 14;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 25;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 35;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 65;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 77;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 113;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 135;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			case "tokyo":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 18;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 25;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 49;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 72;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 90;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 124;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "";
				ps_text = "";
			
			break;
			
			case "tokyo_no_kiake":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 18;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 25;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 50;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 91;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 124;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "";
				ps_text = "";
			
			break;
			
			case "no_maimyo2":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 20;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 23;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 51;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "yes";
				$('kaimyo_line_break_yes').checked = true;
				
				kaimyo_before_id = "";
				kaimyo_before_text = "";
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 93;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = 109;
				extra_text = sentences[extra_id]['text'];
	
				thelast_id = 126;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = "";
				ps_text = "";
				
			break;
			
			case "no_kaimyo_no_kiake":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
				
				
				first_paragraph_id = 20;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 23;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 51;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "no";
				$('kaimyo_line_break_no').checked = true;
				
				kaimyo_before_id = "";
				kaimyo_before_text = "";
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 94;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 126;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 136;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
			case "kansai_no_kaimyo":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
	
				first_paragraph_id = 8;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 30;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 53;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "no";
				$('kaimyo_line_break_no').checked = true;
				
				kaimyo_before_id = 72;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = 191;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 127;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 137;
				ps_text = sentences[ps_id]['text'];
			
			
			break;
			
			case "no_kaimyo_no_kiake2":
				season_position = "";
				
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				tougo_line_break = "yes";
				
				season_id = "";
				season_text = "";
	
				first_paragraph_id = 22;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				name_line_break = "no";
				$('name_line_break_no').checked = true;
				
				before_name_id = 27;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				
				$('name_prefix_text_menu').value=name_prefix_text;
				
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
				
			
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 56;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				kaimyo_line_break = "no";
				$('kaimyo_line_break_no').checked = true;
				
				kaimyo_before_id = "";
				kaimyo_before_text = "";
				
				kaimyo ="";
				kaimyo_disp_flag = "no";
				
				hoyo_id = "";
				hoyo_text = "";
				
				kaimyo_after_id = "";
				kaimyo_after_text = "";
			
				extra_id = "";
				extra_text = "";
	
				thelast_id = 130;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 132;
				ps_text = sentences[ps_id]['text'];
			
			
			break;
			
			case"normal":
				tougo_line_break = "yes";
	
				tougo_id = 1
				tougo_text = sentences[tougo_id]['text'];
				
				
				
				
				ketugo_id = 3
				ketugo_text = sentences[ketugo_id]['text'];
				
				season_id = "";
				season_text = "";
				season_position = "";
				
				first_paragraph_id = 8;
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				before_name_id = 23;
				before_name_text = sentences[before_name_id]['text'];
				
				name_prefix_text = "亡";
				$('name_prefix_text_menu').value=name_prefix_text;
				
				//relashion_id = $F('relation_menu');
				relation_text = $F('relation_menu');
				
				original_name = $F('name');
				
				$('name_line_break_no').checked = true;
				
				name_serfix_text = "儀";
			
				$('name_serfix_text_menu').value=name_serfix_text;
	
				tenjyu = "";
				the_age = "";
				award_name = "";
				donation_place = "";
				
				second_paragraph_id = 33;
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				
				
				name_line_break = "no";
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				
				kaimyo_before_id = 63;
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				kaimyo = $F('kaimyo_input');
				kaimyo_disp_flag = "yes";
				
				kaimyo_line_break = "yes";
				
				hoyo_id = 159;
				hoyo_text = sentences[hoyo_id]['text'];
				
				kaimyo_after_id = 74;
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
				
				
				
				extra_id = "";
				extra_text = "";
				
				
				thelast_id = 111;
				thelast_text = sentences[thelast_id]['text'];
				
				ps_id = 131;
				ps_text = sentences[ps_id]['text'];
			
			break;
			
		}
		
		$('not_used_area').update();
		
		//test = "";
		
		display_virtical_text();
		
		//$('notice').update('test');
	}
	
	
	function select_array(original_array,search_category,search_key){
	
				var selected_list = new Array();
				
				//$('notice').update(search_key);
				
				var count = 0;
				for(var i in original_array){
					
					if(original_array[i][search_category] == search_key){
						
						selected_list[count] = original_array[i];
						selected_list[count]['original_key'] = i;
						count++;
					}
		
				}
				
			
				return selected_list;
		
			}
			
	function basic_info_update(){
		
		if($F('relation_text_direct')){
			
			$('relation_menu')[0].selected = "selected";
			relation_text = $F('relation_text_direct');
			
		}else{
			relation_text = $F('relation_menu');
		}
		
		
		name_serfix_text = $F('name_serfix_text_menu');
		name_prefix_text = $F('name_prefix_text_menu');
		
		original_name = $F('name');
		sender_data = {todo: $F('todo'), siku: $F('siku'), banchi: $F('banchi'), buill: $F('buil'), mosyu: $F('mosyu')};
		
		if(kaimyo_disp_flag == "yes"){
			
			
			if(shinto_tenri_flag == "yes"){
				kaimyo = "故" +  $F('kaimyo_input') + "命之霊";
			}else{
				kaimyo = $F('kaimyo_input');
			}
				
			
			
			if($('name_line_break_yes').checked == true){
			
				name_line_break = "yes";
			}else{
				
				name_line_break = "no";
				
			}
			
			if($('kaimyo_line_break_yes').checked == true){
			
				kaimyo_line_break = "yes";
			}else{
				
				kaimyo_line_break = "no";
				
			}
		}
		//$('notice').update($('kaimyo_line_break_yes').checked + "," + $('kaimyo_line_break_no').checked == "checked")
	
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	
	}
	
			
	function tougo_ketsugo_by_id(){
		tougo_id = $F('tougo_id');
		ketugo_id = $F('ketugo_id');
		
		tougo_text = sentences[tougo_id]['text'];
		ketugo_text = sentences[ketugo_id]['text'];
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function tougo_ketsugo_by_text(){
		tougo_id = "";
		ketugo_id = "";
		
		$('tougo_id').value = "";
		$('ketugo_id').value = "";
		
		tougo_text = $F('tougo_text_direct');
		ketugo_text = $F('ketugo_text_direct');
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	
	
	function radio_change(id){
		
		tougo_line_break = $F(id);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
		
	}
	function season_modify(action_flag){
		
		switch(action_flag){
			case "no_season":
				
				season_id = "";
				season_text = "";
				season_position = "";
				
				//$('season').value = "";
				//$('season_text_direct').value = "";
				
			break;
			
			
			case "with_the_first":
			
				if(season_text == ""){
				
					if(season_id == ""){
						
						if($F('season') == ""){
							season_id = $F('season');
							
							$('season')[1].selected = "selected";
							season_id = $F('season');
							season_text = sentences[season_id]['text'];
							
							
						}else{
							season_id = $F('season');
							season_text = sentences[season_id]['text'];
						}
							
					}else{
						
						season_text = sentences[season_id]['text'];
					}
				}
				
				//$('notice').update(season_text);
				season_position = "with_the_first";
			
			
			break;
			
			case "with_togo":
			
				if(season_text == ""){
				
					if(season_id == ""){
						
						if($F('season') == ""){
							season_id = $F('season');
							
							$('season')[1].selected = "selected";
							season_id = $F('season');
							season_text = sentences[season_id]['text'];
							
							
						}else{
							season_id = $F('season');
							season_text = sentences[season_id]['text'];
						}
							
					}else{
						
						season_text = sentences[season_id]['text'];
					}
				}
				
				season_position = "with_togo";
			
			break;
			
			case "id":
				
				season_id = $F('season');
				season_text = sentences[season_id]['text'];
				
				if($('season_position_no').checked == "checked"){
					season_position = "with_togo";
					$('season_position_with_togo').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				season_id = "";
					
				$('season').value = "";
				
				season_text = $('season_text_direct').value;
				
				if($('season_position_no').checked == "checked"){
					season_position = "with_togo";
					$('season_position_with_togo').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
		
	}
	
	function first_paragraph(action_flag){
	
		switch(action_flag){
			case "no":
				
				first_paragraph_id = "";
				first_paragraph_text = "";
				
				$('first_paragraph_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(first_paragraph_text == ""){
				
					if(first_paragraph_id == ""){
						
						if($F('first_paragraph_id') == ""){
							//season_id = $F('first_paragraph_id');
							
							$('first_paragraph_id')[1].selected = "selected";
							first_paragraph_id = $F('first_paragraph_id');
							first_paragraph_text = sentences[first_paragraph_id]['text'];
							
							
						}else{
							first_paragraph_id = $F('first_paragraph_id');
							first_paragraph_text = sentences[first_paragraph_id]['text'];
						}
							
					}else{
						
						first_paragraph_text = sentences[first_paragraph_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				first_paragraph_id = $F('first_paragraph_id');
				first_paragraph_text = sentences[first_paragraph_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = first_paragraph_text.replace(/＠/g, CR);
					
					
				$('first_paragraph_text_direct').value = text_area_veiw;
				
				if($('first_paragraph_yes').checked != "checked"){
					
					$('first_paragraph_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				first_paragraph_id = "";
					
				$('first_paragraph_id').value = "";
				
				first_paragraph_text = document.getElementById('first_paragraph_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				first_paragraph_text = first_paragraph_text.replace(/\r\n/g, "＠");
				first_paragraph_text = first_paragraph_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('first_paragraph_yes').checked != "checked"){
					
					$('first_paragraph_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function second_paragraph(action_flag){
	
		switch(action_flag){
			case "no":
				
				second_paragraph_id = "";
				second_paragraph_text = "";
				
				$('second_paragraph_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(second_paragraph_text == ""){
				
					if(second_paragraph_id == ""){
						
						if($F('second_paragraph_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('second_paragraph_id')[1].selected = "selected";
							second_paragraph_id = $F('second_paragraph_id');
							second_paragraph_text = sentences[second_paragraph_id]['text'];
							
							
						}else{
							second_paragraph_id = $F('second_paragraph_id');
							second_paragraph_text = sentences[second_paragraph_id]['text'];
						}
							
					}else{
						
						second_paragraph_text = sentences[second_paragraph_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				second_paragraph_id = $F('second_paragraph_id');
				second_paragraph_text = sentences[second_paragraph_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = second_paragraph_text.replace(/＠/g ,  CR);
					
					
				$('second_paragraph_text_direct').value = text_area_veiw;
				
				if($('second_paragraph_yes').checked != "checked"){
					
					$('second_paragraph_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				second_paragraph_id = "";
					
				$('second_paragraph_id').value = "";
				
				second_paragraph_text = document.getElementById('second_paragraph_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				second_paragraph_text = second_paragraph_text.replace(/\r\n/g, "＠");
				second_paragraph_text = second_paragraph_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('second_paragraph_yes').checked != "checked"){
					
					$('second_paragraph_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	function second_paragraph_plus(action_flag){
		
		
	
		switch(action_flag){
			case "no":
				
				second_paragraph_plus_id = "";
				second_paragraph_plus_text = "";
				
				$('second_paragraph_plus_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(second_paragraph_plus_text == ""){
				
					if(second_paragraph_plus_id == ""){
						
						if($F('second_paragraph_plus_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('second_paragraph_plus_id')[1].selected = "selected";
							second_paragraph_plus_id = $F('second_paragraph_plus_id');
							second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
							
							
						}else{
							second_paragraph_plus_id = $F('second_paragraph_plus_id');
							second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
						}
							
					}else{
						
						second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				second_paragraph_plus_id = $F('second_paragraph_plus_id');
				
				
				switch($F('second_paragraph_plus_id')){
					case "60":
						var the_input = new Element('input',{type:"text", size:"3", id:"age_extra"});
						if(the_age){
							 the_input.value = the_age;
						 }
						 var the_span = new Element('span').update("才");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "second_paragraph_plus('age');"));
							}else{
								the_input2.setAttribute("onclick", "second_paragraph_plus('age')");
							}
						
						$('extrainput_area').update();
						 $('extrainput_area').appendChild(the_input);
						$('extrainput_area').appendChild(the_span);
						 $('extrainput_area').appendChild(the_input2);
					 
					
					break;
					
					case "62":
						var the_input = new Element('input',{type:"text", size:"5", id:"award_name"});
						 if(award_name){
							 the_input.value = award_name;
						 }
						 var the_span = new Element('span').update("勲章名");
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "second_paragraph_plus('award');"));
							}else{
								the_input2.setAttribute("onclick", "second_paragraph_plus('award')");
							}
						  
						  $('extrainput_area').update();
						 $('extrainput_area').appendChild(the_span);
						 $('extrainput_area').appendChild(the_input);
						
						 $('extrainput_area').appendChild(the_input2);
					
					break;
					
					default:
						 $('extrainput_area').update();
				}
				
				
				second_paragraph_plus_text = sentences[second_paragraph_plus_id]['text'];
				
				if(award_name){
					second_paragraph_plus_text = second_paragraph_plus_text.replace("＊＊", award_name);
				}
				
				if(the_age){
					if(isNaN(parseInt(the_age))){
				
						kanji_age = the_age;
							
					}else{
						kanji_age = convert_kanji_numeric(parseInt(the_age));
					}
				
					second_paragraph_plus_text = second_paragraph_plus_text.replace("＊＊", kanji_age);
					
					
				}
				
				
				var CR = getCRChars();
				var text_area_veiw = second_paragraph_plus_text.replace(/＠/g ,  CR);
					
					
				$('second_paragraph_plus_text_direct').value = text_area_veiw;
				
				if($('second_paragraph_plus_yes').checked != "checked"){
					
					$('second_paragraph_plus_yes').checked = "checked";
				}
			
			
			break;
			
			
			case "award":
				
				award_name = $F('award_name');
				
				second_paragraph_plus_text = second_paragraph_plus_text.replace("＊＊", $F('award_name'));
				
				var CR = getCRChars();
				var text_area_veiw = second_paragraph_plus_text.replace(/＠/g ,  CR);
				
				$('second_paragraph_plus_text_direct').value = text_area_veiw;
			
			break;
			
			
			
			case "age":
			
				the_age = $F('age_extra');
				if(isNaN(parseInt(the_age))){
				
					kanji_age = the_age;
						
				}else{
					kanji_age = convert_kanji_numeric(parseInt(the_age));
				}
				
				second_paragraph_plus_text = second_paragraph_plus_text.replace("＊＊", kanji_age);
				
				var CR = getCRChars();
				var text_area_veiw = second_paragraph_plus_text.replace(/＠/g ,  CR);
				
				$('second_paragraph_plus_text_direct').value = text_area_veiw;
			
			break;

			case "text":
			
				second_paragraph_plus_id = "";
					
				$('second_paragraph_plus_id').value = "";
				
				second_paragraph_plus_text = document.getElementById('second_paragraph_plus_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				second_paragraph_plus_text = second_paragraph_plus_text.replace(/\r\n/g, "＠");
				second_paragraph_plus_text = second_paragraph_plus_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('second_paragraph_plus_yes').checked != "checked"){
					
					$('second_paragraph_plus_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	function kaimyo_after(action_flag){
	
		switch(action_flag){
			case "no":
				
				kaimyo_after_id = "";
				kaimyo_after_text = "";
				
				$('kaimyo_after_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(kaimyo_after_text == ""){
				
					if(kaimyo_after_id == ""){
						
						if($F('kaimyo_after_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('kaimyo_after_id')[1].selected = "selected";
							kaimyo_after_id = $F('kaimyo_after_id');
							kaimyo_after_text = sentences[kaimyo_after_id]['text'];
							
							
						}else{
							kaimyo_after_id = $F('kaimyo_after_id');
							kaimyo_after_text = sentences[kaimyo_after_id]['text'];
						}
							
					}else{
						
						kaimyo_after_text = sentences[kaimyo_after_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				kaimyo_after_id = $F('kaimyo_after_id');
				kaimyo_after_text = sentences[kaimyo_after_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = kaimyo_after_text.replace(/＠/g ,  CR);
					
					
				$('kaimyo_after_text_direct').value = text_area_veiw;
				
				if($('kaimyo_after_yes').checked != "checked"){
					
					$('kaimyo_after_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				kaimyo_after_id = "";
					
				$('kaimyo_after_id').value = "";
				
				kaimyo_after_text = document.getElementById('kaimyo_after_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				kaimyo_after_text = kaimyo_after_text.replace(/\r\n/g, "＠");
				kaimyo_after_text = kaimyo_after_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('kaimyo_after_yes').checked != "checked"){
					
					$('kaimyo_after_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function extra(action_flag){
	
		switch(action_flag){
			case "no":
				
				extra_id = "";
				extra_text = "";
				
				$('extra_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(extra_text == ""){
				
					if(extra_id == ""){
						
						if($F('extra_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('extra_id')[1].selected = "selected";
							extra_id = $F('extra_id');
							extra_text = sentences[extra_id]['text'];
							
							
						}else{
							extra_id = $F('extra_id');
							extra_text = sentences[extra_id]['text'];
						}
							
					}else{
						
						extra_text = sentences[extra_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				extra_id = $F('extra_id');
				extra_text = sentences[extra_id]['text'];
				
				if(extra_id == "110"){
					
						var the_input = new Element('input',{type:"text", size:"13", id:"donation_at_extra"});
						if(donation_place){
							 the_input.value = donation_place;
						 }
						 var the_span = new Element('span').update("寄付先");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "extra('donation');"));
							}else{
								the_input2.setAttribute("onclick", "extra('donation')");
							}
						
						$('extrainput_area_at_extra').update();
						$('extrainput_area_at_extra').appendChild(the_span);
						$('extrainput_area_at_extra').appendChild(the_input);
						$('extrainput_area_at_extra').appendChild(the_input2);
					 
				}else{
					$('extrainput_area_at_extra').update();
				}
				
				
				var CR = getCRChars();
				var text_area_veiw = extra_text.replace(/＠/g ,  CR);
					
					
				$('extra_text_direct').value = text_area_veiw;
				
				if($('extra_yes').checked != "checked"){
					
					$('extra_yes').checked = "checked";
				}
			
			
			break;
			
			case "donation":
				donation_place = $F('donation_at_extra');
				
				extra_text = extra_text.replace("＊＊", donation_place);
				
				var CR = getCRChars();
				var text_area_veiw = extra_text.replace(/＠/g ,  CR);
				
				$('extra_text_direct').value = text_area_veiw;
				
			break;
			
			case "text":
			
				extra_id = "";
					
				$('extra_id').value = "";
				
				extra_text = document.getElementById('extra_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				extra_text = extra_text.replace(/\r\n/g, "＠");
				extra_text = extra_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('extra_yes').checked != "checked"){
					
					$('extra_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function thelast(action_flag){
	
		switch(action_flag){
			case "no":
				
				thelast_id = "";
				thelast_text = "";
				
				$('thelast_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(thelast_text == ""){
				
					if(thelast_id == ""){
						
						if($F('thelast_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('thelast_id')[1].selected = "selected";
							thelast_id = $F('thelast_id');
							thelast_text = sentences[thelast_id]['text'];
							
							
						}else{
							thelast_id = $F('thelast_id');
							thelast_text = sentences[thelast_id]['text'];
						}
							
					}else{
						
						thelast_text = sentences[thelast_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				thelast_id = $F('thelast_id');
				thelast_text = sentences[thelast_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = thelast_text.replace(/＠/g ,  CR);
					
					
				$('thelast_text_direct').value = text_area_veiw;
				
				if($('thelast_yes').checked != "checked"){
					
					$('thelast_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				thelast_id = "";
					
				$('thelast_id').value = "";
				
				thelast_text = document.getElementById('thelast_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				thelast_text = thelast_text.replace(/\r\n/g, "＠");
				thelast_text = thelast_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('thelast_yes').checked != "checked"){
					
					$('thelast_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	function ps(action_flag){
	
		switch(action_flag){
			case "no":
				
				ps_id = "";
				ps_text = "";
				
				$('ps_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(ps_text == ""){
				
					if(ps_id == ""){
						
						if($F('ps_id') == ""){
							//season_id = $F('second_paragraph_id');
							
							$('ps_id')[1].selected = "selected";
							ps_id = $F('ps_id');
							ps_text = sentences[ps_id]['text'];
							
							
						}else{
							ps_id = $F('ps_id');
							ps_text = sentences[ps_id]['text'];
						}
							
					}else{
						
						ps_text = sentences[ps_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				ps_id = $F('ps_id');
				ps_text = sentences[ps_id]['text'];
				
				
				var the_div = new Element('div',{id:"extrainput_area_at_ps"});
				
				
				
				
				if(ps_id == "142"){
					
						var the_input = new Element('input',{type:"text", size:"13", id:"donation_at_ps"});
						if(donation_place){
							 the_input.value = donation_place;
						 }
						 var the_span = new Element('span').update("寄付先");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "ps('donation');"));
							}else{
								the_input2.setAttribute("onclick", "ps('donation')");
							}
						
						$('extrainput_area_at_ps').update();
						$('extrainput_area_at_ps').appendChild(the_span);
						$('extrainput_area_at_ps').appendChild(the_input);
						$('extrainput_area_at_ps').appendChild(the_input2);
					 
				}else{
					$('extrainput_area_at_ps').update();
				}
				
				
				
				var CR = getCRChars();
				var text_area_veiw = ps_text.replace(/＠/g ,  CR);
					
					
				$('ps_text_direct').value = text_area_veiw;
				
				if($('ps_yes').checked != "checked"){
					
					$('ps_yes').checked = "checked";
				}
			
			
			break;
			
			case "donation":
				donation_place = $F('donation_at_ps');
				
				ps_text = ps_text.replace("＊＊", donation_place);
				
				var CR = getCRChars();
				var text_area_veiw = ps_text.replace(/＠/g ,  CR);
				
				$('ps_text_direct').value = text_area_veiw;
				
			break;
			
			
			
			case "text":
			
				ps_id = "";
					
				$('ps_id').value = "";
				
				ps_text = document.getElementById('ps_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				ps_text = ps_text.replace(/\r\n/g, "＠");
				ps_text = ps_text.replace(/(\n|\r)/g, "＠");


				
				
				
				if($('ps_yes').checked != "checked"){
					
					$('ps_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	
	function before_name(action_flag){
		
		
		
		
		switch(action_flag){
			case "no":
				
				before_name_id = "";
				before_name_text = "";
				
				$('before_name_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(before_name_text == ""){
				
					if(before_name_id == ""){
						
						if($F('before_name_id') == ""){
							before_name_id = $F('before_name_id');
							
							$('before_name_id')[1].selected = "selected";
							before_name_id = $F('before_name_id');
							before_name_text = sentences[before_name_id]['text'];
							
							
						}else{
							before_name_id = $F('before_name_id');
							before_name_text = sentences[before_name_id]['text'];
						}
							
					}else{
						
						before_name_text = sentences[before_name_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				before_name_id = $F('before_name_id');
				before_name_text = sentences[before_name_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = before_name_text.replace(/＠/g ,  CR);
					
					
				$('before_name_text_direct').value = text_area_veiw;
				
				if($('before_name_yes').checked != "checked"){
					
					$('before_name_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				before_name_id = "";
					
				$('before_name_id').value = "";
				
				before_name_text = document.getElementById('before_name_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				before_name_text = before_name_text.replace(/\r\n/g, "＠");
				before_name_text = before_name_text.replace(/(\n|\r)/g, "＠");


				
				if($('before_name_yes').checked != "checked"){
					
					$('before_name_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		//$('notice').update(before_name_text);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function kaimyo_before(action_flag){

		switch(action_flag){
			case "no":
				
				kaimyo_before_id = "";
				kaimyo_before_text = "";
				
				$('kaimyo_before_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(kaimyo_before_text == ""){
				
					if(kaimyo_before_id == ""){
						
						if($F('kaimyo_before_id') == ""){
							kaimyo_before_id = $F('kaimyo_before_id');
							
							$('kaimyo_before_id')[1].selected = "selected";
							kaimyo_before_id = $F('kaimyo_before_id');
							kaimyo_before_text = sentences[kaimyo_before_id]['text'];
							
							
						}else{
							kaimyo_before_id = $F('kaimyo_before_id');
							kaimyo_before_text = sentences[kaimyo_before_id]['text'];
						}
							
					}else{
						
						kaimyo_before_text = sentences[kaimyo_before_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				kaimyo_before_id = $F('kaimyo_before_id');
				kaimyo_before_text = sentences[kaimyo_before_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = kaimyo_before_text.replace(/＠/g ,  CR);
					
					
				$('kaimyo_before_text_direct').value = text_area_veiw;
				
				if($('kaimyo_before_yes').checked != "checked"){
					
					$('kaimyo_before_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				kaimyo_before_id = "";
					
				$('kaimyo_before_id').value = "";
				
				kaimyo_before_text = document.getElementById('kaimyo_before_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				kaimyo_before_text = kaimyo_before_text.replace(/\r\n/g, "＠");
				kaimyo_before_text = kaimyo_before_text.replace(/(\n|\r)/g, "＠");


				
				if($('kaimyo_before_yes').checked != "checked"){
					
					$('kaimyo_before_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		//$('notice').update(before_name_text);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	
	function hoyo(action_flag){

		switch(action_flag){
			case "no":
				
				hoyo_id = "";
				hoyo_text = "";
				
				$('hoyo_id')[0].selected = "selected";
				
	
			break;
			
			case "yes":
			
				if(hoyo_text == ""){
				
					if(hoyo_id == ""){
						
						if($F('hoyo_id') == ""){
							hoyo_id = $F('hoyo_id');
							
							$('hoyo_id')[1].selected = "selected";
							hoyo_id = $F('hoyo_id');
							hoyo_text = sentences[hoyo_id]['text'];
							
							
						}else{
							hoyo_id = $F('hoyo_id');
							hoyo_text = sentences[hoyo_id]['text'];
						}
							
					}else{
						
						hoyo_text = sentences[hoyo_id]['text'];
					}
				}
	
			break;
			
			case "id":
				
				hoyo_id = $F('hoyo_id');
				hoyo_text = sentences[hoyo_id]['text'];
				
				var CR = getCRChars();
				var text_area_veiw = hoyo_text.replace(/＠/g ,  CR);
					
					
				$('hoyo_text_direct').value = text_area_veiw;
				
				if($('hoyo_yes').checked != "checked"){
					
					$('hoyo_yes').checked = "checked";
				}
			
			
			break;
			
			case "text":
			
				hoyo_id = "";
					
				$('hoyo_id').value = "";
				
				hoyo_text = document.getElementById('hoyo_text_direct').value;
				
				//********         $('first_paragraph_text_direct').value   ではどういう訳か　改行コードが空白になって返される。　prototypeの問題だと思う。
				
				
				
				kaimyo_before_text = kaimyo_before_text.replace(/\r\n/g, "＠");
				kaimyo_before_text = kaimyo_before_text.replace(/(\n|\r)/g, "＠");


				
				if($('hoyo_yes').checked != "checked"){
					
					$('hoyo_yes').checked = "checked";
				}
				
				
			
			break;
			
		}
		
		
		//$('notice').update(before_name_text);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function date_update(){

		
				
				theyear = $F('year_menu');
				themonth = parseInt($F('month_menu'));
				
				
				
			
			
			
		
		
		//$('notice').update(before_name_text);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	function tenjyu_update(action){
		
		the_age = $F('age_input');
		
		switch(action){
			
			case"yes":
			
					tenjyu = "yes";
				break;
				
			case"no":
					tenjyu = "no";
			
				break;
				
			default:
			
				
			
		}
				
				
				
		
		//$('notice').update(before_name_text);
		
		$('not_used_area').update();
		$('display_area').update();
		display_virtical_text();
	}
	
	

	
	function click_letter(event){
		
		var window_flag = "yes";
	
		var the_tile = "";
		var the_table = new Element('table', {border: "1",  cellpadding: "2", cellspacing: "0", align:"center"});
		var the_tbody = new Element('tbody');
		
		//************************  2009/11/02　　　　テーブルのボーダーが反映されない・問題・未解決
		
		switch (this.name) {
			case "tougo":
			case "ketugo":
				var the_width = 280;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
				
			
			
				the_tile = "頭語・結語";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("頭語<br>および<br>結語");
				
				var td0102 = new Element('td');
				var span_01 = new Element('span').update("頭語");
				var tougo_menu = new Element('select', { id:"tougo_id"});
				
				var tougo_array = select_array(sentences,"category","書出");
				
				//var test = "";
				var tougo_opton = new Element("option", {value:""}).update("無し");
				tougo_menu.appendChild(tougo_opton);
				
				for(var i = 0 ; i < tougo_array.length; i++){
				
					var tougo_opton = new Element("option", {value:tougo_array[i]['original_key']}).update(tougo_array[i]['text']);
					
					if(tougo_id == tougo_array[i]['original_key']){
						tougo_opton.setAttribute("selected", "selected");
					}
					
					tougo_menu.appendChild(tougo_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					tougo_menu.setAttribute("onchange", new Function( "tougo_ketsugo_by_id();"));
				}else{
					tougo_menu.setAttribute("onchange", "tougo_ketsugo_by_id()");
				}
				
				
				
				
				var span_02 = new Element('span').update("・結語");
				var ketugo_menu = new Element('select', { id:"ketugo_id"});
				
				var ketugo_array = select_array(sentences,"category","締括");
				
				//var test = "";
				var ketugo_opton = new Element("option", {value:""}).update("無し");
				ketugo_menu.appendChild(ketugo_opton);
				
				for(var i = 0 ; i < ketugo_array.length; i++){
				
					var ketugo_opton = new Element("option", {value:ketugo_array[i]['original_key']}).update(ketugo_array[i]['text']);
					
					if(ketugo_id == ketugo_array[i]['original_key']){
						ketugo_opton.setAttribute("selected", "selected");
					}
					
					
					ketugo_menu.appendChild(ketugo_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					ketugo_menu.setAttribute("onhange", new Function( "tougo_ketsugo_by_id();"));
				}else{
					ketugo_menu.setAttribute("onchange", "tougo_ketsugo_by_id()");
				}
				
				
				
				
				td0102.appendChild(span_01);
				td0102.appendChild(tougo_menu);
				
				td0102.appendChild(span_02);
				td0102.appendChild(ketugo_menu);
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他の表記<br>頭語");
				var input01 = new Element('input', {type:"text", size:"4", id:"tougo_text_direct"});
				var span04 = new Element('span').update("・結語");
				var input02 = new Element('input', {type:"text", size:"4", id:"ketugo_text_direct"});
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "tougo_ketsugo_by_text();"));
				}else{
					input03.setAttribute("onclick", "tougo_ketsugo_by_text()");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(span04);
				td0202.appendChild(input02);
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				var input04 = new Element('input', {type:"radio", id:"togo_line_break_yes", name:"togo_line_break", value:"yes"});
				var span05 = new Element("span").update("改行する");
				var input05 = new Element('input', {type:"radio", id:"togo_line_break_no", name:"togo_line_break", value:"no"});
				var span06 = new Element("span").update("改行しない");
				
				if(tougo_line_break == "yes"){
					input04.setAttribute("checked", "checked");
				}else{
					input05.setAttribute("checked", "checked");
				}
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "radio_change('togo_line_break_yes');"));
				}else{
					input04.setAttribute("onchange", "radio_change('togo_line_break_yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "radio_change('togo_line_break_no');"));
				}else{
					input05.setAttribute("onchange", "radio_change('togo_line_break_no')");
				}
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
				
				//$('notice').update(test);
			
				
				break;
			case "season":
			
				var the_width = 210;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
				
			
			
				
				
				switch(themonth){
					case 12:
					case 1:
					case 2:
						var season_flag = "冬";
					break;
					
					case 3:
					case 4:
					case 5:
						var season_flag = "春";
					break;
					
					case 6:
					case 7:
					case 8:
						var season_flag = "夏";
					break;
					
					case 9:
					case 10:
					case 11:
						var season_flag = "秋";
		
					  break;
					
				}
				
				
				the_tile = "季節" /*+ themonth　*/;
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("季節");
				
				var td0102 = new Element('td');
				
				var season_menu = new Element('select', { id:"season"});
				
				var season_array = select_array(sentences,"category","季節");
				
				//var test = "";
				var selected_season_array = new Array();
				for(var i =0; i < season_array.length ; i++){
				
					if(season_array[i]['flag'].indexOf(season_flag) != -1){
						selected_season_array.push(season_array[i]);
					}
					
					//test +=  season_array[i]['text'] + "-" + season_array[i]['flag'] + "<br>";
				}
				
				//$('notice').update(season_flag + themonth);
				
				
				
				//var test = "";
				var season_opton = new Element("option", {value:""}).update("無し");
				season_menu.appendChild(season_opton);
				
				for(var i = 0 ; i < selected_season_array.length; i++){
				
					var season_opton = new Element("option", {value:selected_season_array[i]['original_key']}).update(selected_season_array[i]['text']);
					
					if(season_id == selected_season_array[i]['original_key']){
						season_opton.setAttribute("selected", "selected");
					}
					
					season_menu.appendChild(season_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					season_menu.setAttribute("onchange", new Function( "season_modify('id');"));
				}else{
					season_menu.setAttribute("onchange", "season_modify('id')");
				}
				
				
				td0102.appendChild(season_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('input', {type:"text", size:"7", id:"season_text_direct"});
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "season_modify('text');"));
				}else{
					input03.setAttribute("onclick", "season_modify('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("頭語に続ける<br>");
				
				var span06 = new Element("span").update("第一段落の筆頭に<br>");
				
				var span07 = new Element("span").update("つけない");
				
				
					
				switch(tougo_line_break){
					case "with_togo":
						var input04 = new Element('input', {type:"radio", id:"season_position_with_togo", name:"season_position", value:"with_togo", checked:"checked"});
						var input05 = new Element('input', {type:"radio", id:"season_position_first_paragraph", name:"season_position", value:"with_the_first"});
						var input06 = new Element('input', {type:"radio", id:"season_position_no", name:"season_position", value:""});
					  //input04.setAttribute("checked", "checked");
					  break;
					case "first_paragraph":
						var input04 = new Element('input', {type:"radio", id:"season_position_with_togo", name:"season_position", value:"with_togo"});
						var input05 = new Element('input', {type:"radio", id:"season_position_first_paragraph", name:"season_position", value:"with_the_first", checked:"checked"});
						var input06 = new Element('input', {type:"radio", id:"season_position_no", name:"season_position", value:""});
					 
					  break;
					default:
					 	var input04 = new Element('input', {type:"radio", id:"season_position_with_togo", name:"season_position", value:"with_togo", checked:"checked"});
						var input05 = new Element('input', {type:"radio", id:"season_position_first_paragraph", name:"season_position", value:"with_the_first"});
						var input06 = new Element('input', {type:"radio", id:"season_position_no", name:"season_position", value:"", checked:"checked"});
				}
				
				
				
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "season_modify('with_togo');"));
				}else{
					input04.setAttribute("onchange", "season_modify('with_togo')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "radio_change('with_the_first');"));
				}else{
					input05.setAttribute("onchange", "season_modify('with_the_first')");
				}
				
				if(the_browser == "MSIE"){
					input06.setAttribute("onchange", new Function( "radio_change('no_season');"));
				}else{
					input06.setAttribute("onchange", "season_modify('no_season')");
				}
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				td0302.appendChild(input06);
				td0302.appendChild(span07);
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
				
				
				
				break;
				
			case "first_paragraph":
			
				var the_width = 400;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "第一段落";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("第一段落");
				
				var td0102 = new Element('td');
				
				var first_paragraph_menu = new Element('select', { id:"first_paragraph_id"});
				
				var first_paragraph_array = select_array(sentences,"category","段落１");
				
				
				var first_paragraph_opton = new Element("option", {value:""}).update("無し");
				first_paragraph_menu.appendChild(first_paragraph_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < first_paragraph_array.length; i++){
					
					var menu_text = "";
					if(first_paragraph_array[i]['text'].length > menu_text_length){
						
						menu_text = first_paragraph_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = first_paragraph_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var first_paragraph_opton = new Element("option", {value:first_paragraph_array[i]['original_key']}).update(menu_text);
					
					if(first_paragraph_id == first_paragraph_array[i]['original_key']){
						first_paragraph_opton.setAttribute("selected", "selected");
					}
					
					first_paragraph_menu.appendChild(first_paragraph_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					first_paragraph_menu.setAttribute("onchange", new Function( "first_paragraph('id');"));
				}else{
					first_paragraph_menu.setAttribute("onchange", "first_paragraph('id')");
				}
				
				
				td0102.appendChild(first_paragraph_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:30, rows:5, id:"first_paragraph_text_direct"});
				
				
				if(first_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = first_paragraph_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "first_paragraph('text');"));
				}else{
					input03.setAttribute("onclick", "first_paragraph('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(first_paragraph_text){
					
					var input04 = new Element('input', {type:"radio", id:"first_paragraph_yes", name:"first_paragraph", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"first_paragraph_no", name:"first_paragraph", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"first_paragraph_yes", name:"first_paragraph", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"first_paragraph_no", name:"first_paragraph", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "first_paragraph('yes');"));
				}else{
					input04.setAttribute("onchange", "first_paragraph('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "first_paragraph('no');"));
				}else{
					input05.setAttribute("onchange", "first_paragraph('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
			case "before_name":
			
				
				var the_width = 260;
				
				$('detailed_info_td_top').style.width = the_width - 23 + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = the_width - 15 + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "俗名・前";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("俗名・前");
				
				var td0102 = new Element('td');
				
				var before_name_menu = new Element('select', { id:"before_name_id"});
				
				var before_name_array = select_array(sentences,"category","俗名前");
				
				
				var before_name_opton = new Element("option", {value:""}).update("無し");
				before_name_menu.appendChild(before_name_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < before_name_array.length; i++){
					
					var menu_text = "";
					if(before_name_array[i]['text'].length > menu_text_length){
						
						menu_text = before_name_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = before_name_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var before_name_opton = new Element("option", {value:before_name_array[i]['original_key']}).update(menu_text);
					
					if(before_name_id == before_name_array[i]['original_key']){
						before_name_opton.setAttribute("selected", "selected");
					}
					
					before_name_menu.appendChild(before_name_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					before_name_menu.setAttribute("onchange", new Function( "before_name('id');"));
				}else{
					before_name_menu.setAttribute("onchange", "before_name('id')");
				}
				
				
				td0102.appendChild(before_name_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('input', {type:"text", id:"before_name_text_direct"});
				
				//alert(before_name_text);
				if(before_name_text){
					var CR = getCRChars();
					var text_area_veiw = before_name_text.replace(/＠/g ,  CR);
					
					input01.value = (text_area_veiw);
				}
				
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "before_name('text');"));
				}else{
					input03.setAttribute("onclick", "before_name('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				
				
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				var input04 = new Element('input', {type:"radio", id:"before_name_yes", name:"before_name", value:"yes"});
				var span05 = new Element("span").update("表示する<br>");
				var input05 = new Element('input', {type:"radio", id:"before_name_no", name:"before_name", value:"no"});
				var span06 = new Element("span").update("表示しない");
				
				
				
					
				if(before_name_text){
					input04.setAttribute("checked", "checked");
				}else{
					input05.setAttribute("checked", "checked");
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "before_name('yes');"));
				}else{
					input04.setAttribute("onchange", "before_name('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "before_name('no');"));
				}else{
					input05.setAttribute("onchange", "before_name('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
				break;
				
			case"name_prefix_text":
			case"original_name":
			case"name_serfix_text":
			case"kaimyo":
			case"address":
			case"mosyu":
					
					
					
					$('basic_info_window').style.zIndex = z_index++;
					
					if($('basic_info').style.display == "none"){
						
						Effect.toggle('basic_info', 'appear');
						
					}
					
					new Effect.Move($('basic_info_window'), { x: 300, y: 220, mode: 'absolute' });
					
					window_flag = "no";
				
				break;
				
			case "second_paragraph":
			
				var the_width = 400;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "第二段落";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("第二段落");
				
				var td0102 = new Element('td');
				
				var second_paragraph_menu = new Element('select', { id:"second_paragraph_id"});
				
				var second_paragraph_array = select_array(sentences,"category","段落２");
				
				
				var second_paragraph_opton = new Element("option", {value:""}).update("無し");
				second_paragraph_menu.appendChild(second_paragraph_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < second_paragraph_array.length; i++){
					
					var menu_text = "";
					if(second_paragraph_array[i]['text'].length > menu_text_length){
						
						menu_text = second_paragraph_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = second_paragraph_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var second_paragraph_opton = new Element("option", {value:second_paragraph_array[i]['original_key']}).update(menu_text);
					
					if(second_paragraph_id == second_paragraph_array[i]['original_key']){
						second_paragraph_opton.setAttribute("selected", "selected");
					}
					
					second_paragraph_menu.appendChild(second_paragraph_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					second_paragraph_menu.setAttribute("onchange", new Function( "second_paragraph('id');"));
				}else{
					second_paragraph_menu.setAttribute("onchange", "second_paragraph('id')");
				}
				
				
				td0102.appendChild(second_paragraph_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:30, rows:5, id:"second_paragraph_text_direct"});
				
				
				if(second_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = second_paragraph_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "second_paragraph('text');"));
				}else{
					input03.setAttribute("onclick", "second_paragraph('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(second_paragraph_text){
					
					var input04 = new Element('input', {type:"radio", id:"second_paragraph_yes", name:"second_paragraph", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"second_paragraph_no", name:"second_paragraph", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"second_paragraph_yes", name:"second_paragraph", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"second_paragraph_no", name:"second_paragraph", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "second_paragraph('yes');"));
				}else{
					input04.setAttribute("onchange", "second_paragraph('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "second_paragraph('no');"));
				}else{
					input05.setAttribute("onchange", "second_paragraph('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
				
			case "second_paragraph_plus":
			
				var the_width = 500;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "第二段落・追記";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("第二段落・追記");
				
				var td0102 = new Element('td');
				
				var second_paragraph_plus_menu = new Element('select', { id:"second_paragraph_plus_id"});
				
				var second_paragraph_plus_array = select_array(sentences,"category","段落２＋");
				
				
				var second_paragraph_plus_opton = new Element("option", {value:""}).update("無し");
				second_paragraph_plus_menu.appendChild(second_paragraph_plus_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < second_paragraph_plus_array.length; i++){
					
					var menu_text = "";
					if(second_paragraph_plus_array[i]['text'].length > menu_text_length){
						
						menu_text = second_paragraph_plus_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = second_paragraph_plus_array[i]['text']
						
					}
					
					//var menu_text = menu_text.replace(/＠/g ,  " ");
					
					
					//var menu_text = second_paragraph_plus_text;
					
					
					/*
					while(menu_text.indexOf("＠") != -1){
						menu_text = menu_text.replace(/＠/g ,  " ");
					}
					*/
					
					var menu_text = menu_text.replace(/＠/g, " ");
					
				
					var second_paragraph_plus_opton = new Element("option", {value:second_paragraph_plus_array[i]['original_key']}).update(menu_text);
					
					if(second_paragraph_plus_id == second_paragraph_plus_array[i]['original_key']){
						second_paragraph_plus_opton.setAttribute("selected", "selected");
					}
					
					second_paragraph_plus_menu.appendChild(second_paragraph_plus_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					second_paragraph_plus_menu.setAttribute("onchange", new Function( "second_paragraph_plus('id');"));
				}else{
					second_paragraph_plus_menu.setAttribute("onchange", "second_paragraph_plus('id')");
				}
				
				
				td0102.appendChild(second_paragraph_plus_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:45, rows:6, id:"second_paragraph_plus_text_direct"});
				
				
				if(second_paragraph_plus_text){
					var CR = getCRChars();
					
					
					var text_area_veiw = second_paragraph_plus_text;
					
					while(text_area_veiw.indexOf("＠") != -1){
						text_area_veiw = text_area_veiw.replace(/＠/g, CR);
					}
					
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "second_paragraph_plus('text');"));
				}else{
					input03.setAttribute("onclick", "second_paragraph_plus('text')");
				}
				
				
				
				td0202.appendChild(span03);
				
				var the_div = new Element('div',{id:"extrainput_area"});
				
				td0202.appendChild(the_div);
				
				
				
				 switch(second_paragraph_plus_id){
					case 60:
						//$('notice').update(second_paragraph_plus_id);
						
						var the_input = new Element('input',{type:"text", size:"3", id:"age_extra"});
						if(the_age){
							 the_input.value = the_age;
						 }
						 var the_span = new Element('span').update("才");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "second_paragraph_plus('age');"));
							}else{
								the_input2.setAttribute("onclick", "second_paragraph_plus('age')");
							}
						
						the_div.update();
						 the_div.appendChild(the_input);
						the_div.appendChild(the_span);
						 the_div.appendChild(the_input2);
					 
					
					break;
					
					case 62:
						var the_input = new Element('input',{type:"text", size:"5", id:"award_name"});
						 if(award_name){
							 the_input.value = award_name;
						 }
						 var the_span = new Element('span').update("勲章名");
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "second_paragraph_plus('award');"));
							}else{
								the_input2.setAttribute("onclick", "second_paragraph_plus('award')");
							}
						  
						  the_div.update();
						 the_div.appendChild(the_span);
						 the_div.appendChild(the_input);
						
						 the_div.appendChild(the_input2);
					
					break;
					
					default:
						 the_div.update();
				}
				
				 
				
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(second_paragraph_plus_text){
					
					var input04 = new Element('input', {type:"radio", id:"second_paragraph_plus_yes", name:"second_paragraph_plus", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"second_paragraph_plus_no", name:"second_paragraph_plus", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"second_paragraph_plus_yes", name:"second_paragraph_plus", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"second_paragraph_plus_no", name:"second_paragraph_plus", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "second_paragraph_plus('yes');"));
				}else{
					input04.setAttribute("onchange", "second_paragraph_plus('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "second_paragraph_plus('no');"));
				}else{
					input05.setAttribute("onchange", "second_paragraph_plus('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
			case "kaimyo_before":
			
				
				var the_width = 260;
				
				$('detailed_info_td_top').style.width = the_width - 23 + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = the_width - 15 + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "戒名・前";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("戒名・前");
				
				var td0102 = new Element('td');
				
				var kaimyo_before_menu = new Element('select', { id:"kaimyo_before_id"});
				
				var kaimyo_before_array = select_array(sentences,"category","戒名前");
				
				
				var kaimyo_before_opton = new Element("option", {value:""}).update("無し");
				kaimyo_before_menu.appendChild(kaimyo_before_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < kaimyo_before_array.length; i++){
					
					var menu_text = "";
					if(kaimyo_before_array[i]['text'].length > menu_text_length){
						
						menu_text = kaimyo_before_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = kaimyo_before_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var kaimyo_before_opton = new Element("option", {value:kaimyo_before_array[i]['original_key']}).update(menu_text);
					
					if(kaimyo_before_id == kaimyo_before_array[i]['original_key']){
						kaimyo_before_opton.setAttribute("selected", "selected");
					}
					
					kaimyo_before_menu.appendChild(kaimyo_before_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					kaimyo_before_menu.setAttribute("onchange", new Function( "kaimyo_before('id');"));
				}else{
					kaimyo_before_menu.setAttribute("onchange", "kaimyo_before('id')");
				}
				
				
				td0102.appendChild(kaimyo_before_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('input', {type:"text", id:"kaimyo_before_text_direct"});
				
				//alert(before_name_text);
				if(kaimyo_before_text){
					var CR = getCRChars();
					var text_area_veiw = kaimyo_before_text.replace(/＠/g ,  CR);
					
					input01.value = (text_area_veiw);
				}
				
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "kaimyo_before('text');"));
				}else{
					input03.setAttribute("onclick", "kaimyo_before('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				
				
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				var input04 = new Element('input', {type:"radio", id:"kaimyo_before_yes", name:"kaimyo_before", value:"yes"});
				var span05 = new Element("span").update("表示する<br>");
				var input05 = new Element('input', {type:"radio", id:"kaimyo_before_no", name:"kaimyo_before", value:"no"});
				var span06 = new Element("span").update("表示しない");
				
				
				
					
				if(kaimyo_before_text){
					input04.setAttribute("checked", "checked");
				}else{
					input05.setAttribute("checked", "checked");
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "kaimyo_before('yes');"));
				}else{
					input04.setAttribute("onchange", "kaimyo_before('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "kaimyo_before('no');"));
				}else{
					input05.setAttribute("onchange", "kaimyo_before('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
				break;
				
				
				
			case "hoyo":
			
				
				var the_width = 260;
				
				$('detailed_info_td_top').style.width = the_width - 23 + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = the_width - 15 + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "法要";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("法要");
				
				var td0102 = new Element('td');
				
				var hoyo_menu = new Element('select', { id:"hoyo_id"});
				
				var hoyo_array = select_array(sentences,"category","法要");
				
				
				var hoyo_opton = new Element("option", {value:""}).update("無し");
				hoyo_menu.appendChild(hoyo_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < hoyo_array.length; i++){
					
					var menu_text = "";
					if(hoyo_array[i]['text'].length > menu_text_length){
						
						menu_text = hoyo_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = hoyo_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var hoyo_opton = new Element("option", {value:hoyo_array[i]['original_key']}).update(menu_text);
					
					if(hoyo_id == hoyo_array[i]['original_key']){
						hoyo_opton.setAttribute("selected", "selected");
					}
					
					hoyo_menu.appendChild(hoyo_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					hoyo_menu.setAttribute("onchange", new Function( "hoyo('id');"));
				}else{
					hoyo_menu.setAttribute("onchange", "hoyo('id')");
				}
				
				
				td0102.appendChild(hoyo_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('input', {type:"text", id:"hoyo_text_direct"});
				
				//alert(before_name_text);
				if(hoyo_text){
					var CR = getCRChars();
					var text_area_veiw = hoyo_text.replace(/＠/g ,  CR);
					
					input01.value = (text_area_veiw);
				}
				
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "hoyo('text');"));
				}else{
					input03.setAttribute("onclick", "hoyo('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				
				
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				var input04 = new Element('input', {type:"radio", id:"hoyo_yes", name:"hoyo", value:"yes"});
				var span05 = new Element("span").update("表示する<br>");
				var input05 = new Element('input', {type:"radio", id:"hoyo_no", name:"hoyo", value:"no"});
				var span06 = new Element("span").update("表示しない");
				
				
				
					
				if(hoyo_text){
					input04.setAttribute("checked", "checked");
				}else{
					input05.setAttribute("checked", "checked");
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "hoyo('yes');"));
				}else{
					input04.setAttribute("onchange", "hoyo('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "hoyo('no');"));
				}else{
					input05.setAttribute("onchange", "hoyo('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
				break;
				
			case "kaimyo_after":
			
				var the_width = 400;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "戒名・後";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("戒名・後");
				
				var td0102 = new Element('td');
				
				var kaimyo_after_menu = new Element('select', { id:"kaimyo_after_id"});
				
				var kaimyo_after_array = select_array(sentences,"category","戒名後");
				
				
				var kaimyo_after_opton = new Element("option", {value:""}).update("無し");
				kaimyo_after_menu.appendChild(kaimyo_after_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < kaimyo_after_array.length; i++){
					
					var menu_text = "";
					if(kaimyo_after_array[i]['text'].length > menu_text_length){
						
						menu_text = kaimyo_after_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = kaimyo_after_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var kaimyo_after_opton = new Element("option", {value:kaimyo_after_array[i]['original_key']}).update(menu_text);
					
					if(kaimyo_after_id == kaimyo_after_array[i]['original_key']){
						kaimyo_after_opton.setAttribute("selected", "selected");
					}
					
					kaimyo_after_menu.appendChild(kaimyo_after_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					kaimyo_after_menu.setAttribute("onchange", new Function( "kaimyo_after('id');"));
				}else{
					kaimyo_after_menu.setAttribute("onchange", "kaimyo_after('id')");
				}
				
				
				td0102.appendChild(kaimyo_after_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:30, rows:5, id:"kaimyo_after_text_direct"});
				
				
				if(second_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = kaimyo_after_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "kaimyo_after('text');"));
				}else{
					input03.setAttribute("onclick", "kaimyo_after('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(kaimyo_after_text){
					
					var input04 = new Element('input', {type:"radio", id:"kaimyo_after_yes", name:"kaimyo_after", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"kaimyo_after_no", name:"kaimyo_after", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"kaimyo_after_yes", name:"kaimyo_after", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"kaimyo_after_no", name:"kaimyo_after", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "kaimyo_after('yes');"));
				}else{
					input04.setAttribute("onchange", "kaimyo_after('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "kaimyo_after('no');"));
				}else{
					input05.setAttribute("onchange", "kaimyo_after('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
				
			case "extra":
			
				var the_width = 500;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "追記";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("追記");
				
				var td0102 = new Element('td');
				
				var extra_menu = new Element('select', { id:"extra_id"});
				
				var extra_array = select_array(sentences,"category","後半追加文");
				
				
				var extra_opton = new Element("option", {value:""}).update("無し");
				extra_menu.appendChild(extra_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < extra_array.length; i++){
					
					var menu_text = "";
					if(extra_array[i]['text'].length > menu_text_length){
						
						menu_text = extra_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = extra_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var extra_opton = new Element("option", {value:extra_array[i]['original_key']}).update(menu_text);
					
					if(extra_id == extra_array[i]['original_key']){
						extra_opton.setAttribute("selected", "selected");
					}
					
					extra_menu.appendChild(extra_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					extra_menu.setAttribute("onchange", new Function( "extra('id');"));
				}else{
					extra_menu.setAttribute("onchange", "extra('id')");
				}
				
				
				td0102.appendChild(extra_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:45, rows:6, id:"extra_text_direct"});
				
				
				if(second_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = extra_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "extra('text');"));
				}else{
					input03.setAttribute("onclick", "extra('text')");
				}
				
				
				td0202.appendChild(span03);
				var the_div = new Element('div',{id:"extrainput_area_at_extra"});
				
				if(extra_id == "110"){
					
						var the_input = new Element('input',{type:"text", size:"13", id:"donation_at_extra"});
						if(donation_place){
							 the_input.value = donation_place;
						 }
						 var the_span = new Element('span').update("寄付先");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "extra('donation');"));
							}else{
								the_input2.setAttribute("onclick", "extra('donation')");
							}
						
						the_div.update();
						the_div.appendChild(the_span);
						the_div.appendChild(the_input);
						the_div.appendChild(the_input2);
					 
				}
				
				
				
				td0202.appendChild(the_div);
				
				
				
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(extra_text){
					
					var input04 = new Element('input', {type:"radio", id:"extra_yes", name:"extra", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"extra_no", name:"extra", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"extra_yes", name:"extra", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"extra_no", name:"extra", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "extra('yes');"));
				}else{
					input04.setAttribute("onchange", "extra('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "extra('no');"));
				}else{
					input05.setAttribute("onchange", "extra('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
			case "thelast":
			
				var the_width = 400;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "締め括り";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("締め括り");
				
				var td0102 = new Element('td');
				
				var thelast_menu = new Element('select', { id:"thelast_id"});
				
				var thelast_array = select_array(sentences,"category","絞め");
				
				
				var thelast_opton = new Element("option", {value:""}).update("無し");
				thelast_menu.appendChild(thelast_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < thelast_array.length; i++){
					
					var menu_text = "";
					if(thelast_array[i]['text'].length > menu_text_length){
						
						menu_text = thelast_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = thelast_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var thelast_opton = new Element("option", {value:thelast_array[i]['original_key']}).update(menu_text);
					
					if(thelast_id == thelast_array[i]['original_key']){
						thelast_opton.setAttribute("selected", "selected");
					}
					
					thelast_menu.appendChild(thelast_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					thelast_menu.setAttribute("onchange", new Function( "thelast('id');"));
				}else{
					thelast_menu.setAttribute("onchange", "thelast('id')");
				}
				
				
				td0102.appendChild(thelast_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				var input01 = new Element('textarea', {cols:30, rows:5, id:"thelast_text_direct"});
				
				
				if(second_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = thelast_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "thelast('text');"));
				}else{
					input03.setAttribute("onclick", "thelast('text')");
				}
				
				td0202.appendChild(span03);
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(thelast_text){
					
					var input04 = new Element('input', {type:"radio", id:"thelast_yes", name:"thelast", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"thelast_no", name:"thelast", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"thelast_yes", name:"thelast", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"thelast_no", name:"thelast", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "thelast('yes');"));
				}else{
					input04.setAttribute("onchange", "thelast('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "thelast('no');"));
				}else{
					input05.setAttribute("onchange", "thelast('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
			case "ps":
			
				var the_width = 500;
				
				$('detailed_info_td_top').style.width = (the_width - 23) + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = (the_width - 15) + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "追伸";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("追伸");
				
				var td0102 = new Element('td');
				
				var ps_menu = new Element('select', { id:"ps_id"});
				
				var ps_array = select_array(sentences,"category","追伸");
				
				
				var ps_opton = new Element("option", {value:""}).update("無し");
				ps_menu.appendChild(ps_opton);
				
				
				var menu_text_length = 20;
				
				for(var i = 0 ; i < ps_array.length; i++){
					
					var menu_text = "";
					if(ps_array[i]['text'].length > menu_text_length){
						
						menu_text = ps_array[i]['text'].substr(0,menu_text_length) + "...";
							
					}else{
						
						menu_text = ps_array[i]['text']
						
					}
					
					var menu_text = menu_text.replace(/＠/g ,  " ");
				
					var ps_opton = new Element("option", {value:ps_array[i]['original_key']}).update(menu_text);
					
					if(ps_id == ps_array[i]['original_key']){
						ps_opton.setAttribute("selected", "selected");
					}
					
					ps_menu.appendChild(ps_opton);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					ps_menu.setAttribute("onchange", new Function( "ps('id');"));
				}else{
					ps_menu.setAttribute("onchange", "ps('id')");
				}
				
				
				td0102.appendChild(ps_menu);
				
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				var tr02 = new Element('tr');
				var td0202 = new Element('td');
				
				var span03 = new Element('span').update("その他<br>");
				
				
				
				
				
				var input01 = new Element('textarea', {cols:45, rows:6, id:"ps_text_direct"});
				
				
				if(second_paragraph_text){
					var CR = getCRChars();
					var text_area_veiw = ps_text.replace(/＠/g ,  CR);
					
					input01.update(text_area_veiw);
				}
				
				var the_br = new Element('br');
				
			
				
				var input03 = new Element('input', {type:"button", value:"反映"});
				
				
				if(the_browser == "MSIE"){
					input03.setAttribute("onclick", new Function( "ps('text');"));
				}else{
					input03.setAttribute("onclick", "ps('text')");
				}
				
				td0202.appendChild(span03);
				
				var the_div = new Element('div',{id:"extrainput_area_at_ps"});
				
				if(ps_id == "142"){
					
						var the_input = new Element('input',{type:"text", size:"13", id:"donation_at_ps"});
						if(donation_place){
							 the_input.value = donation_place;
						 }
						 var the_span = new Element('span').update("寄付先");
						 
						 var the_input2 = new Element('input',{type:"button", value:"反映"});
						 
						
						 if(the_browser == "MSIE"){
								the_input2.setAttribute("onclick", new Function( "ps('donation');"));
							}else{
								the_input2.setAttribute("onclick", "ps('donation')");
							}
						
						the_div.update();
						the_div.appendChild(the_span);
						the_div.appendChild(the_input);
						the_div.appendChild(the_input2);
					 
				}
				
				
				
				td0202.appendChild(the_div);
				
				
				
				td0202.appendChild(input01);
				td0202.appendChild(the_br);
			
				td0202.appendChild(input03);
				
				tr02.appendChild(td0202);
				the_tbody.appendChild(tr02);
				
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(ps_text){
					
					var input04 = new Element('input', {type:"radio", id:"ps_yes", name:"ps", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"ps_no", name:"ps", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"ps_yes", name:"ps", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"ps_no", name:"ps", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "ps('yes');"));
				}else{
					input04.setAttribute("onchange", "ps('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "ps('no');"));
				}else{
					input05.setAttribute("onchange", "ps('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
				
		
				
				
				
				the_table.appendChild(the_tbody);
				
			
				break;
				
				
			case "date":
			
				
				var the_width = 260;
				
				$('detailed_info_td_top').style.width = the_width - 23 + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = the_width - 15 + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "忌明け日付表記";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("忌明け日付表記");
				
				var td0102 = new Element('td');
				
				
				var year_menu = new Element('select', { id:"year_menu"});
				
				
				for(var i = 0 ; i < 3; i++){
					
					var the_year_option = theyear -1 +i
				
					var year_option = new Element("option", {value:the_year_option}).update(the_year_option);
					
					if(the_year_option == theyear){
						year_option.setAttribute("selected", "selected");
					}
					
					year_menu.appendChild(year_option);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				
				if(the_browser == "MSIE"){
					year_menu.setAttribute("onchange", new Function( "date_update();"));
				}else{
					year_menu.setAttribute("onchange", "date_update()");
				}
				
				
				td0102.appendChild(year_menu);
				
				var span_01 = new Element('span').update("年");
				
				td0102.appendChild(span_01);
				
				
				var month_menu = new Element('select', { id:"month_menu"});
			
				
				
				for(var i = 1 ; i < 13; i++){
					
				
				
					var month_option = new Element("option", {value:i}).update(i);
					
					if(i == themonth){
						month_option.setAttribute("selected", "selected");
					}
					
					month_menu.appendChild(month_option);
					
					//test += i + "," + tougo_array[i]['original_key'] + "," + tougo_array[i]['text'] + "<br>";
				}
				
				if(the_browser == "MSIE"){
					month_menu.setAttribute("onchange", new Function( "date_update();"));
				}else{
					month_menu.setAttribute("onchange", "date_update()");
				}
				
				
				td0102.appendChild(month_menu);
				
				
				var span_02 = new Element('span').update("月");
				
				td0102.appendChild(span_02);
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				
				
				the_table.appendChild(the_tbody);
				
				break;
				
			case "tenjyu":
			
				
				var the_width = 260;
				
				$('detailed_info_td_top').style.width = the_width - 23 + "px";
				$('detailed_info_td').style.width = the_width + "px";
				$('detailed_info_td_bottom').style.width = the_width - 15 + "px";
				
				$('detailed_info').style.width = the_width + "px";
				
	
				the_tile = "天寿全う";
				
				var tr01 = new Element('tr');
				var td0101 = new Element('th', { rowspan:"3"} ).update("天寿表記");
				
				var td0102 = new Element('td');
				
				
				var age_input_text = new Element('input', { type:"text", size:"4", id:"age_input"});
				age_input_text.value = the_age;
				
				
			
			
				
				td0102.appendChild(age_input_text);
				
				
				var span_02 = new Element('span').update("歳の天寿を<br>全うして永眠いたしました");
				
				td0102.appendChild(span_02);
				
				
				
				
				tr01.appendChild(td0101);
				tr01.appendChild(td0102);
				
				the_tbody.appendChild(tr01);
				
				var tr03 = new Element('tr');
				var td0302 = new Element('td');
				
				var span05 = new Element("span").update("表示する<br>");
				
				var span06 = new Element("span").update("表示しない");
				
				
				//input04.setAttribute("checked", "checked");
					
				//input04.checked = true;
				
				if(tenjyu == "yes"){
					
					var input04 = new Element('input', {type:"radio", id:"tenjyu_yes", name:"tenjyu", value:"yes", checked:"checked"});
					var input05 = new Element('input', {type:"radio", id:"tenjyu_no", name:"tenjyu", value:"no"});
					
				}else{
					var input04 = new Element('input', {type:"radio", id:"tenjyu_yes", name:"tenjyu", value:"yes"});
					var input05 = new Element('input', {type:"radio", id:"tenjyu_no", name:"tenjyu", value:"no",checked:"checked"});
				}
				
				
				if(the_browser == "MSIE"){
					input04.setAttribute("onchange", new Function( "tenjyu_update('yes');"));
				}else{
					input04.setAttribute("onchange", "tenjyu_update('yes')");
				}
				
				if(the_browser == "MSIE"){
					input05.setAttribute("onchange", new Function( "tenjyu_update('no');"));
				}else{
					input05.setAttribute("onchange", "tenjyu_update('no')");
				}
				
				
				
				
				td0302.appendChild(input04);
				td0302.appendChild(span05);
				td0302.appendChild(input05);
				td0302.appendChild(span06);
				
				
				tr03.appendChild(td0302);
				
				the_tbody.appendChild(tr03);
				
				
			
				
				the_table.appendChild(the_tbody);
				
				break;
				
			default:
			
				window_flag = "no";
				
			}
			
			
		if(window_flag == "yes"){
			$('detailed_info').update();
			
			$('detailed_info_title').update(the_tile);
			$('detailed_info').appendChild(the_table);
			
			Effect.Appear("detailed_info_window");
			
			$('detailed_info_window').style.zIndex = z_index++;
		}
		
		
	}
	
	
	function getCRChars(){
		var theAgent=navigator.userAgent
		if (theAgent.indexOf("Win") >=0){
			return "\r\n"
		} else if(theAgent.indexOf("Mac") >=0){
			return "\r"

		} else {
			return "\n"
		}
	}
	
	
	
	
	
	function changez(Name){
		Name.style.zIndex = z_index++;
	}
	
	function line_break(){
		the_h_row++;
		the_h_col = 0;
		h_text_array[the_h_row] = new Array();
		
	}
	
	
	function create_h_text_array(the_length,the_text,the_category){
		
		
		for(var i = 0; i < the_length ; i++){
				
			var the_letter = the_text.slice(i,i+1);
				
			if(the_letter == "＠"){
				line_break();
			}else{

				h_text_array[the_h_row][the_h_col] = new Array();
				h_text_array[the_h_row][the_h_col]['letter'] = the_letter;
				h_text_array[the_h_row][the_h_col]['category'] = the_category;
					
				the_h_col++;
			}
				
			if(the_h_col >= the_num_text_line){
				//*******     文末だけ　改行をスキップするようにしている。　文の途中で　行文字数がきっちりの時は余分の改行が入る。要update  2009/12/19
				if(i != (the_length-1)){
					line_break();
				}
			}
		}
		
	}
	
	
	function over_letter(event){
		
		if(this.name != ""){
			

			//var text = this.name + "<br>";
			
			var elements = document.getElementsByClassName(this.name);
			
			//alert(the_category + elements);
			
			for(var i = 0;  i < elements.length; i++){
				//text += elements[i].id + "<br>";
				$(elements[i].id).style.background = "#fdF";
			}
		
			
		}
		//$('notice').update(text);
	}
	
	function out_letter(event){
		//var text = this.c_name + "<br>";
		
		if(this.c_name != ""){
			

			
			
			var elements = document.getElementsByClassName(this.c_name);
			
			//alert(the_category + elements);
			
			for(var i = 0;  i < elements.length; i++){
				//text += elements[i].id + "<br>";
				$(elements[i].id).style.background = "";
			}
		
			
		}
		//$('notice').update(text);
	}
	
	
	
	function convert_kanji_numeric(the_number){
		
		
		var the_text = "";
		
		
		
		var above_thousand = Math.floor(the_number/1000);
		
		if(above_thousand > 0){
			
			if(houndreds == 1){
				above_thousand += "千";
			}else{
				the_text += convert_kanji_letter(above_thousand) + "千";
			}
	
			
		}
		
		
		
		
		
		var below_thousand = the_number - above_thousand * 1000 
		
		var houndreds = Math.floor(below_thousand/100);
		
		if(houndreds > 0){
			if(houndreds == 1){
				the_text += "百";
			}else{
				the_text += convert_kanji_letter(houndreds) + "百";
			}
			
		}
		
		
		
		
		
		var below_handreds =  below_thousand - houndreds*100;
		
		var tens = Math.floor(below_handreds/10);
		
		
	
		if(tens > 0){
			
			if(tens == 1){
				the_text += "十";
			}else{
				the_text += convert_kanji_letter(tens) + "十";
			}
			
		}
		
		//$('notice').update(the_text);
		
		
		var below_ten = below_handreds - tens*10;
		
		the_text += convert_kanji_letter(below_ten);
		
		

		return the_text;
	}
	
	
	function convert_kanji_letter(the_letter){
		
		if(isNaN(the_letter) === false) {
			
			the_letter = String(the_letter);
			
		}
		
		
		for(var i = 0 ; i < 22 ; i++){
			
			
			
			var the_search = i;
			var the_replacement = "";
			
			switch (i) {
				case 1:
					the_replacement = "一";
					break;
				case 2:
					the_replacement = "二";
					break;
				case 3:
					the_replacement = "三";
					break;
				case 4:
					the_replacement = "四";
					break;
				case 5:
					the_replacement = "五";
					break;
				case 6:
					the_replacement = "六";
					break;
				case 7:
					the_replacement = "七";
					break;
				case 8:
					the_replacement = "八";
					break;
				case 9:
					the_replacement = "九";
					break;
				case 0:
					the_replacement = "〇";
					break;
					
				case 11:
					the_search = "-";
					the_replacement = "|";
					break;
					
				case 12:
					the_search = "ー";
					the_replacement = "|";
					break;
					
				case 13:
					the_search = "１";
					the_replacement = "一";
					break;
				case 14:
					the_search = "２";
					the_replacement = "二";
					break;
				case 15:
					the_search = "３";
					the_replacement = "三";
					break;
				case 16:
					the_search = "４";
					the_replacement = "四";
					break;
				case 17:
					the_search = "５";
					the_replacement = "五";
					break;
				case 18:
					the_search = "６";
					the_replacement = "六";
					break;
				case 19:
					the_search = "７";
					the_replacement = "七";
					break;
				case 20:
					the_search = "８";
					the_replacement = "八";
					break;
				case 21:
					the_search = "９";
					the_replacement = "九";
					break;
				case 10:
					the_search = "０";
					the_replacement = "〇";
					break;
					
			}
			
			
			var pos = the_letter.indexOf(the_search);
			
			while(pos != -1){
				
				the_letter = the_letter.replace(the_search, the_replacement);
				pos = the_letter.indexOf(the_search);
				
			}
		}
		
		return the_letter;
		
		
	}
