var datas = 0;
var toppos = 0;
var leftpos = 0;
//MODIFYCODE -- start --

var toukou_win = null;
var print_win = null;

var timerID_ad = 40;
var ad_max = 3; //0,1,2,3
var ad_id = 0;
var ad_image = new Array;

//MODIFYCODE -- end --

function init_freescroll(){
	if((navigator.appName=="Microsoft Internet Explorer")||((navigator.userAgent.indexOf("MSIE")!=-1))){
	    resizeCheck2();
	}
	//fuji
	 posX = -1;
	 posY = -1;
	frames["freescrollmap"].document.getElementById("mapmovedata").value = posX + "," + posY;

	move_monitor();
}

function move_monitor(){
	datas = frames["freescrollmap"].document.getElementById("mapmovedata").value;
	smallwin_top = document.getElementById("smallwin_top").value;
	smallwin_left = document.getElementById("smallwin_left").value;
	//document.getElementById("mondata").value=datas;

	if (datas != "") {
		if (rakurakumap_size == "normal") {
			shukushou_rate = 0.20;
		} else if (rakurakumap_size == "large") {
			shukushou_rate = 0.10;
		}
		
		datas_list = datas.split(",");

		toppos = (datas_list[1]) * shukushou_rate - eval(smallwin_top);
		leftpos = (datas_list[0]) * shukushou_rate - eval(smallwin_left);
		
		//if (eval(toppos) < 0) {
			toppos = toppos * -1;
		//}
		//if (eval(leftpos) < 0) {
			leftpos = leftpos * -1;
		//}

		
		document.getElementById("winwaku").style.top = toppos + "px";
		document.getElementById("winwaku").style.left = leftpos + "px";
		
	}
		
	setTimeout(move_monitor,500);
}

function loadekiguidancemap(){

	//ekipeid,init_ido,init_keido,qrcodeimage
	//上記の情報は、PHP経由で引き渡す。
	
	var init_idokeido = document.getElementById("idokeido").value;
	//var rakurakumapimage_withcredit = document.getElementById("rakurakumapimage_withcredit").value;
	var qrcodeimage = document.getElementById("qrcodeimage").value;
	//
	/*
	var init_idokeido_list = init_idokeido.split("/");
	var init_ido = init_idokeido_list[0];
	var init_keido = init_idokeido_list[1];
	*/
	
	var marker = Createmarker();
	
	
	/* isle 2009-04-21 */
	// 
	var istr = '<a href="'+marker+'">'+'<img src="./images/eki_all/menu06_p.jpg" width="90" height="70" border="0"></a>';
	document.getElementById("townmap").innerHTML = istr;
	
	//らくらくマップーwithcredit版
	//var istr = '<img src="./ekipediaimg/rakurakumapimg/withcredit/' + rakurakumapimage_withcredit + '">';
	//document.getElementById("rakurakumap").innerHTML = istr;
	
	
	init_freescroll();
	
	
	
	// QRcode
	// var qstr = "qrimg/" + qrcodeimage;
	// document.getElementById("qrcode").src = qstr;
	
	//元気さんコード
	MM_preloadImages('images/rosenzu/menu_02_b.jpg','images/rosenzu/menu_03_b.jpg','images/rosenzu/menu_04_b.jpg');
	
	//広告
	set_adImage();
	adChange_1();
	//adChange_2();
	
}

//MODIFYCODE -- start --
function Createmarker() {
	imagesitedomain = document.getElementById("imagesitedomain").value;
	headcode = document.getElementById("headcode").value;
	ekipeid = document.getElementById("ekipeid").value;
	usesite = document.getElementById("use_site").value;
	mainsitedomain = document.getElementById("mainsitedomain").value;
	crossstations_head = document.getElementById("crossstations_head_2").value;
	rosenzu_name = document.getElementById("rosenzu_name").value;
	
	headcode = encodeURIComponent(headcode);
	ekipeid = encodeURIComponent(ekipeid);
	usesite = encodeURIComponent(usesite);
	crossstations_head = encodeURIComponent(crossstations_head);
	rosenzu_name = encodeURIComponent(rosenzu_name);
	
	marker = './machi.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&usesite=' + usesite + '&crossstations_head=' + crossstations_head + '&rosenzuname=' + rosenzu_name;
	
	return marker;
}

