//
// ■ javascript file for JOA,KOA,etc by k.shimizu ■ 2005-6-3
//										updated       2008-8-6
// -----------------------------------------------------------------------
//
// new style 'showhide' function  2008-7-18
//      ShowHideByName,ShowHideById,ShowHideByElement
//
function ShowHideByName(ename,dvalue){
	//  ename:name, dvalue:block|none|sw
	//  browser check logic
	//  if(document.all) IE = true;
	//  else if(document.layers) NN = true;
	//  else if(document.getElementsByName) firefox,safari,opera = true;
	//
	if(document.all){
		oElements = document.all;
		for (i = 0; i < oElements.length; i++) {
			if(oElements[i].name==ename) ShowHideByElement(oElements[i],dvalue);
		}
	} else if(document.layers){
		ShowHideByElement(document.layers[ename],dvalue);
	} else if(document.getElementsByName){
		oElements = document.getElementsByName(ename);
		for (i = 0; i < oElements.length; i++) {
			ShowHideByElement(oElements[i],dvalue);
		}
	}
}
//
function ShowHideById(ename,dvalue){
	//  ename:id, dvalue:block|none|sw
	//  browser check logic
	//  if(document.all) IE = true;
	//  else if(document.layers) NN = true;
	//  else if(document.getElementsByName) firefox,safari,opera = true;
	//
	if(document.all){
		oElements = document.all;
		for (i = 0; i < oElements.length; i++) {
			if(oElements[i].id==ename) ShowHideByElement(oElements[i],dvalue);
		}
	} else if(document.layers){
			ShowHideNyElement(document.layers[ename],dvalue);
	} else if(document.getElementById){
				if(document.getElementById(ename))
					ShowHideByElement(document.getElementById(ename),dvalue);
	}
}
//
function ShowHideByElement(elem,dvalue){
		if(dvalue=='sw'){
			if(elem.style.display=='block') {
				elem.style.display='none';
			} else {
				elem.style.display='block';
			}
		} else {
			elem.style.display = dvalue;
		}
}
// Altanate Contents By Yoshi.S / webmaster@bluemooninc.biz
  function showhide(id){
    if(document.getElementById){
      if(document.getElementById(id).style.display == "none")
        document.getElementById(id).style.display = "block";
      else
        document.getElementById(id).style.display = "none";
    }
  }

// Xtended By k.shimizu (original showhide : Yoshi.S / webmaster@bluemooninc.biz)
function showhideByTC(tagnm,classnm,displaytype,proc){
	cookiename = "xoops_showhide_" + tagnm + classnm;
	if (proc == "init"){
		cookieValue = SHgetCookie(cookiename);
		if (cookieValue == ""){
			display = "none";
			SHsetCookie(cookiename,"OFF");
		} else {if (cookieValue == "ON"){
				display = displaytype;
			} else {
				display = "none";
			}
		}
		oElements = document.getElementsByTagName(tagnm);
		for (i = 0; i < oElements.length; i++) {
			oElement = oElements[i];
			if(oElement.className == classnm){
				oElement.style.display = display;
			}
		}
	} else {
		oElements = document.getElementsByTagName(tagnm);
		for (i = 0; i < oElements.length; i++) {
			oElement = oElements[i];
			if(oElement.className == classnm){
				if(oElement.style.display == "none"){
					oElement.style.display = displaytype;
					SHsetCookie(cookiename,"ON");
				} else {
					oElement.style.display = "none";
					SHsetCookie(cookiename,"OFF");
				}
			}
		}
	}
	return;
}

// original open source http://www.tohoho-web.com/wwwcook.htm
function SHgetCookie(key, tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}

// original open source http://www.tohoho-web.com/wwwcook.htm
function SHsetCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}