function machiGuidance(){
	
	headcode = document.getElementById("headcode").value;
	ekipeid = document.getElementById("ekipeid").value;
	usesite = document.getElementById("use_site").value;
	mainsitedomain = document.getElementById("mainsitedomain").value;
	crossstations_head = document.getElementById("crossstations_head_2").value;
	//keieitai = document.getElementById("keieitai").value;
	rosenzu_name = document.getElementById("rosenzu_name").value;
	
	headcode = encodeURIComponent(headcode);
	ekipeid = encodeURIComponent(ekipeid);
	usesite = encodeURIComponent(usesite);
	crossstations_head = encodeURIComponent(crossstations_head);
	//keieitai = encodeURIComponent(keieitai);
	rosenzu_name = encodeURIComponent(rosenzu_name);
	
	window.location = './machi.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&usesite=' + usesite + '&crossstations_head=' + crossstations_head + '&rosenzuname=' + rosenzu_name;
	// window.location = 'http://' + mainsitedomain + '/development/machi.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&usesite=' + usesite + '&crossstations_head=' + crossstations_head + '&rosenzuname=' + rosenzu_name;

}
//MODIFYCODE -- end --
function adChange_1(){
	clearTimeout(timerID_ad);
	timerID_ad = setTimeout("adChange_1()",5000);
	//
	
	
	ad_source = ad_image[ad_id];
	document.getElementById("advertisement").src = ad_source;
	
	ad_id++;
	if (ad_id > ad_max) {
		ad_id = 0;
	}
}

function adChange_2(){
	clearTimeout(timerID_ad);
	timerID_ad = setTimeout("adChange_2()",5000);
	//
	var request_ad = this.GXmlHttp.create();
	var php_path = "./randomSchedule.php?ad_max=" + ad_max;
	request_ad.open('GET', php_path , true);
	request_ad.onreadystatechange = function() {
		if (request_ad.readyState == 4) {
			var ad_order = request_ad.responseText;

			if (ad_order != "") {
				//alert(ad_order);
				
				
				
			}
		}
	}
	request_ad.send(null);
	
}

function set_adImage(){
	ad_image[0] = "images/ad/images/00010.jpg";
	ad_image[1] = "images/ad/images/00011.jpg";
	ad_image[2] = "images/ad/images/00012.jpg";
	ad_image[3] = "images/ad/images/00013.jpg";
	
}

function exMenuTopbar(tName){
	if (tName == "ToTopPage") {
		ToTopPage();
	} else if (tName == "searchbyrosenzu") {
		searchbyrosenzu();
	} else if (tName == "searchbyrosen") {
		searchbyrosen();
	} else if (tName == "searchbyekimei") {
		searchbyekimei();
	} else if (tName == "pagehelp") {
		pagehelp();
	} else if (tName == "rakurakuMapHanrei") {
		var imgsource = document.getElementById("topbar_hanrei").src;
		imgsourcearray = imgsource.split("/");
		imgname = imgsourcearray[imgsourcearray.length - 1];
		
		if (imgname == "topbarbtn_cl.gif") {
			
			rstr = '<a href="javascript:exMenuTopbar(' + "'" + 'rakurakuMapHanrei' + "'" + ')" border=0>';
			rstr = rstr + '<img id="topbar_hanrei" src="./images/ekiparts/' + "topbarbtn_op.gif" + '" border=0></a>';
			rstr = rstr +  '<img src="./images/ekiparts/rakurakumaphanrei.jpg" border=0>';
			alert("凡例を表示する");
		} else if (imgname == "topbarbtn_op.gif") {
			rstr = '<a href="javascript:exMenuTopbar(' + "'" + 'rakurakuMapHanrei' + "'" + ')" border=0>';
			rstr = rstr + '<img id="topbar_hanrei" src="./images/ekiparts/' + "topbarbtn_cl.gif" + '" border=0></a>';
			rstr = rstr +  '<img src="./images/ekiparts/rakurakumaphanrei.jpg" border=0>';
			alert("凡例表示を閉じる");
		}
		document.getElementById("menu-top-2").innerHTML = rstr;
		
		
	}

}