//
//	2010-9-18 inserted
//
function PopupOn3(POP, Base, Event){
	//  browser check logic
	//  if(document.all) IE = true;
	//  else if(document.layers) NN = true;
	//  else if(document.getElementById) Nx = true;

	if(document.all){	// IE 6,7,8
		type = document.compatMode;
		if(type=="BackCompat"){
			CL_Left = document.body.scrollLeft  + Event.clientX;
			CL_Top = document.body.scrollTop  + Event.clientY;
		} else {
			CL_Left = document.documentElement.scrollLeft  + Event.clientX;
			CL_Top = document.documentElement.scrollTop  + Event.clientY;
		}
		MyPOP = document.all(POP).style;
	} else if(document.getElementById){
		CL_Left = Event.pageX
		CL_Top = Event.pageY
		MyPOP = document.getElementById(POP).style;
	}

	POP_Width = MyPOP.width.replace("px","")-0;
	POP_Height = MyPOP.height.replace("px","")-0;
	if(Base!='NO') {
		POP_Pos = PopupPos(Base,CL_Left,CL_Top,POP_Width,POP_Height);
		MyPOP.left = POP_Pos[0];
		MyPOP.top = POP_Pos[1];
	}
	MyPOP.display = "block";
	//AlertText = "IE/"+CL_Left+"/"+CL_Top+"/"+POP_Width+"/"+POP_Height+"/"+POP_Pos[0]+"/"+POP_Pos[1];
	//alert(AlertText);
}
function PopupPos(Base,CL_Left,CL_Top,POP_Width,POP_Height){

		POP_Pos = new Array();

	//	左上位置計算
		if(Base=='RT'){
			POP_Pos[0] = CL_Left - POP_Width + 10;
			POP_Pos[1] = CL_Top - 10;
		} else if(Base=='RB'){
			POP_Pos[0] = CL_Left - POP_Width + 10;
			POP_Pos[1] = CL_Top - POP_Height + 10;
		} else if(Base=='LT'){
			POP_Pos[0] = CL_Left - 10;
			POP_Pos[1] = CL_Top - 10;
		} else if(Base=='LB'){
			POP_Pos[0] = CL_Left - 10;
			POP_Pos[1] = CL_Top - POP_Height + 10;
		}

	//	左上チェック
		if(POP_Pos[0]<0) POP_Pos[0]=0;
		if(POP_Pos[1]<0) POP_Pos[1]=0;
	//	右下チェック
		if(document.all) {	// IE 6,7,8
			type = document.compatMode;
			if(type=="BackCompat"){
				ClientRight = document.body.scrollLeft + document.body.clientWidth;
				ClientBottom = document.body.scrollTop + document.body.clientHeight;
			} else {
				ClientRight = document.documentElement.scrollLeft + document.documentElement.clientWidth;
				ClientBottom = document.documentElement.scrollTop + document.documentElement.clientHeight;
			}
		} else {
			ClientRight = window.pageXOffset + window.innerWidth;
			ClientBottom = window.pageYOffset + window.innerHeight;
		}
		OverRight = POP_Pos[0] + POP_Width - ClientRight;
		OverBottom = POP_Pos[1] + POP_Height - ClientBottom;
		//alert("OverRight/"+ POP_Pos[0] +"/"+ POP_Width +"/"+ ClientRight+"/"+OverRight+"/OverBottom/"+ POP_Pos[1] +"/"+ POP_Height +"/"+ ClientBottom+"/"+OverBottom+"/");
		if(OverRight>0) POP_Pos[0] -= OverRight;
		if(OverBottom>0) POP_Pos[1] -= OverBottom;

	//	px付加
		POP_Pos[0] += 'px';
		POP_Pos[1] += 'px';
		return(POP_Pos);
}
function PopupOff3(POP){
	if(document.all) document.all(POP).style.display = "none";
	else if(document.layers) document.layers[POP].display = "none";
	else if(document.getElementById) document.getElementById(POP).style.display = "none";
}
//
//
//
var xmlHttp;
function PopupOn2(Msg, mX, mY, nX, nY){		// new function using display
	//  browser check logic
	//  if(document.all) IE = true;
	//  else if(document.layers) NN = true;
	//  else if(document.getElementById) Nx = true;
	var pX = 0,  pY = 0;
	var sX = -10,sY = 30;

	if(Msg == "poplink"){	// poplinkの場合ajaxで内容取得
		if((document.all)&&!(window.opera)) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			xmlHttp = new XMLHttpRequest();
		}
		xmlHttp.onreadystatechange = PopLinkHtmlSet;
		xmlHttp.open("GET", "http://"+window.location.hostname+"/o/CT/LINK/ollink_direct_pophtml.php", true);
		xmlHttp.send(null);
	}

	if(document.all){
		MyMsg = document.all(Msg).style;
		MyMsg.display = "block";
	} else if(document.layers){
		MyMsg = document.layers[Msg];
		MyMsg.display = "block";
	} else if(document.getElementById){
		MyMsg = document.getElementById(Msg).style;
		MyMsg.display = "block";
	}

//	if(document.all)
//		pX = document.body.scrollLeft;
//		pY = document.body.scrollTop;
//		MyMsg.left = mX + pX + sX;
//		MyMsg.top  = mY + pY + sY;
//	} else if(document.layers || document.getElementById){
//		MyMsg.left = nX + sX;
//		MyMsg.top  = nY + sY;
//	}
// xoops標準のDOCTYPE文があると、style属性のleftやtopに
// アクセスできないようで、この関数が機能しない。このため
// もともとの関数ではonMouseOverした場所に対する相対位置に
// 表示するようになっていたが、あらかじめstyleで指定した位置に
// 固定的に表示するようにした（IE, firefox 同様）

}

function PopLinkHtmlSet(){
  if (xmlHttp.readyState == 4 && xmlHttp.status == 200){
		if((document.all)&&!(window.opera)) {
			document.all.poplink_surf.innerHTML = xmlHttp.responseText;
		} else {
			document.getElementById("poplink_surf").innerHTML = xmlHttp.responseText;
		}
  }
}
//
function PopupOff2(Msg){			// new function using display
	if(document.all) document.all(Msg).style.display = "none";
	else if(document.layers) document.layers[Msg].display = "none";
	else if(document.getElementById) document.getElementById(Msg).style.display = "none";
}

function PopupOn(Msg, mX, mY, nX, nY){	// old function using visibility
	var pX = 0,  pY = 0;
	var sX = -10,sY = 30;
	if(document.all){
		MyMsg = document.all(Msg).style;
		MyMsg.visibility = "visible";
	} else if(document.layers){
		MyMsg = document.layers[Msg];
		MyMsg.visibility = "show";
	} else if(document.getElementById){
		MyMsg = document.getElementById(Msg).style;
		MyMsg.visibility = "visible";
	}
}

//
function PopupOff(Msg){			// old function using visibility
	if(document.all) document.all(Msg).style.visibility = "hidden";
	else if(document.layers) document.layers[Msg].visibility = "hide";
	else if(document.getElementById) document.getElementById(Msg).style.visibility = "hidden";
}

//-------------------------------------------------------------------
// 森を走ろう！専用
//-------------------------------------------------------------------

xoops_url = "";
ev_root_url = "";
ev_tbl_url = "";

//
function mori_url_set(p_xoops_url,p_ev_root_url,p_ev_tbl_url) {
	//window.alert(p_xoops_url);
	xoops_url   = p_xoops_url;
	ev_root_url = p_ev_root_url;
	ev_tbl_url  = p_ev_tbl_url;
    return;
}

//
function open_mobile() {
    newWIN = window.open(xoops_url + "/i/intro.php","mobileWIN",
                         "width=200,height=500,resizable=YES,menubar=NO");
    return;
}