function new_ekimenu(tName){
	tName_list = tName.split("-");
	tName_number = tName_list[1];
	if (tName_number == 1) {
		element_id = "box_bbs0" + tName_number;
		gazou_id = "eki_gateway_arrow";
		
	} else if  (tName_number == 2) {
		element_id = "box_bbs0" + tName_number;
		gazou_id = "eki_toilet_arrow";
		
	} else if  (tName_number == 3) {
		element_id = "box_bbs0" + tName_number + "_02";
		gazou_id = "eki_keijiban_arrow";
	}
	
	tMenu = document.getElementById(element_id).style;

	if (tMenu.display == "none") {
		tMenu.display = "block";
		//
		if (tName_number == 1) {
			gazou_name = "images/top/sankaku01_02.gif";
		} else if (tName_number == 2) {
			gazou_name = "images/top/sankaku01_02.gif";
		} else if (tName_number == 3) {
			gazou_name = "images/top/sankaku02_02.gif";
		}
		document.getElementById(gazou_id).src = gazou_name;
		//
		ascroll(element_id);
	}else{
		tMenu.display = "none";
		//
		if (tName_number == 1) {
			gazou_name = "images/top/sankaku01.gif";
		} else if (tName_number == 2) {
			gazou_name = "images/top/sankaku01.gif";
		} else if (tName_number == 3) {
			gazou_name = "images/top/sankaku02.gif";
		}
		document.getElementById(gazou_id).src = gazou_name;
		
	}
}

function new_ekimenu_old(tName){
	tName_list = tName.split("-");
	tName_number = tName_list[1];
	if (tName_number == 1) {
		element_id = "box_bbs0" + tName_number;
	} else if  (tName_number == 2) {
		element_id = "box_bbs0" + tName_number;
	} else if  (tName_number == 3) {
		element_id = "box_bbs0" + tName_number + "_02";
	}
	
	tMenu = document.getElementById(element_id).style;
	if (tMenu.display == "none") {
		tMenu.display = "block";
		ascroll(element_id);
	}else{
		tMenu.display = "none";
	}
}

//MODIFYCODE -- start --
function ekikeijibannewtoukou(){
	var headcode = 6;
	var toukoutype = 0;//えきの掲示板
	var ekipeid = document.getElementById("ekipeid").value;
	var edittype = "new";
	
	var mailaddress_id = "";
	var password = "";
	
	var toukoudata_info = "";
	
	var crossstations_head = document.getElementById("crossstations_head_2").value;
	
	headcode = encodeURIComponent(headcode);
	ekipeid = encodeURIComponent(ekipeid);
	toukoutype = encodeURIComponent(toukoutype);
	edittype = encodeURIComponent(edittype);
	mailaddress_id = encodeURIComponent(mailaddress_id);
	password = encodeURIComponent(password);
	crossstations_head = encodeURIComponent(crossstations_head);
	toukoudata_info = encodeURIComponent(toukoudata_info);
	
	toukou_win = window.open('welcomeEkipedian.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&toukoutype=' + toukoutype + '&edittype=' + edittype + '&mailaddress_id=' + mailaddress_id + '&password=' + password + '&messages=' + crossstations_head + '&toukoudata_info=' + toukoudata_info, '', 'width=800,height=600');
	//window.location = 'http://' + mainsitedomain + '/development/welcomeEkipedian.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&toukoutype=' + toukoutype + '&edittype=' + edittype + '&mailaddress_id=' + mailaddress_id + '&password=' + password + '&messages=' + crossstations_head + '&toukoudata_info=' + toukoudata_info;
}

function ekikeijibannmodtoukou(tnum){
	
	//tnumは、toukoudatatableのserialid
	var toukoudata_info = tnum;
	var headcode = 6;
	var toukoutype = 0;//えきの掲示板
	var ekipeid = document.getElementById("ekipeid").value;
	var edittype = "mod";
	
	var mailaddress_id = "";
	var password = "";
	
	var crossstations_head = document.getElementById("crossstations_head_2").value;
	
	//
	var toukou_platform = "PC";
	for (var i = 0;i < ekikeijiban_serialid.length;i++) {
		if (ekikeijiban_serialid[i] == tnum) {
			var p_serialid = i;
			break;
		}
	}
	if (ekikeijiban_photo1[eval(p_serialid)] != "nn") {
		targetpname = ekikeijiban_photo1[eval(p_serialid)];
		targetpname_array = targetpname.split("-");
		judgeparam_1 = targetpname_array[1];
		judgeparam_2 = judgeparam_1.substr(0,2);
		
		if ((judgeparam_2 == "NT")||(judgeparam_2 == "AU")||(judgeparam_2 == "SB")||(judgeparam_2 == "WM")){
			toukou_platform = "KTAI";
		}
	}
	
	headcode = encodeURIComponent(headcode);
	toukoutype = encodeURIComponent(toukoutype);
	ekipeid = encodeURIComponent(ekipeid);
	crossstations_head = encodeURIComponent(crossstations_head);
	toukou_platform = encodeURIComponent(toukou_platform);
	
	
	toukou_win = window.open('welcomeEkipedian.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&toukoutype=' + toukoutype + '&edittype=' + edittype + '&mailaddress_id=' + mailaddress_id + '&password=' + password + '&messages=' + crossstations_head + '&toukoudata_info=' + toukoudata_info + '&toukou_platform=' + toukou_platform, '', 'width=800,height=600');
	//window.location = 'http://' + mainsitedomain + '/development/welcomeEkipedian.php?headcode=' + headcode + '&ekipeid=' + ekipeid + '&toukoutype=' + toukoutype + '&edittype=' + edittype + '&mailaddress_id=' + mailaddress_id + '&password=' + password + '&messages=' + crossstations_head + '&toukoudata_info=' + toukoudata_info + '&toukou_platform=' + toukou_platform;
}
//MODIFYCODE -- end --



//MODIFYCODE -- start --
function pagezoom(){
	headcode = document.getElementById("headcode").value;
	ekipeid = document.getElementById("ekipeid").value;
	alert("大きく・小さく:" + headcode + "_" + ekipeid);
}

function ekikeijiban_prevpage(){
	ekikeijiban_totalpage = document.getElementById("ekikeijiban_totalpage").value;
	ekikeijiban_nowpage = document.getElementById("ekikeijiban_currentpage").value;
	
	ekikeijiban_nowpage--;
	document.getElementById("ekikeijiban_currentpage").value = ekikeijiban_nowpage;
	if (ekikeijiban_nowpage == 0) {
		//alert("これより前のページはありません！");
		ekikeijiban_nowpage++;
		document.getElementById("ekikeijiban_currentpage").value = ekikeijiban_nowpage;
		return;
	} else {
		//alert("まえのページへ移動");
		document.getElementById("pagecount").value = ekikeijiban_nowpage + '/' + ekikeijiban_totalpage;
		
		make_ekikeijiban_page(ekikeijiban_nowpage,ekikeijiban_totalpage);
	}
	
	
}

function ekikeijiban_nextpage(){
	ekikeijiban_totalpage = document.getElementById("ekikeijiban_totalpage").value;
	ekikeijiban_nowpage = document.getElementById("ekikeijiban_currentpage").value;
	ekikeijiban_nowpage++;
	document.getElementById("ekikeijiban_currentpage").value = ekikeijiban_nowpage;
	if (ekikeijiban_nowpage > ekikeijiban_totalpage) {
		//alert("これより先のページはありません！");
		ekikeijiban_nowpage--;
		document.getElementById("ekikeijiban_currentpage").value = ekikeijiban_nowpage;
		return;
	} else {
		//alert("つぎのページへ移動");
		document.getElementById("pagecount").value = ekikeijiban_nowpage + '/' + ekikeijiban_totalpage;
		
		make_ekikeijiban_page(ekikeijiban_nowpage,ekikeijiban_totalpage);
	}
	
	
}