// 2006-12-4 insert urchinTracker call
//
function visit(url) {
	//window.alert(url);
	if (url == "NA"){
		window.alert("これはリンクではありません。他を選択してください");
	} else {
		newWIN = window.open("","");
		newWIN.location.href = xoops_url + "/CT/visit.php?p=" + url;
		urchinTracker("/outgoing/dl/" + url.replace(/https*:\/\//,""));
	}
	return;
}

//
function eventQ(resultwin,lang,fromwin,qstring) {

	// ---------------------------------------------------------------
	// 2008-11-19 指定したwindowに開けるようにした
	//            //*表示スタイルを dispstyle のcheckboxのみでなく
	//			  //*disp のselect からも指定できるようにした
	//					//* が 不明
	// 2006-5-16 メインページのプルダウンから検索できなかったので修正
	// ---------------------------------------------------------------
	// resultwin:表示先ウィンドウ opener,self,window名
	// lang     :言語             JAPAN,ENGLISH	おかしいぞ！国と言語が混乱
	// fromwin  :起動ウィンドウタイプ   f=s(参加したい画面),f=d(詳細検索画面),f=m(日本地図画面)
	// qstring  :検索文字列

	if (lang == "JAPAN" && fromwin == "f=s"){
		qstring = document.getElementsByName("qstring")[0].value;
		if (qstring == "NA"){
			window.alert("これは選択肢ではありません。他を選択してください");
			return;
		}
	}

	if (lang == "JAPAN"){
		if (fromwin == "f=d"){		// 詳細検索ウィンドウの場合
			eventQurl = ev_tbl_url + fromwin + "&proc=OLJ"
				+ "&period="  + document.getElementsByName("period")[0].value
				+ "&place="   + document.getElementsByName("place")[0].value
				+ "&c-1="     + document.getElementsByName("c1")[0].value
				+ "&c-2="     + document.getElementsByName("c2")[0].value
				+ "&c-3="     + document.getElementsByName("c3")[0].value
				+ "&c-4="     + document.getElementsByName("c4")[0].value
				+ "&c-5="     + document.getElementsByName("c5")[0].value
				+ "&freekey=" + escape(document.getElementsByName("freekey")[0].value)
				+ "&freekey2="+ escape(document.getElementsByName("freekey2")[0].value);
			if (document.getElementsByName("dispstyle")) {
				for (i = 0; i < document.getElementsByName("dispstyle").length; i++) {
					if (document.getElementsByName("dispstyle")[i].checked) {
						eventQurl = eventQurl + "&disp=" + document.getElementsByName("dispstyle")[i].value;
					}
				}
			}
			//*if (document.getElementsByName("disp")) {
			//*			eventQurl = eventQurl + "&disp=" + document.getElementsByName("disp")[0].value;
			//*}
		} else if (qstring == "__yotei__"){	// 知りたい画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=OLJ&period=plan&freekey=.*";
		} else if (qstring == "__seiseki__"){	// 知りたい画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=SEISEKI&period=before03";
		} else if (qstring == "__last3__"){	// 知りたい画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=OLJ&period=before03";
		} else if (qstring == "__offroad__"){	// 知りたい画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=ORR&period=plan";
		} else if (qstring == "__nandemo__"){	// 知りたい画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=NK&period=all";
		} else {				// 知りたい画面、日本地図画面から
				eventQurl = ev_tbl_url + fromwin + "&proc=OLJ&period=plan&freekey=" + escape(qstring);
		}
	} else {
					// 英語画面の処理
		if (fromwin == "f=m"){		// 日本地図画面から
			eventQurl = ev_tbl_url + fromwin + "&proc=OLE&period=plan&freekey=" + qstring;
		} else {			// 知りたい画面から
			eventQurl = ev_tbl_url + fromwin + "&proc=OLE"
				+ "&period="  + document.getElementsByName("period")[0].value
				+ "&freekey=" + document.getElementsByName("freekey")[0].value;
		}
	}

	if (resultwin == "opener"){
		window.opener.location.href = eventQurl;
	} else if (resultwin == "self"){
		window.self.location.href = eventQurl;
	} else {
		window.open(eventQurl,resultwin);
	}

	return;

}

//
function eventQ2(qform) {
	window.alert(qform.period.options[qform.period.selectedIndex].value);
//    window.opener.location.href 
//	= ev_tbl_url + qstring;
    return;
}

//
function openMAP(lang) {
    if (lang == "EN"){
	newWIN = window.open(ev_root_url + "JAPAN-MAP-E.php","mori_map",
             "width=800,height=600,resizable=YES,menubar=NO,scrollbars=YES");
    } else {
	newWIN = window.open(ev_root_url + "JAPAN-MAP-J.php","mori_map",
             "width=800,height=600,resizable=YES,menubar=NO");
    }
    return;
}

//
function openQ(dummy) {
    newWIN = window.open(ev_root_url + "queryEI.php","mori_query",
             "width=800,height=160,resizable=YES,menubar=NO,scrollbars=YES");
    return;
}

//
function setYouTube(title,comment,id,event) {
	//
	// 2010-1-16 ウィンドウをクリックした位置に移動するように変更
	//
	if (typeof(urchinTracker)=="function")  urchinTracker('/outgoing/youtube/'+title);
	var titlehtml = '<font size="+1"><b>'+title+'</b></font>　ブロードバンド環境でご覧ください';
	if(comment.length>0) titlehtml += '<br />'+comment;
	var objhtml = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'+id+'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'+id+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
	var foothtml = '動かない場合は<a target="_blank" href="http://www.youtube.com/watch?v='+id+'">YouTube</a>で見てください。　　　　<input type="button" value="閉じる" onClick="PopupOff2(\'popYouTube\')"></input>';
	document.getElementById('popYouTube').innerHTML = 
		'<iframe frameborder="0"></iframe><div class="popsurface">' +
		titlehtml+'<br />'+objhtml+'<br />'+foothtml+'</div>';
	if(document.all){
		//pageX = document.documentElement.scrollLeft + event.clientX;
		pageY = document.documentElement.scrollTop  + event.clientY;
		//alert("IE/"+pageX+","+pageY+"("+document.documentElement.scrollLeft+","+document.documentElement.scrollTop+")");
		document.all['popYouTube'].style.top = (pageY-150)+"px";
	} else if(document.getElementById){
		//alert("DOM/"+event.pageX+","+event.pageY);
		document.getElementById('popYouTube').style.top = (event.pageY-150)+"px";
	//} else if(document.layers){
	//	alert("UnKnownBrowser");
	}
    return;
}
//
// google search non-direct call  2008-7-18
//
function GoogleSearch(search_key,target_name){
	//
	// ss1がcheckされている事を前提としているので、少し手抜き
	// 現在のフォームでは問題なし
	//
	if((document.all)&&!(window.opera)) {
			sbi_save    = document.all.sbi.value;
			ss1_save    = document.all.ss1.value;
			target_save = document.all.google_search_form.target;
			document.all.sbi.value = search_key;
			document.all.google_search_form.target = target_name;
			document.all.ss1.value = '';
			document.all.google_search_form.submit();
			document.all.sbi.value = sbi_save;
			document.all.ss1.value = ss1_save;
			document.all.google_search_form.target = target_save;
			if(target_name=='ev_info_inner'){
				document.all.ev_contents.style.display   = 'none';
				document.all.ev_info_inner.style.display = 'block';
				document.all.xurlcmnt.style.display = 'block';
				param = "'"+search_key+"','_blank'";
				document.all.xurlcmnt.innerHTML = '下記ページは[ http：//www.google.co.jp ] です。<a href="javascript:GoogleSearch('+param+');">別ウィンドウに開く</a>';
				evIframeFit();
			}
	} else if(document.getElementById) {
			sbi_save    = document.getElementById("sbi").value;
			ss1_save    = document.getElementById("ss1").value;
			target_save = document.google_search_form.target;
			document.getElementById("sbi").value = search_key;
			document.google_search_form.target = target_name;
			document.getElementById("ss1").value = '';
			document.google_search_form.submit();
			document.getElementById("sbi").value = sbi_save;
			document.getElementById("ss1").value = ss1_save;
			document.google_search_form.target = target_save;
			if(target_name=='ev_info_inner'){
				document.getElementById("ev_contents").style.display   = 'none';
				document.getElementById("ev_info_inner").style.display = 'block';
				document.getElementById("xurlcmnt").style.display = 'block';
				param = "'"+search_key+"','_blank'";
				document.getElementById("xurlcmnt").innerHTML = '下記ページは[ http：//www.google.co.jp ] です。<a href="javascript:GoogleSearch('+param+');">別ウィンドウに開く</a>';
				evIframeFit();
			}
	}
}
//
// event-iframe height fit browser inside  2008-7-28
//
// 2010-5-3 「見出しをたたむ／戻す」を「イベント概要を隠す」／「イベント概要を表示」に変更
//
function evIframeFit(){
	if((document.all)&&!(window.opera)) {
 		if(document.all.ev_info_inner.style.display=='block'){
			midashi_height = document.all.xoopsmenu.offsetHeight + document.all.topmenubar.offsetHeight + document.all.gaiyou_all.offsetHeight;
			if(document.all.main.style.display=='none') midashi_height -= 10;
			document.all.ev_info_inner.height = document.documentElement.clientHeight - midashi_height - 15;
	 		if(document.all.main.style.display=='block'){
				document.all.second_button.innerHTML = "<button type='button' onClick='ShowHideById(\"main\",\"sw\");evIframeFit();return false;' >イベント概要を隠す</button>";
			} else {
				document.all.second_button.innerHTML = "<button type='button' onClick='ShowHideById(\"main\",\"sw\");evIframeFit();return false;' >イベント概要を表示</button>";
			}
		}
	} else if(document.getElementById){
		if(document.getElementById("ev_info_inner").style.display=='block'){
			midashi_height = document.getElementById("xoopsmenu").offsetHeight + document.getElementById("topmenubar").offsetHeight + document.getElementById("gaiyou_all").offsetHeight;
			if(document.getElementById("main").style.display=='none') midashi_height -= 20;
			document.getElementById("ev_info_inner").height = window.innerHeight - midashi_height - 30;
			if(document.getElementById("main").style.display=='block') {
				document.getElementById("second_button").innerHTML = "<button type='button' onClick='ShowHideById(\"main\",\"sw\");evIframeFit();return false;' >イベント概要を隠す</button>";
			} else {
				document.getElementById("second_button").innerHTML = "<button type='button' onClick='ShowHideById(\"main\",\"sw\");evIframeFit();return false;' >イベント概要を表示</button>";
			}
		}
	}
}
//
// 自サイト内のフレーム中に開かれた場合の表示変更処理	2008-8-2
//						見出し部の非表示、背景の白色化
function inFrameCheckAndMod(){
	if((document.referrer.match(/asobox.com|mori-o-hashirou.com/i))
	&&(window.self!=window.top)){
			ShowHideById("xoopsmenu","none");
			ShowHideById("topmenubar","none");
			ShowHideById("querybar","none");
			document.body.style.backgroundColor = "#ffffff";
	}
}
//
// myGmapのマーカー一覧を右クリック・メニュー	2008-8-6
//			緯度経度表示、他地図での表示、urlやlinkの生成						
//						
function mapRclick(event_FF,event_IE,cid,mid,mtitle,lng,lat,z,alt){
	// event_FF, event_IE : event IE or not
	// cid : mygmap category id, if=0 url,link非出力
	// mid : mygmap marker id
	// mtitile : mygmap marker title
	// lng : 経度
	// lat : 緯度
	// zoom : 拡大率
	// alt : (0|1) altタグ出力ON/OFF

	lng_j = lng + lat * 0.000046047 + lng * 0.000083049 - 0.010041;
	lat_j = lat + lat * 0.00010696  - lng * 0.000017467 - 0.0046020;
	lat_j_d = Math.round(Math.floor(lat_j));
	w_num = (lat_j - lat_j_d * 1.0) * 60.0;
	lat_j_m = Math.round(Math.floor(w_num));
	w_num_2 = (w_num - lat_j_m * 1.0) * 60.0;
	lat_j_s = Math.round(w_num_2*10)/10;
	lat_txt_1 = lat_j_d+"."+lat_j_m+"."+lat_j_s;
	lat_txt_2 = lat_j_d+"/"+lat_j_m+"/"+lat_j_s;
	lng_j_d = Math.round(Math.floor(lng_j));
	w_num = (lng_j - lng_j_d * 1.0) * 60.0;
	lng_j_m = Math.round(Math.floor(w_num));
	w_num_2 = (w_num - lng_j_m * 1.0) * 60.0;
	lng_j_s = Math.round(w_num_2*10)/10;
	lng_txt_1 = lng_j_d+"."+lng_j_m+"."+lng_j_s;
	lng_txt_2 = lng_j_d+"/"+lng_j_m+"/"+lng_j_s;

	if(cid==0) {
		map_rclick_urllink = '<tr><td>url</td><td><input name="map_rclick_url" onclick="map_rclick_form.map_rclick_url.select();" style="width:320px;" value="http://www.asobox.com/o/modules/mygmap?lat='+lat+'&lng='+lng+'&z2='+z+'"></td></tr>\n';
	} else {
		map_rclick_urllink = '<tr><td>url</td><td><input name="map_rclick_url" onclick="map_rclick_form.map_rclick_url.select();" style="width:320px;" value="http://www.asobox.com/o/modules/mygmap?cat='+cid+'&id='+mid+'"></td></tr>\n'
			+ '<tr><td>link</td><td><input name="map_rclick_a" onclick="map_rclick_form.map_rclick_a.select();" style="width:320px" value="&#139;a target=&#34;_blank&#34; href=&#34;http://www.asobox.com/o/modules/mygmap?cat='+cid+'&id='+mid+'&#34;&#62;'+mtitle+'&#139;/a&#62;"></td></tr>\n';
	}

	if(alt==0) {
		map_rclick_alt = "";
	} else {
		map_rclick_alt = '<tr><td>alt</td><td><input name="map_rclick_alt" onclick="map_rclick_form.map_rclick_alt.select();" style="width:320px" value="[alt mg:'+cid+':'+mid+']'+mtitle+'[/alt]"></td></tr>\n';
	}

	map_rclick_contents
		= "<form name='map_rclick_form'>"
		+ '<b>[ '+ mtitle + ' ]</b> の情報など<br />\n'
		+ '<font size="-1">経度：' + lng + '　緯度：' + lat + '</font><br />\n'
		+ '<a target="_blank" href="http://map.yahoo.co.jp/pl?sc=5&lat='+lat_txt_1+'&lon='+lng_txt_1+'">yahoo地図</a>　'
		+ '<a target="_blank" href="http://www.chizumaru.com/maplink.asp?SER=all&D=all&N='+lat_txt_1+'&E='+lng_txt_1+'">ちず丸</a>　'
		+ '<a target="_blank" href="http://www.mapfan.com/m.cgi?MAP=E'+lng_txt_1+'N'+lat_txt_1+'&ZM=10&NFLG=1">MapFan</a>　'
		+ '<a target="_blank" href="http://www.mapion.co.jp/c/f?el='+lng_txt_2+'&scl=25000&uc=1&grp=all&nl='+lat_txt_2+'">Mapion</a>　'
		+ '<a target="_blank" href="http://map.livedoor.com/map/scroll?MAP=E'+lng_txt_1+'N'+lat_txt_1+'&ZM=10">Livedoor</a>　'
		+ '<table>'
		+ map_rclick_urllink
		+ map_rclick_alt
		+ '</table>'
		+ "<div align='right'><span id='map_rclick_chk'></span><button onclick='"+'ShowHideById("map_rclick_win","none");return false;'+"'>閉じる</button></div>"
		+ '</form>\n';

	if(document.all){
		clickX = event_IE.offsetX;
		clickY = event_IE.offsetY;
		document.all.map_rclick_win.innerHTML = map_rclick_contents;
		win_top  = clickY ;if(win_top<0) win_top = 0;
		win_left = clickX - document.all.map_rclick_win.style.width.replace("px","")+600;if(win_left<0) win_left = 0;
		//document.all.map_rclick_chk.innerHTML = clickX+"/"+clickY+"/"+win_left+"/"+win_top+"/";
		document.all.map_rclick_win.style.top = ""+win_top+"px";
		document.all.map_rclick_win.style.left = ""+win_left+"px";
		document.all.map_rclick_win.style.display = 'block';
	} else {
		clickX = event_FF.pageX;
		clickY = event_FF.pageY;
		document.getElementById("map_rclick_win").innerHTML = map_rclick_contents;
		win_top  = clickY - 120;if(win_top<0) win_top = 0;
		win_left = clickX - document.getElementById("map_rclick_win").style.width.replace("px","");if(win_left<0) win_left = 0;
		document.getElementById("map_rclick_win").style.top = ""+win_top+"px";
		document.getElementById("map_rclick_win").style.left = ""+win_left+"px";;
		document.getElementById("map_rclick_win").style.display = 'block';
	}

	//alert("/x:"+clickX+"/y:"+clickY+"/gid:"+gid+"/mid:"+mid+"/mtitle:"+mtitle+"/経度:"+lng+"/緯度:"+lat+"/拡大率:"+z+"/");
	// url,a_tag,bb_tag,yahoo_Map,livedoor_Map,mapion,mapfan,ちず丸 
}
//--------------------------------------------------------------------