function make_ekikeijiban_page(ekikeijiban_nowpage,ekikeijiban_totalpage){
	ekikeijiban_limit = document.getElementById("ekikeijiban_limit").value;

	start_pos = (ekikeijiban_nowpage - 1) * eval(ekikeijiban_limit);

	if (ekikeijiban_nowpage == ekikeijiban_totalpage) {
		end_pos = ekikeijiban_total;
	} else {
		end_pos = start_pos + eval(ekikeijiban_limit);
	}

	ekikeijibanInfo = "";
	for (var i = start_pos;i < end_pos;i++) {
		ekikeijibanInfo = ekikeijibanInfo + '<table border=0 cellspacing=1 cellpadding=1>';
		ekikeijibanInfo = ekikeijibanInfo + '<tr bgcolor="#ffffff">';
		info_1 = ekikeijiban_regdatetime[i] + '<BR>';
		info_2 = ekikeijiban_handlename[i];
		info_3 = ekikeijiban_title[i] + '<BR>';
		info_4 = "";
		info_4 = info_4 + ekikeijiban_comment[i] + '<BR>';
		
		ekikeijibanInfo = ekikeijibanInfo + '<td width=133><a href="javascript:ekikeijibannmodtoukou(' + "'" + ekikeijiban_serialid[i] + "'" + ')"><img src="images/ekiparts/chocopenvertical.png" border=0></a><BR><font font-weight=900 point-size=9 color="black">' + info_1 + info_2 + '</font></td>';

		//
		ekikeijibanInfo = ekikeijibanInfo + '<td width=399>';
		if (ekikeijiban_photo1[i] != "nn") {
			ekikeijiban_photo1[i] = ekikeijiban_photo1[i].replace(".jpg","");

			//ekikeijibanInfo = ekikeijibanInfo + '<img src="http://www.ekipedia.jp/ekipediaimg/' + ekikeijiban_photo1[i] + 's.jpg">';
			ekikeijibanInfo = ekikeijibanInfo + '<img id="' + 'ekikeijiban_photo1-' + i + '" src="ekipediaimg/' + ekikeijiban_photo1[i] + 's.jpg" onClick="open_keijibanPhoto(' + "'" + '1-' + i + "'" + ')">';
		}
		if (ekikeijiban_photo2[i] != "nn") {
			ekikeijiban_photo2[i] = ekikeijiban_photo2[i].replace(".jpg","");
			//ekikeijibanInfo = ekikeijibanInfo + '<img src="http://www.ekipedia.jp/ekipediaimg/' + ekikeijiban_photo2[i] + 's.jpg">';
			ekikeijibanInfo = ekikeijibanInfo + '<img id="' + 'ekikeijiban_photo1-' + i + '" src="ekipediaimg/' + ekikeijiban_photo2[i] + 's.jpg" onClick="open_keijibanPhoto(' + "'" + '2-' + i + "'" + ')">';
		}
		if (ekikeijiban_photo3[i] != "nn") {
			ekikeijiban_photo3[i] = ekikeijiban_photo3[i].replace(".jpg","");
			//ekikeijibanInfo = ekikeijibanInfo + '<img src="http://www.ekipedia.jp/ekipediaimg/' + ekikeijiban_photo3[i] + 's.jpg">';
			ekikeijibanInfo = ekikeijibanInfo + '<img id="' + 'ekikeijiban_photo1-' + i + '" src="ekipediaimg/' + ekikeijiban_photo3[i] + 's.jpg" onClick="open_keijibanPhoto(' + "'" + '3-' + i + "'" + ')">';
		}
		ekikeijibanInfo = ekikeijibanInfo + '</td>';
		//
		ekikeijibanInfo = ekikeijibanInfo + '<td><font font-weight=900 point-size=9 color="black">' + info_3 + info_4 + '</font></td>';
		ekikeijibanInfo = ekikeijibanInfo + '</tr>';
		ekikeijibanInfo = ekikeijibanInfo + '</table>';
		
		ekikeijibanInfo = ekikeijibanInfo + '<HR>';
	}
	
	document.getElementById("box_bbs03_02").innerHTML = ekikeijibanInfo;
	
}


//MODIFYCODE -- end --

function ascroll(id_name){ 
   obj = document.getElementById(id_name); 
   y = obj.offsetTop; 
   scrollTo(0,y); 
} 

function ensmalllarge(gsize){
	if (gsize == "M") {
		return;
	}
	var next_rakurakumap = "";
	//daihyo_ekipeid = document.getElementById("ekipeid").value;
	rakurakumapimgcode = document.getElementById("rakurakumap_img_code").value;
    if (rakurakumapimgcode == "00000"){
    	return;
    }

	ekipeid = document.getElementById("ekipeid").value;
	if (gsize == "S"){
		if (rakurakumap_size == "normal") {
			//do nothing
			next_rakurakumap = "stay";
		} else if (rakurakumap_size == "large") {
			rakurakumap_size = "normal";
			next_rakurakumap = "normal";
			
			rakurakumapimage = "m" + rakurakumapimgcode + ".jpg";
		}
		
	} else if (gsize == "L") {
		if (rakurakumap_size == "normal") {
			rakurakumap_size = "large";
			next_rakurakumap = "large";
			
			rakurakumapimage = "l" + rakurakumapimgcode + ".jpg";
			
		} else if (rakurakumap_size == "large") {
			//do nothing
			next_rakurakumap = "stay";
		}
		
	}
	
	//alert(rakurakumapimage);
	//alert(rakurakumap_size);
	//alert(rakurakumapimage);
	//-------------------------------------------
	if (next_rakurakumap != "stay") {

		var rakurakumap_src = "freescroll.php?ekiimg=" + rakurakumapimage + "&rakurakumap_size=" + rakurakumap_size + "&ekipeid=" + ekipeid;
		document.getElementById("rakurakumap_freescroll").src = rakurakumap_src;
		
		var rakurakumap_smallwin_src="ekipediaimg/rakurakumapimg/minisize/" + rakurakumap_size + "/" + rakurakumapimage;
		document.getElementById("rakurakumap_smallwin").src = rakurakumap_smallwin_src;
		//
		var iframe_width = document.getElementById("iframe_width").value;
		var iframe_height = document.getElementById("iframe_height").value;
		//id set
		var win_width_id = rakurakumap_size + "_width";
		var win_height_id = rakurakumap_size + "_height";
		
		var minisize_width_id = "minisize_" + rakurakumap_size + "_width";
		var minisize_height_id = "minisize_" + rakurakumap_size + "_height";
		//get value
		win_width = document.getElementById(win_width_id).value;
		win_height = document.getElementById(win_height_id).value;
		smallwin_width = document.getElementById(minisize_width_id).value;
		smallwin_height = document.getElementById(minisize_height_id).value;
		//set value
		winwaku_width = Math.round(iframe_width * smallwin_width / win_width);
		winwaku_height = Math.round(iframe_height * smallwin_height / win_height);
		//
		document.getElementById("smallwin").style.width = smallwin_width + "px";
		document.getElementById("smallwin").style.height = smallwin_height + "px";
		
		document.getElementById("winwaku").style.width = winwaku_width + "px";
		document.getElementById("winwaku").style.height = winwaku_height + "px";
		
		
	}
}

function print_out(){
	//alert("印刷用画面を開きます。¥r¥n" + "--表示情報-- ¥r¥n" + "駅名・ページ番号 ¥r¥n" + "らくらくマップ ¥r¥n" + "バリアフリー(出入り口・トイレ)文字情報 ¥r¥n" + "掲示板情報をペーストできるエリア ¥r¥n" + "(QRコード)");
	
	crossstations_head_2 = document.getElementById("crossstations_head_2").value;
	headcode = document.getElementById("headcode").value;
	ekipeid = document.getElementById("ekipeid").value;
	
	
	//head
	print_head = crossstations_head_2 + " " + headcode + "-" + ekipeid;
	
	//image
	print_mapimage = "m" + ekipeid + ".jpg";
	//print_mapimage = "l" + ekipeid + ".jpg";
	
	if (rakurakumap_size == "normal") {
		print_mapimage_height = document.getElementById("normal_height").value;
	} else if (rakurakumap_size == "large") {
		print_mapimage_height = document.getElementById("large_height").value;
	}
	//information_1
	//bft
	print_information_1 = "";
	for (i = 0; i < bfg_gatewayname.length;i++) {
		print_information_1 = print_information_1 + "【" + bfg_gatewayname[i] + "】" + "," + bfg_gatewaytype[i] + "," + bfg_stationnumber[i] + "," + bfg_stationname[i] + "/" 
	}
	
	//information_2
	//bfg
	print_information_2 = "";
	for (i = 0; i < bft_toiletname.length;i++) {
		print_information_2 = print_information_2 + "[" + bft_toiletname[i] + "]" + "," + bft_door[i] + "," + bft_chair[i] + ",";
		//
		if (bft_osumate[i] != "no"){
			print_information_2 = print_information_2 + bft_osumate[i] + ",";
		}
		
		if (bft_kaijobed[i] != "no"){
			print_information_2 = print_information_2 + bft_kaijobed[i] + ",";
		}
		
		if (bft_babybed[i] != "no"){
			print_information_2 = print_information_2 + bft_babybed[i] + ",";
		}
		
		if (bft_babycatcher[i] != "no"){
			print_information_2 = print_information_2 + bft_babycatcher[i] + ",";
		}
		//
		print_information_2 = print_information_2 + bft_stationnumber[i] + "," + bft_stationname[i] + "/";
		
	}
	
	//QRcode image
	print_qrcodeimage = document.getElementById("qrcodeimage").value;
	
	//
	//if (print_win != null) {
	//	print_win.close();
	//}
	print_head = encodeURIComponent(print_head);
	print_mapimage = encodeURIComponent(print_mapimage);
	print_mapimage_height = encodeURIComponent(print_mapimage_height);
	print_information_1 = encodeURIComponent(print_information_1);
	print_information_2 = encodeURIComponent(print_information_2);
	print_qrcodeimage = encodeURIComponent(print_qrcodeimage);

	
	print_win = window.open('printout_eki.php?print_head=' + print_head + '&print_mapimage=' + print_mapimage+ '&print_mapimage_height=' + print_mapimage_height + '&print_information_1=' + print_information_1 + '&print_information_2=' + print_information_2 + '&print_qrcodeimage=' + print_qrcodeimage, '', 'width=900,height=850,scrollbars=yes,resizable=yes');
	

}


function open_rosenzu() {
	rosenzu_name = document.getElementById("rosenzu_name").value;

	
	rosenzu_name = encodeURIComponent(rosenzu_name);
	//window.open('http://www.ekipedia.jp/development/rosenzu.php?rosenzu_name=' + rosenzu_name, '', 'width=850,height=600,scrollbars=yes,resizable=yes');
	window.location = './rosenzu.php?rosenzu_name=' + rosenzu_name;
	//window.location = 'http://www.ekipedia.jp/development/rosenzu.php?rosenzu_name=' + rosenzu_name;
}

function open_rosenmei(){
		rosenzu_name = document.getElementById("rosenzu_name").value;
		//rosenzu_nameから先頭の'r'をはずす
		var mlen = rosenzu_name.length;
		var regionname = rosenzu_name.substr(1,mlen - 1);
		regionname = encodeURIComponent(regionname);

		// window.open('http://www.ekipedia.jp/development/rosen.php?region_name=' + regionname, '', 'width=850,height=600,scrollbars=yes,resizable=yes');
		window.location = './rosen.php?region_name=' + regionname;
		//window.location = 'http://www.ekipedia.jp/development/rosen.php?region_name=' + regionname;
	}


function ekimei_search(){
	var ekimei_string = "";
	
	window.location = './ekimei.php?search_string=' + ekimei_string;
}

function open_pagehelp(){
	window.open('./help_eki.html', '', 'width=800,height=600,scrollbars=yes,resizable=yes');
	//window.location = 'http://www.ekipedia.jp/development/help_eki.html';
}

function open_mes2adm(){
	crossstations_head_2 = document.getElementById("crossstations_head_2").value;
	ekipeid = document.getElementById("ekipeid").value;
	
	crossstations_head_2 = encodeURIComponent(crossstations_head_2);
	ekipeid = encodeURIComponent(ekipeid);
	
	user_name = "";
	mail_address = "";
	dengon_naiyou = "";
	window.open('./dengonban.php?page_type=eki&page_info=' + crossstations_head_2 + '&ekipeid=' + ekipeid + '&user_name=' + user_name + '&mail_address=' + mail_address + '&dengon_naiyou=' + dengon_naiyou, '', 'width=800,height=700,scrollbars=yes');
	//window.location = 'http://www.ekipedia.jp/development/dengonban.php?page_type=eki&page_info=' + crossstations_head_2 + '&ekipeid=' + ekipeid + '&user_name=' + user_name + '&mail_address=' + mail_address + '&dengon_naiyou=' + dengon_naiyou;
}

function job_reflect_data(){
	alert("えきの案内アップデート");
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
}

function open_keijibanPhoto(pid){
	pid_array = pid.split("-");
	pnum = pid_array[0];
	pindex = pid_array[1];
	
	if (pnum == 1){
		photoname = ekikeijiban_photo1[pindex];
	} else if (pnum == 2){
		photoname = ekikeijiban_photo2[pindex];
	} else if (pnum == 3){
		photoname = ekikeijiban_photo3[pindex];
	}
	
	photoname = "./ekipediaimg/" + photoname + ".jpg"
	window.open(photoname, '', 'width=800,height=600,scrollbars=yes');
	//window.location = photoname;
	
	
}

function open_gatewayPhoto(pid){
	pid_array = pid.split("-");
	pnum = pid_array[0];
	pindex = pid_array[1];
	
	if (pnum == 1){
		photoname = bfg_photoname1[pindex];
	} else if (pnum == 2){
		photoname = bfg_photoname2[pindex];
	}

	photoname = "./ekipediaimg/" + photoname + ".jpg"
	window.open(photoname, '', 'width=800,height=600,scrollbars=yes');
	//window.location = photoname;
}

function open_toiletPhoto(pid){
	pid_array = pid.split("-");
	pnum = pid_array[0];
	pindex = pid_array[1];
	
	if (pnum == 1){
		photoname = bft_photoname1[pindex];
	} else if (pnum == 2){
		photoname = bft_photoname2[pindex];
	}

	photoname = "./ekipediaimg/" + photoname + ".jpg"
	window.open(photoname, '', 'width=800,height=600,scrollbars=yes');
	//window.location = photoname;
}

function open_kounaizu(){
	kounaizuurl = document.getElementById("kounaizu_url").value;
	window.open(kounaizuurl, '', 'width=850,height=600,scrollbars=yes,resizable=yes');
	//window.location = kounaizuurl;
}

function open_wikipedia(){
	daihyostationname = document.getElementById("daihyo_stationname").value;
	daihyostationname = daihyostationname + "駅";
	window.open('http://ja.wikipedia.org/wiki/' + daihyostationname, '', 'width=850,height=600,scrollbars=yes,resizable=yes');
	//window.location = 'http://ja.wikipedia.org/wiki/' + daihyostationname;
}

function open_rakurakuodekakenet(){
	window.open('http://www.ecomo-rakuraku.jp/rakuraku/index/', '', 'width=850,height=600,scrollbars=yes,resizable=yes');
	//window.location = 'http://www.ecomo-rakuraku.jp/rakuraku/index/';
}
//-------------------------------------------------------------------------------------------------
function showKounaizu(){
	alert("鉄道会社構内図");
}

function showOdekakeNet(){
	alert("おでかけネット");
}

function showWikipedia(){
	alert("ウキペディア");
}
function ToTopPage(){
	alert("トップページへ");
}


function pagehelp(){
	alert("ページヘルプ");
}

function tinfomachiphoto(){
	alert("街の情報：まちフォト");
	location.hash = "machiphoto";
	
	
	
	
}

function tinfomachikeijiban(){
	alert("街の情報：まち掲示板");
	location.hash = "machikeijiban";
	
}


function machiphotohelp(){
	alert("まちフォトヘルプ");
}

function machikeijibanhelp(){
	alert("まち掲示板ヘルプ");
}

function machibariafreehelp(){
	alert("まちバリアフリーヘルプ");
}


function ekikeijibanhelp(){
	alert("えき掲示板ヘルプ");
}