//
function fncInit(){
	try{
		fncResize();
		changeImg_area01();
		initialize();
        objMap.addControl(new fncCustomMapControl());
        fncShowHideMapLbl(false);
		fncChgMapZoom();
		fncRegA(gkey, gkid);
		fncShowCenterIcon(true);
		fncExeFnc();
		return true	;
	} catch(ex) {
		return false;
	}
}

//
function fncFinalize(){
	try{
		try {
			GUnload();
		} catch(ex) {
		}	
		return true	;
	} catch(ex) {
		return false;
	}
}

//
function fncResize(){
try{
		if (objMap != null && objMap != undefined) {
			objMap.checkResize();
		}

		try {
			resizeDisp();
		} catch(ex) {
		}

		fncShutter_resize();
		fncShowCenterIcon(true);
		fncRePosiTop();
		fncRePosiWin();
		return true	;
	} catch(ex) {
		return false;
	}
}

//
function initialize() {
try {
		if (!GBrowserIsCompatible()) {
			// Google Map 使用不可
alert('ご使用中のブラウザはリフォパッに対応していません。');
			return false;
		} 

 		objMap = new GMap2(document.getElementById("left_Category"));
		objGeo = new GClientGeocoder();
		
		objMap.addControl(new GScaleControl());	//Scale
		
		var obj_view_map = new GOverviewMapControl();
		objMap.addControl(obj_view_map);	//minimap
		obj_view_map.hide();

		//objMap.enableScrollWheelZoom(); //korokoro

		GEvent.addListener(objMap, "zoomend", function(){
			fncChgMapZoom();
		})

		GEvent.addListener(objMap, "dragend", function(){
			fncChgMapDragend();	 //"moveend" "dragend"
		})

		GEvent.addListener(objMap, "moveend", function(){
			fnc_reposi_move_icon();
		})

		GEvent.addListener( objMap, "infowindowopen", function() {
			bln_infowin_open = true;
		});

		GEvent.addListener( objMap, "infowindowclose", function() {
			bln_infowin_open = false;
		});

		//座標＋ズームレベル位置セット
		fncSetInitPoint();

		//Save
		fncSavePosition();

		if (gkth != 1) {
			//
			fncOpenKenTop(0);
		} else {
			if (gkth == 1 && gckf == 1 && gfrp == 1) {
				fncFindKomutenCenterPointStart(gkid, glat, glng ,0 ,"");
			}
		}

		return true;
	} catch(ex) {
		return false;
	}
}


//
function fncChgMapCtrlImg(i_id){
try{
		for (i=8;i<20;i++){
			if (document.getElementById("div_MapCtl_z" + i) == null){
				return false;
			}
		}
		for (i=8;i<20;i++){
			document.getElementById("div_MapCtl_z" + i).style.backgroundImage = 'url(./img/graph_off.png)';
		}
		if (isNaN(i_id) == false && i_id >= 8 && i_id <= 19){
			document.getElementById("div_MapCtl_z"+i_id).style.backgroundImage = 'url(./img/graph_on.png)';	
		}
		return true;
	} catch(ex) {
		return false;
	}
	
}

//
function 	fncChgMapZoom(){
try {
		if (objMap.getZoom() < 8){
			objMap.setZoom(8);
		}

		fnc_reposi_move_icon();
		
		fncChgMapCtrlImg(objMap.getZoom());		
		return true;

	} catch(ex) {
//alert("fncChgMapZoom:" + ex.description);
		return false;
	}
}


//
function 	fncChgMapDragend(){
try {
		if (bln_infowin_open == true){
			return false;
		}

		//
		if (fncChkShowKm() == true){
			fncOpenMoveInfo(0);
		}

		//
		fncChkMoveSubDomain();

		return true;

	} catch(ex) {
//alert("fncChgMapDragend:" + ex.description);
		return false;
	}
	
}

//
function 	fncChkMoveSubDomain(){
	try {
	
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {			
				if (fncChkReadyState(objXmlHttp) == true){
					var str_html = fncGetHtmlText(objXmlHttp.responseText);
					fncChkMoveSubDomainRet(str_html);
				} else {
				}
			} catch(ex) {
//alert("fncChkMoveSubDomain:fncChkReadyState:" + ex.description);
				return false;
			}
		});

		if (objXmlHttp){
			//GetMapRange
			var rectObj = gfnc_getBounds(objMap);
			var objLatLng_SW = rectObj.getSouthWest();
			var objLatLng_NE = rectObj.getNorthEast();

 			objXmlHttp.open('GET','./rxSetFindPoint.php?t=' + objDate.getTime() 
 			                                      + '&kid=' + escape(gkid, true) 
										  	      + '&lat=' + escape(objMap.getCenter().lat(), true)
										  	      + '&lng=' + escape(objMap.getCenter().lng(), true)
										  	      + '&zl=' + escape(objMap.getZoom(), true)
										  	      + '&swlat=' + escape(objLatLng_SW.lat(), true)
										  	      + '&swlng=' + escape(objLatLng_SW.lng(), true)
										  	      + '&nelat=' + escape(objLatLng_NE.lat(), true)
										  	      + '&nelng=' + escape(objLatLng_NE.lng(), true));
			objXmlHttp.send(null);
		}

		return true;

	} catch(ex) {
//alert("fncChkMoveSubDomain:" + ex.description);
		return false;
	}
	
}


//
function fncRePosiTop(){
try{
		if (document.getElementById("div_kentopin") == null || 
		    document.getElementById("div_kentopin") == undefined){
			return false;
		} else if (objMap == null || objMap == undefined){
			return false;
		} 

		intTop_w = KENTOP_W;
		intTop_h = KENTOP_H;

		var intLeft = fncGetMapCenterLeft(intTop_w);
		var intTop = fncGetMapCenterTop(intTop_h);

		var objMapSize = objMap.getSize();
		var int_HoseiValue = 144;

		// IE6 Only
		if (fnc_chk_msie6() == true){
			int_HoseiValue = 50;
		}

		intTop += int_HoseiValue;
		if (objMapSize.height < intTop_h){
			intTop = int_HoseiValue;
		}

		document.getElementById("div_kentop").style.left = intLeft + "px";
		document.getElementById("div_kentop").style.top = intTop + "px";

		return true;
	} catch(ex) {
//alert("fncRePosiTop:" + ex.description);
		return false;
	}
}


//
function fncRePosiWin(){
try{
		if (objMap == null || objMap == undefined){
			return false;
		} 

		// Kantan
		fncChgTopLeftWin("div_Kantan");

		// loading
		fncChgTopLeftWin("div_loading");

		// info
		fncChgTopLeftWin("div_info");

		// maplink
		fncChgTopLeftWin("div_maplink");

		// assistant
		fncChgTopLeftWin("div_assistant");

		// retry
		fncChgTopLeftWin("div_retry");


		// move_info
		var objDivMin = document.getElementById("div_move_info_mini")
		if (objDivMin != null){
			if (objDivMin.style.visibility != "visible"){
				fncChgTopLeftWin("div_move_info");
			}
		}

		return true;
	} catch(ex) {
//alert("fncRePosiWin:" + ex.description);
		return false;
	}
}

//
function fncChgTopLeftWin(i_id){
	try{

		if (document.getElementById(i_id) == null){
			return false;
		}

		var i_w = parseInt(document.getElementById(i_id).style.width);
		var i_h = parseInt(document.getElementById(i_id).style.height);

		if (isNaN(i_w) == true || isNaN(i_h) == true){
			return false;
		} 

		document.getElementById(i_id).style.left = fncGetMapCenterLeft(i_w) + "px";
		document.getElementById(i_id).style.top = fncGetMapCenterTop(i_h) + "px";

		return true;
	} catch(ex) {
//alert("fncChgTopLeftWin:" + ex.description);
		return false;
	}
}



//Open
//
function fncOpenKenTop(i_kbn){
	try {

		if (document.getElementById("div_kentopin") != null) {
			fncCloseKenTop();
			return true;
		}

        if (parseInt(i_kbn) != 0){
			fncRegNr();
		}

		fncCloseAllWindow();

        var objDiv = document.createElement('div');
 
		objDiv.id='div_kentopin';
		objDiv.className ='css_kentopin';

		objDiv.innerHTML = fncGetKenTopHTML(0);

		document.getElementById("div_kentop").style.filter ='shadow(color=#000000,direction=135)';
		document.getElementById("div_kentop").appendChild(objDiv);

		document.getElementById('txt_KeyWord001').focus();
		document.getElementById('txt_KeyWord001').select();

		//アルファ処理
		fncMap_Alpha(true);
		fncRePosiTop();
		return true;
	} catch(ex) {
//alert("fncOpenKenTop:" + ex.description);
		return false;
	}
}

//
function fncShowCenterIcon(i_bool){
try {

		if (objMap == null || objMap == undefined){
			return false;
		}

		objMap.checkResize();

		if (i_bool == false) {
			// remove
			fncCloseWin("left_Category", "div_center_icon");
			return true;
		}


		var objDiv = document.getElementById("div_center_icon");
		var bln_exists_flg = true;


		if (objDiv == null){
			objDiv = document.createElement("div");
			bln_exists_flg = false;
		}

		objDiv.id = 'div_center_icon';
		objDiv.className = "css_center_icon";

		var int_width  = CENTERICON_W;
		var int_height = CENTERICON_H;

		objDiv.style.width = int_width + 'px';
		objDiv.style.height = int_height + 'px';

		objDiv.style.left = fncGetMapCenterLeft(int_width) + "px";
		objDiv.style.top = fncGetMapCenterTop(int_height) + "px";

		if (bln_exists_flg == false){

			var objDivIn = document.createElement("div");
			objDivIn.id = 'div_center_icon_in';
			objDivIn.className = "css_center_mark_in";

			objDivIn.style.width = int_width + 'px';
			objDivIn.style.height = int_height + 'px';

			objDiv.appendChild(objDivIn);
			objMap.getContainer().appendChild(objDiv);

		}

		return true;

	} catch(ex) {
//alert("fncShowCenterIcon:" + ex.description);
		return false;
	}
}


//
function fncOpenKantan(){
	try {

		if (document.getElementById("div_kantan") != null) {
			fncCloseKantan();
			return true;
		}
		fncCloseAllWindow();
		var objDate = new Date();
		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){
					fncLoodingOnOff(false);
					var str_html = fncGetHtmlText(objXmlHttp.responseText);
					fncShowKantanRet(str_html);
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
			}			
		});

		if (objXmlHttp){
			objXmlHttp.open('GET','./rxKantan.php?t=' + objDate.getTime()
			                                + '&kid=' + escape(gkid, true)
											+ fncGetQ_RegNr());
			objXmlHttp.send(null);
		}
		
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncOpenMapLink(){
	try {
		//
		var objDiv = document.getElementById("div_maplinkin")
		if (objDiv != null) {
			fncCloseMapLink();
			return true;
		}

		//
		//fncRegNr();
		fncCuMapLink(0);
		fncCloseAllWindow();

		var str_url = '';
		var str_subdmain = '';

		if (gsd != null && gsd.length > 0 ){
			str_subdmain = 	gsd + '.';
		}
		
		str_url = 'http://' + str_subdmain +  gmapurl 
		        + '?lat='  + objMap.getCenter().lat()
			    + '&lng=' + objMap.getCenter().lng() 
			    + '&l=' + objMap.getZoom()
				+ '&ktv=1';

		objDiv = document.createElement("div");
		objDiv.id='div_maplinkin';
		objDiv.innerHTML = fncGetHtmlMapLink(str_url, "fncCloseMapLink();");

		var objDivMap = document.createElement("div");
		objDivMap.id = "div_maplink";
		objDivMap.className = "css_maplink";

		var int_width  = MAPLINK_W;
		var int_height = MAPLINK_H;

		objDivMap.style.width = int_width + 'px';
		objDivMap.style.height = int_height + 'px';

		objDivMap.style.left = fncGetMapCenterLeft(int_width) + "px"
		objDivMap.style.top = fncGetMapCenterTop(int_height) + "px"

		objDivMap.style.filter ='shadow(color=#000000,direction=135)';

		//Add 
		objDivMap.appendChild(objDiv);

		document.getElementById("left_Category").appendChild(objDivMap);
		document.getElementById("txtarea_Search01").focus();
		document.getElementById("txtarea_Search01").select();

		return true;
	} catch(ex) {
//alert("fncOpenMapLink:" + ex.description);
		return false;
	}
}

//
function fncOpenPrint(){
	try {
		//
		fncRegNr();

		if (fncSetKmids() == false) {
			return false;
		}

		document.getElementById("hdnlat").value = objMap.getCenter().lat();
		document.getElementById("hdnlng").value = objMap.getCenter().lng();
		document.getElementById("hdnlv").value = objMap.getZoom();

		document.getElementById("hdnkey").value = gkey;
		document.getElementById("hdnkid").value = gkid;

		document.frmMove.target = "_blank";
		document.frmMove.method = "post";
		document.frmMove.action = "./map01_print02.php";

		document.frmMove.submit();

		document.getElementById("hdnlat").value = "";
		document.getElementById("hdnlng").value = "";
		document.getElementById("hdnlv").value = "";

		document.getElementById("hdnkey").value = "";
		document.getElementById("hdnkid").value = "";

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncOpenBookmark(){
try {
		fncCloseAllWindow();
		fncRegistMapBookmark();
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncOpenReFind(i_kbn, i_ewd){
try {

//
		fncRegEWd(i_kbn, i_ewd, gkid);

		fncCloseReFind();
		fncCloseAllWindow();

		var objDiv = document.createElement("div");
		objDiv.id='div_retryin';
		objDiv.innerHTML = fncGetRetryHTML(i_kbn, i_ewd, 0);

		var objDiv_ReTry = document.createElement("div");
		objDiv_ReTry.id = "div_retry";
		objDiv_ReTry.className = "css_retry";

		var int_width  = RETRY_W;
		var int_height = RETRY_H;

		objDiv_ReTry.style.width = int_width + 'px';
		objDiv_ReTry.style.height = int_height + 'px';
		objDiv_ReTry.style.filter ='shadow(color=#000000,direction=135)';

		objDiv_ReTry.style.left = fncGetMapCenterLeft(int_width) + "px";
		objDiv_ReTry.style.top = fncGetMapCenterTop(int_height) + "px";

		objDiv_ReTry.style.filter ='shadow(color=#000000,direction=135)';
		objDiv_ReTry.appendChild(objDiv);

		document.getElementById("left_Category").appendChild(objDiv_ReTry);
		document.getElementById('txtarea_Search02').focus();

		return true;

	} catch(ex) {
//alert("fncOpenReFind:" + ex.description);
		return false;
	}
}

//
function fncMap_Alpha(i_bln_show_flg){
	try {

		var str_id = 'div_map_alpha';
		var objDiv_Alpha = document.getElementById(str_id);

		if (objDiv_Alpha != null){

			// リスナーの削除
			if(objDiv_Alpha.removeEventListener){
			    objDiv_Alpha.removeEventListener("click", fncCloseKenTop, false);
			}else if(objDiv_Alpha.detachEvent){
			    objDiv_Alpha.detachEvent("onclick", fncCloseKenTop);
			}
			
			fncRemoveElement(str_id);
		}

		if (i_bln_show_flg == false){
			return true;
		}

		objDiv_Alpha = document.createElement("div");
		objDiv_Alpha.id = str_id;
		objDiv_Alpha.className = "css_map_alpha";

		// リスナーの追加
		if(objDiv_Alpha.addEventListener){
		    objDiv_Alpha.addEventListener("click", fncCloseKenTop, false);
		}else if(objDiv_Alpha.attachEvent){
		    objDiv_Alpha.attachEvent("onclick", fncCloseKenTop);
		}

		document.getElementById("left_Category").appendChild(objDiv_Alpha);

		return true;

	} catch(ex) {
//alert("fncMap_Alpha:" + ex.description);
		return false;
	}
}


//Close

//
function fncCloseAllWindow(){
try {

		fncCloseInfoWin();
		fncCloseKenTop();
		fncCloseMapLink();
		fncCloseKantan();
		fncCloseReFind();
		fncCloseAssistant();
		fncCloseIconInfo();
		fncLoodingOnOff(false);
			
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncCloseInfoWin(){
try {
		fncCloseWin("left_Category", "div_info");
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//
function fncCloseKenTop(){
try {
		fncCloseWin("div_kentop", "div_kentopin");
		//アルファ処理
		fncMap_Alpha(false);
		return true;
	} catch(ex) {
//alert("fncCloseKenTop:" + ex.description);
		return false;
	}
}

//
function fncCloseMapLink(){
try {
		fncCloseWin("left_Category", "div_maplink");
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncCloseKantan(){
try {
		fncCloseWin("left_Category", "div_kantan");
		return true;
	} catch(ex) {
//alert("fncCloseKantan:" + ex.description);
		return false;
	}
}

//
function fncCloseReFind(){
try {
		fncCloseWin("left_Category", "div_retry");
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncCloseAssistant(){
try {
		fncCloseWin("left_Category", "div_assistant");
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncCloseIconInfo(){
try {
		objMap.closeInfoWindow();
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncCloseMoveInfo(){
try {
		fncCloseWin("left_Category", "div_move_info");
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}


//LoodingのOnOff
function fncLoodingOnOff(i_bool){
try {

		var objDiv = document.getElementById("div_loading");

		if (i_bool == true ) {

			if (objDiv != null){
				fncCloseWin("left_Category", "div_loading");
			}

			objDiv = document.createElement("div");
			objDiv.id = 'div_loading';
			objDiv.className = "css_loading";

			var int_width  = LOODING_W;
			var int_height = LOODING_H;

			objDiv.style.width = int_width + 'px';
			objDiv.style.height = int_height + 'px';
	
			objDiv.style.left = fncGetMapCenterLeft(int_width) + "px";
			objDiv.style.top = fncGetMapCenterTop(int_height) + "px";

			var objDivIn = document.createElement("div");
			objDivIn.id = 'div_loadingin';
			objDivIn.className = "css_loadingin";

			objDiv.appendChild(objDivIn);
			document.getElementById("left_Category").appendChild(objDiv);

		} else {

			if (objDiv == null) {
				return true;
			}

			fncCloseWin("left_Category", "div_loading");
			objDiv = null;
		}
			
		return true;
	} catch(ex) {
//alert("fncLoodingOnOff" + ex.description);
		return false;
	}
}


//
//かんたん検索表示
function fncShowKantanRet(i_ret_text){
try {
		fncCloseKantan();

		var objDiv = document.createElement("div");

		objDiv.id='div_kantanin';
		objDiv.innerHTML = i_ret_text;

		var objDiv_Kan = document.createElement("div");

		objDiv_Kan.id = "div_kantan";
		objDiv_Kan.className = "css_kantan";

		var int_width  = KANTAN_W;
		var int_height = KANTAN_H;

		objDiv_Kan.style.width = int_width + 'px';
		objDiv_Kan.style.height = int_height + 'px';
		objDiv_Kan.style.filter ='shadow(color=#000000,direction=135)';

		objDiv_Kan.style.left = fncGetMapCenterLeft(int_width) + "px";
		objDiv_Kan.style.top = fncGetMapCenterTop(int_height) + "px";

		objDiv_Kan.appendChild(objDiv);

		document.getElementById("left_Category").appendChild(objDiv_Kan);

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
} 


//
function fncKantankensaku(i_id){
try {
		var ccd = i_id.replace("a_kantan_link_", "")
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {

				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);
					fncCloseKantan();
					var str_html = fncGetHtmlText(objXmlHttp.responseText);
					fncKensakuGeo(str_html);
		
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});

		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxKensakuGeo.php?t=' + objDate.getTime() 
			                                    + '&kbn=' + escape(0, true) 
			                                    + '&kid=' + escape(gkid, true) 
										  	    + '&ccd=' + escape(ccd, true)
											    + '&snm=' + encodeURI(document.getElementById(i_id).innerHTML) );
			objXmlHttp.send(null);
		}

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncGetGeoPoint(iLatLng){
	try {

		if (iLatLng == null || iLatLng == undefined){
			return false;
		}

		document.getElementById("div_f_ido").innerHTML = iLatLng.lat();
		document.getElementById("div_f_keido").innerHTML = iLatLng.lng();
		
		//
		fnc_find_map_zoom(); 

		// 工務店検索準備処理
		fncFindKomutenCenterPointStart(document.getElementById("div_f_kid").innerHTML
		                             , document.getElementById("div_f_ido").innerHTML
									 , document.getElementById("div_f_keido").innerHTML
									 ,0 ,"" );
		
		return true;
	} catch(ex) {
//alert("fncGetGeoPoint:" + ex.description);
		return false;
	}
}


//
function fncKensakuGeo(i_ret_text){
try {
		document.getElementById("div_parm").innerHTML = i_ret_text;

		//Close
		fncCloseAllWindow();

		if (document.getElementById("div_f_ret") != null && 
		    document.getElementById("div_f_ret").innerHTML.length > 0) {

			//
			fnc_find_map_zoom(); 

			// 工務店検索準備処理
			fncFindKomutenCenterPointStart(document.getElementById("div_f_kid").innerHTML
			                             , document.getElementById("div_f_ido").innerHTML
										 , document.getElementById("div_f_keido").innerHTML
										  ,0 ,"" );
		} else {
   			var objGeocoder = new GClientGeocoder();
			//ジオコーディング
			objGeocoder.getLatLng( document.getElementById("ken_name").innerHTML + document.getElementById(i_id).innerHTML, fncGetGeoPoint );
		}
			
		return true;
	} catch(ex) {
//alert('fncKensakuGeo:'+ ex.description);
		return false;
	}
}



//工務店地点検索準備処理
function fncFindKomutenCenterPointStart(i_kid, i_ido, i_keido, i_fkbn, i_keyword){
	try {

		//
		fncLoodingOnOff(true);
		fncCloseAllWindow();
		fncCloseMoveInfo();

		//MoveCenter
    	objMap.setCenter(new GLatLng(i_ido, i_keido), objMap.getZoom());
		
		//Save
		objMap.savePosition();

		//GetMapRange
		var rectObj = objMap.getBounds();
		var objLatLng_SW = rectObj.getSouthWest();
		var objLatLng_NE = rectObj.getNorthEast();
		
		var dec_sw_lat = objLatLng_SW.lat();
		var dec_sw_lng = objLatLng_SW.lng();
		var dec_ne_lat = objLatLng_NE.lat();
		var dec_ne_lng = objLatLng_NE.lng();


		if (i_fkbn != null && isNaN(i_fkbn) == false & i_fkbn == 2){
			dec_sw_lat = i_ido;
			dec_sw_lng = i_keido;
			dec_ne_lat = i_ido;
			dec_ne_lng = i_keido;
		}

		//指定した範囲内の工務店を検索する
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {

				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);

					//CloseKantan
					fncCloseKantan();

					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					//
					fncRetFindKomuten(str_html);

				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});

		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxFindKomutenRectRange.php?t=' + objDate.getTime() 
			                                              + '&kid=' + escape(i_kid, true) 
										  	             + '&clat=' + escape(i_ido, true)
										  	             + '&clng=' + escape(i_keido, true)
										                + '&swlat=' + escape(dec_sw_lat, true)
										  	            + '&swlng=' + escape(dec_sw_lng, true)
										  	            + '&nelat=' + escape(dec_ne_lat, true)
										  	            + '&nelng=' + escape(dec_ne_lng, true)
										  	             + '&fkbn=' + escape(i_fkbn, true)
										  	            + '&fword=' + encodeURI(i_keyword)
										  	              + '&dkb=' + escape(0, true)
										  	              + '&anm=' + escape(0, true));
			objXmlHttp.send(null);
		}
		
		fncLoodingOnOff(false);
		return true;
	} catch(ex) {
//alert("fncFindKomutenCenterPointStart:" + ex.description);
		fncLoodingOnOff(false);
		return false;
	}
}

// 工務店検索検索結果

function fncRetFindKomuten(i_ret_text){
try {
			var blnGetlatlng = false;
			var retTex = i_ret_text;
			
			if (retTex.length <= 0) {
				return false;
			}

			var intListPoint = retTex.indexOf('<ul id="btn-Tab"', 0);
			var intParmPoint = retTex.indexOf('<div id="div_list_cnt"', 0);

			if (intListPoint < 0 && intParmPoint < 0){
				return false
			}

			var strListHtml = '';
			
			if (intListPoint > -1){

				var intEndPoint = retTex.length;
				
				if (intParmPoint > -1 ){
					intEndPoint = intParmPoint;
				}

				strListHtml = retTex.substr(intListPoint, intEndPoint);
			} 

			var strParmHtml = "";

			if (intParmPoint > -1){
				strParmHtml = retTex.substr(intParmPoint, retTex.length);
			}

			document.getElementById("wrap-right").innerHTML =  strListHtml;
			document.getElementById("div_klist_wk").innerHTML = "";
			document.getElementById("div_klist_parm").innerHTML =  strParmHtml;

			//DropAllIcon				
			fncDropAllIcon();


			if (isNaN(document.getElementById("div_list_cnt").innerHTML) == true) {
				//Not Data
				return false
			}

			bln_show_flg = true;
			intIconCnt = parseInt(document.getElementById("div_list_cnt").innerHTML);

			//MakeIcon - Init
			fncSetIconMain(intIconCnt
			               , 0
						   , document.getElementById("spn_f_kmlist_fparm_clat").innerHTML
						   , document.getElementById("spn_f_kmlist_fparm_clng").innerHTML
						   , document.getElementById("spn_f_kmlist_fparm_kmfkbn").innerHTML
					       , document.getElementById("spn_f_kmlist_fparm_magni").innerHTML);

			if (intIconCnt > 0){
				fncSetFlash();
			}

			//MakeIcon - Stop
			setTimeout("fncSetStopIcon(" + intIconCnt + ")", 2500);
			
			fncResize();

			if (document.getElementById("div_kicon_ido_01") != null && document.getElementById("div_kicon_keido_01") != null){
				fncMagniView(document.getElementById("spn_f_kmlist_fparm_magni").innerHTML
				            ,document.getElementById("spn_f_kmlist_fparm_clat").innerHTML
				            ,document.getElementById("spn_f_kmlist_fparm_clng").innerHTML
				            ,document.getElementById("div_kicon_ido_01").innerHTML
				            ,document.getElementById("div_kicon_keido_01").innerHTML);
			}
						
						
			fncChkMoveSubDomain();
		return true;
	} catch(ex) {
		bln_show_flg = false;
//alert("fncRetFindKomuten:" + ex.description);
		return false;
	}
}


//
function fncSetFlash(){
try {
		
		var _id="swfFlash";
		var obj_flash = document.createElement("div");
		obj_flash.id=_id;
		
		var int_width  = FLASH_W;
		var int_height = FLASH_H;
		
		obj_flash.className = "css_icon_flash"
		obj_flash.style.position ="absolute";
		obj_flash.style.margin = "0px 0px 0px 0px";
		obj_flash.style.padding = "0px 0px 0px 0px";
		
		obj_flash.style.left = fncGetMapCenterLeft(int_width) + "px";
		obj_flash.style.top = fncGetMapCenterTop(int_height) + "px";
	
		obj_flash.style.width =int_width+"px";
		obj_flash.style.height=int_height+"px";
		
		var flashsize ="100%";
	
		obj_flash.innerHTML+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ flashsize +'" height="'+ flashsize +'" id="target" align="middle">'
		+'<param name="allowScriptAccess" value="sameDomain" />'
		+'<param name="movie" value="mapflash/target.swf" />'
		+'<param name="loop" value="false" />'
		+'<param name="quality" value="high" />'
		+'<param name="wmode" value="transparent" />'
		+'<param name="bgcolor" value="#ffffff" />'
		+'<embed src="mapflash/target.swf" loop="false" quality="high" wmode="transparent" bgcolor="#ffffff" width="'+ flashsize +'" height="'+ flashsize +'" name="target" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
		+'</object>';
		
		 document.getElementById("left_Category").appendChild(obj_flash);
		
		return true;
	} catch(ex) {
//alert("fncSetFlash:" + ex.description);
		return false;
	}	
}

//
function fncSetIconMain(i_Cnt, i_mmode, i_fclat, i_fclng, i_flg_icon_view, i_flg_magni){
try {

		if (i_Cnt == 0 ) {
			return false
		}
		var strNo;
		var objPoint;
		var retBool;
		var dec_ido;
		var dec_keido;
		var retAddFlg;


		objIconAry = new Array();
		objMarkerAry = new Array();

		var obn_spn_ido;
		var obn_spn_keido;
		
		for (intLoop = 1; intLoop <= i_Cnt; intLoop++) {
	
			strNo = "00" + intLoop;
			strNo = strNo.substr(strNo.length - 2, 2);

			dec_ido = 0;
			dec_keido = 0;

			obn_spn_ido = null;
			obn_spn_keido = null;

			obn_spn_ido = document.getElementById("div_kicon_ido_" + strNo);
			obn_spn_keido = document.getElementById("div_kicon_keido_" + strNo);

			if (obn_spn_ido != null && obn_spn_keido != null){

				dec_ido = obn_spn_ido.innerHTML;
				dec_keido = obn_spn_keido.innerHTML;

				retAddFlg = fncChkIconSet(new GLatLng(i_fclat, i_fclng), new GLatLng(dec_ido, dec_keido));

				if (i_flg_magni != null && isNaN(i_flg_magni) == false && i_flg_magni == 1){
					retAddFlg = true;
				}

				objPoint = new GLatLng(dec_ido, dec_keido);
				objIconAry[intLoop - 1] = new GIcon();
	
				//MakeIcon
				retBool = fncSetIcon(intLoop - 1, strNo, i_mmode);
				strKmid = document.getElementById("div_kicon_id_" + strNo).innerHTML;

				//MakeMarker
				retBool = fncSetMarker(intLoop - 1
				                     , strNo
									 , strKmid
									 , objPoint
									 , i_mmode
									 , dec_ido
									 , dec_keido
									 , document.getElementById("div_kicon_name_" + strNo).innerHTML
									 , retAddFlg);
			}
		}

		return true;
	} catch(ex) {
//alert("fncSetIconMain:" + ex.description);
		return false;
	}
}


//
function fncSetIcon(i_intIndex, i_id, i_mode){
	try {

		if (objIconAry[i_intIndex] == null || objIconAry[i_intIndex] == undefined){
			objIconAry[i_intIndex]= new GIcon();
		}

		objIconAry[i_intIndex].shadow = "";
		objIconAry[i_intIndex].shadowSize = new GSize(0, 0);
		
		switch(i_mode) {
			case 0:
	 			objIconAry[i_intIndex].image = document.getElementById("div_kicon_init_" + i_id).innerHTML;
				
				if (document.getElementById("div_kicon_kflg_" + i_id).innerHTML == '1') {
		 			objIconAry[i_intIndex].iconSize = new GSize(22,45);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(11,45);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(11, 45);
				} else {
		 			objIconAry[i_intIndex].iconSize = new GSize(18,45);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(9,45);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(9, 45);
				}
				
				break;
				
			case 1:
	 			objIconAry[i_intIndex].image = document.getElementById("div_kicon_stop_" + i_id).innerHTML;
				
				if (document.getElementById("div_kicon_kflg_" + i_id).innerHTML == '1') {
		 			objIconAry[i_intIndex].iconSize = new GSize(22,29);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(11,29);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(11, 29);
				} else {
		 			objIconAry[i_intIndex].iconSize = new GSize(18,24);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(9,24);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(9, 24);
				}

				break;
			case 2:
	 			objIconAry[i_intIndex].image = document.getElementById("div_kicon_move_" + i_id).innerHTML;

				if (document.getElementById("div_kicon_kflg_" + i_id).innerHTML == '1') {
		 			objIconAry[i_intIndex].iconSize = new GSize(22,45);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(11,45);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(11, 45);
				} else {

		 			objIconAry[i_intIndex].iconSize = new GSize(18,45);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(9,45);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(9, 45);
				}

				break;
				
			default:
			
	 			objIconAry[i_intIndex].image = document.getElementById("div_kicon_stop_" + i_id).innerHTML;

				if (document.getElementById("div_kicon_kflg_" + i_id).innerHTML == '1') {
		 			objIconAry[i_intIndex].iconSize = new GSize(22,29);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(11,29);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(11, 29);
				} else {
		 			objIconAry[i_intIndex].iconSize = new GSize(18,24);
		 			objIconAry[i_intIndex].iconAnchor = new GPoint(9,24);
			 		objIconAry[i_intIndex].infoWindowAnchor = new GPoint(9, 24);
				}
			}
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncSetMarker(i_intIndex, i_id, i_kmid, iobjPoint, i_mode, i_la, i_ln, i_title, i_set_flg){
try {

	var objMarkerOpt = new Object();
	objMarkerOpt.title = i_title;
	objMarkerOpt.icon = objIconAry[i_intIndex];

	try{
		objMarkerAry[i_intIndex] = new GMarker(iobjPoint, objMarkerOpt);
	} catch(ex){}


//original property
		objMarkerAry[i_intIndex].strNo = i_id;
		objMarkerAry[i_intIndex].intIndex = i_intIndex;
		objMarkerAry[i_intIndex].decLat = i_la;
		objMarkerAry[i_intIndex].decLng = i_ln;
		objMarkerAry[i_intIndex].strTitle = i_title;
//		objMarkerAry[i_intIndex].blnView = i_set_flg;
		objMarkerAry[i_intIndex].blnView = true;
		objMarkerAry[i_intIndex].strKmid = i_kmid;
		objMarkerAry[i_intIndex].obj_overlay_id = "";

//		if (i_set_flg != true){
			// visible : hidden
//			return true;
//		}

		if (i_mode != 1){
try{
//			objMap.addOverlay(objMarkerAry[i_intIndex]);
// move icon
fnc_set_overlay(i_intIndex);
} catch(ex){}
			return true;
		}

//Add_Event
		GEvent.addListener( objMarkerAry[i_intIndex], "click", function() {
			fncOpenInfoWindow(this.intIndex, this.strNo);
		});

try{
// stop icon
		objMap.addOverlay(objMarkerAry[i_intIndex]);
} catch(ex){}

		return true;
	} catch(ex) {
//alert("fncSetMarker:" + ex.description);
		return false;
	}
}

////////
var obj_div_overlay;
function fnc_set_overlay(i_intIndex){
try{

		var objPoint = new GLatLng(objMarkerAry[i_intIndex].decLat , objMarkerAry[i_intIndex].decLng );
		var objPixcel = objMap.fromLatLngToDivPixel(objPoint);

		obj_div_overlay = document.createElement("div");

		obj_div_overlay.style.position = "absolute";
		obj_div_overlay.style.left = parseInt(objPixcel.x) - parseInt(objIconAry[i_intIndex].iconAnchor.x) + "px";
		obj_div_overlay.style.top = parseInt(objPixcel.y) - parseInt(objIconAry[i_intIndex].iconAnchor.y) +  "px";

		obj_div_overlay.id = "div_move_icon_overlay_" + objMarkerAry[i_intIndex].strNo;

		obj_div_overlay.style.width = objIconAry[i_intIndex].iconSize.width + "px";
		obj_div_overlay.style.height = objIconAry[i_intIndex].iconSize.height + "px";

		obj_div_overlay.style.backgroundImage = "url(" + objIconAry[i_intIndex].image + ")";
   		obj_div_overlay.style.backgroundRepeat = "no-repeat";

		objMarkerAry[i_intIndex].obj_overlay_id = obj_div_overlay.id;

		objMap.addOverlay(new fncAddOverlay());
		return true;
	} catch(ex){
//alert("fnc_set_overlay:" + ex.description);
		return false;
	}
}

// --- fncAddOverlay [start] ---
function fncAddOverlay(){}
fncAddOverlay.prototype = new GOverlay();
fncAddOverlay.prototype.initialize = function(objMap){
	try{
			objMap.getPane(G_MAP_MARKER_PANE).appendChild(obj_div_overlay);
		} catch(ex) {}
}
fncAddOverlay.prototype.redraw = function(force){}
// --- fncAddOverlay [end] ---

//
function fnc_reposi_move_icon(){
try {
		if (objMarkerAry == null){
			return true;

		} else if (objMarkerAry.length > 0) {

			var obj_marker;
			var objPoint;
			var objPixcel;


			for (i=0;i<objMarkerAry.length;i++){

				if (objMarkerAry[i] != null 
				 && objIconAry[i] != null 
				 && objMarkerAry[i].obj_overlay_id != undefined 
				 && objMarkerAry[i].obj_overlay_id.length > 0){

					obj_marker = document.getElementById(objMarkerAry[i].obj_overlay_id);

					if (obj_marker != null){

						objPoint = new GLatLng(objMarkerAry[i].decLat , objMarkerAry[i].decLng );
						objPixcel = objMap.fromLatLngToDivPixel(objPoint);

						obj_marker.style.position = "absolute";
						obj_marker.style.left = parseInt(objPixcel.x) - parseInt(objIconAry[i].iconAnchor.x) + "px";
						obj_marker.style.top = parseInt(objPixcel.y) - parseInt(objIconAry[i].iconAnchor.y) +  "px";
					}
				 }
			}
		}
		

		return true;
	} catch(ex) {
//alert("fnc_reposi_move_icon:" + ex.description);
		return false;
	}
}
///////////

//
function fncOpenInfoWindow(i_id, i_no){
try {
//		objMarkerAry[i_id].openInfoWindowHtml(fncGetInfoHtml(i_id, i_no));
		var objLatLng = new GLatLng(objMarkerAry[i_id].decLat, objMarkerAry[i_id].decLng);
		objMap.openInfoWindow(objLatLng, fncGetInfoHtml(i_id, i_no));
		return true;
	} catch(ex) {
//alert("fncOpenInfoWindow:" + ex.description);
		return false;
	}
}


//
function fncGetInfoHtml(i_id, i_no){
	try {
		var str_ret_html = fncMakeInfoHtml(i_no);
		var strKid = document.getElementById("div_kicon_id_"+i_no).innerHTML;

		//
		fncBookmarkKmAdd(strKid, 2);

		//
		fncCukmp(strKid);

		fncMoveMapInfoShow(i_id);

		return str_ret_html;

	} catch(ex) {
//alert("fncGetInfoHtml:" + ex.description);
		return '';
	}
}


//
function fncMakeInfoHtml(i_id){
	try {

		var strRetHtml = '';
		var strUrl =  document.getElementById("div_kicon_url_"+i_id).innerHTML;
		var strKamei =  document.getElementById("div_kicon_kflg_"+i_id).innerHTML;
		var strKid = document.getElementById("div_kicon_id_"+i_id).innerHTML;
		var strKidParm = document.getElementById("div_kicon_id_"+i_id).innerHTML.toString();

		var strKmName = document.getElementById("div_kicon_name_"+i_id).innerHTML;
		var strKmNameBr = document.getElementById("div_kicon_name_br_"+i_id).innerHTML;

		var strKmAdd = document.getElementById("div_kicon_add1_"+i_id).innerHTML
		             + document.getElementById("div_kicon_add2_"+i_id).innerHTML;
		var strKmTel = document.getElementById("div_kicon_tel_"+i_id).innerHTML;
		var strKmPic = document.getElementById("div_kicon_pic_"+i_id).innerHTML;

		var str_kmname_view = strKmName;

		if (strKmNameBr != null && strKmNameBr.length > 0){
			str_kmname_view = strKmNameBr;
		}

		strRetHtml = '<div class="wrap-Popup" style="border:0px">';

			strRetHtml += '<div id="wrap-ShopName">';

		if (strUrl.length > 0) {

				strRetHtml += '<h3 id="shop-Name">';
				strRetHtml += '<a href="javascript:void(0);" target="_blank" onClick="fncOpenKmUrl(this,' + '\'' + strKid + '\''  +',' + '\'' + strUrl + '\''  +');return false;">';
				strRetHtml +=  str_kmname_view;
				strRetHtml += '</a>';
				strRetHtml += '</h3>';
	
strRetHtml += '<div>';
				strRetHtml += '<a style="font-family:MS Pゴシック;" href="javascript:void(0);" id="icon_Blank" onClick="fncOpenKmUrl(this,' + '\'' + strKid + '\''  +',' + '\'' + strUrl + '\''  +');return false;">';
				strRetHtml += strUrl;
				strRetHtml += '</a> ';
				strRetHtml += '<img src="./img/icon_blank.gif" alt="" width="10" height="9" border="0" />';
strRetHtml += '</div>';

		} else {

				strRetHtml += '<h3 id="shop-Name">';
				strRetHtml +=  str_kmname_view;
				strRetHtml += '</h3>';
	
				strRetHtml += strUrl;
		}

if (strKamei == '1') {
//		           + '<div id="btn-Page" style="margin-top:-35px;padding:0px 0px 0px 0px;" >'
strRetHtml += '<div>';
		strRetHtml += ''
		           + '<div id="btn-Page" style="postion:static;" >'
		           + '<a href="javascript:void(0);" onClick="fncMoveDetail(\''+ strKid+'\',' + '\'' + i_id + '\''  +');return false;">○詳細ページを見る</a>'
				   + '</div>';
strRetHtml += '</div>';
strRetHtml += '<br />';

if (fnc_chk_msie() == false){
strRetHtml += '<br />';
}

}

			strRetHtml += '</div>';


		if (strKamei == '1') {

			if (strKmPic.length > 0){
//none_white.gif
				strRetHtml += '<div id="wrap-Shopimg" style="background:url(./img/none_white.gif);padding-left:0px;">';
				strRetHtml += '<img src="' + strKmPic + '" alt="" width="75px" height="57px" />';
				strRetHtml += '</div>';
				strRetHtml += '<div id="wrap-Shopimg" style="background:url(./img/none_white.gif);padding-left:80px;margin-top: -70px;">';
				strRetHtml += strKmAdd;
				strRetHtml += '<br />';
				strRetHtml += 'TEL:';
				strRetHtml += strKmTel
				strRetHtml += '<a href="javascript:void(0);" target="_blank" onClick="fncMoveDetail(\''+ strKid+'\',' + '\'' + i_id + '\'' + ');return false;">';
				strRetHtml += '>> このリフォーム工事店の詳細ページをみる';
				strRetHtml += '</a>';
				strRetHtml += '</div>';

			} else {

				strRetHtml += '<div id="wrap-Shopimg" style="background:url(./img/none_white.gif)">';
				strRetHtml += strKmAdd;
				strRetHtml += '<br />';
				strRetHtml += 'TEL:';
				strRetHtml += strKmTel
				strRetHtml += '<a href="javascript:void(0);" target="_blank" onClick="fncMoveDetail(\''+ strKid+'\',' + '\'' + i_id + '\'' + ');return false;">';
				strRetHtml += '>> このリフォーム工事店の詳細ページをみる';
				strRetHtml += '</a>';
				strRetHtml += '</div>';

			}

		} else {
			strRetHtml += '<p class="txt-Search02" >';
			strRetHtml += strKmAdd;
			strRetHtml += '<br />';
			strRetHtml += 'TEL:';
			strRetHtml += strKmTel
			strRetHtml += '</p>';
		}
			
		if (strKamei == '1') {
			strRetHtml += '<p class="txt-Search04">';
//			strRetHtml +=  document.getElementById("spn_kicon_detail_"+i_id).innerHTML;
			strRetHtml +=  document.getElementById("txa_kicon_sales_"+i_id).value;
			strRetHtml += '</p>';
		}

		if (strUrl.length > 0) {
					
			strRetHtml += '<div id="btn-Homepage">';
			strRetHtml += '<a href="javascript:void(0);" target="_blank" onClick="fncOpenKmUrl(this,' + '\'' + strKid + '\''  +',' + '\'' + strUrl + '\''  +');return false;">';
			strRetHtml += 'このリフォーム工事店のホームページを見る';
			strRetHtml += '</a>';
			strRetHtml += '</div>';

		} else {
			strRetHtml += '<div id="btn-Homepage">';
			strRetHtml += '</div>';

		}
		
		if (fncChkKmBkRegist(strKid) == false) {
			strRetHtml += '<div id="btn-Favorite001"><a href="javascript:void(0);" '
			strRetHtml += ' onClick="fncOpenBookmarkKmRegist(\''+ strKid +'\',' + "\'" + strKmName + "\',\'"+ strKmAdd + '\',\'' + strKmTel + '\', 1);return false;">';

			strRetHtml += 'このリフォーム工事店をお気に入りに追加</a></div>';
			strRetHtml += '<a href="javascript:void(0);" id="confirmation"  onClick="fncChgBkmkList();return false;">お気に入りを確認する</a>';
		} else {
			strRetHtml += '<a href="javascript:void(0);" id="confirmation"  onClick="fncChgBkmkList();return false;" style="margin-left: 20px;" >お気に入りを確認する</a>';
			
		}

		strRetHtml += '</div>';

		strRetHtml += '';

		return strRetHtml;
	} catch(ex) {
//alert("fncGetInfoHtml:" + ex.description);
		return '';
	}
}

//
function fncSetStopIcon(i_Cnt){
	try {

		var obj_div_flsh =  document.getElementById("swfFlash");

		if (obj_div_flsh != null && obj_div_flsh != undefined){
			document.getElementById("left_Category").removeChild(obj_div_flsh);
		}

		//DropIcon
		fncDropAllIcon();

		//MakeIcon - Stop
		fncSetIconMain(i_Cnt
		             , 1
					 , document.getElementById("spn_f_kmlist_fparm_clat").innerHTML
					 , document.getElementById("spn_f_kmlist_fparm_clng").innerHTML
					 , document.getElementById("spn_f_kmlist_fparm_kmfkbn").innerHTML
					 , document.getElementById("spn_f_kmlist_fparm_magni").innerHTML);

		bln_show_flg = false;
		return true;
	} catch(ex) {
		bln_show_flg = false;
//alert("fncSetStopIcon:" + ex.description);
		return false;
	}
}

//
function fncDropAllIcon(){
	try {

		if (objMarkerAry == null){
			return true;
		} else if (objMarkerAry.length > 0) {
			try {
				objMap.clearOverlays();
			} catch(ex){}
			fnc_drop_all_move_icon();
		}

		return true;
	} catch(ex) {
		return false;
	}
}

//
function fnc_drop_all_move_icon(){
	try {
		if (objMarkerAry == null){
			return true;
		} else if (objMarkerAry.length > 0) {
			var obj_marker;
			var bln_remove_flg;
			for (i=0;i<objMarkerAry.length;i++){
				if (objMarkerAry[i] != null){
					fnc_drop_icon(i);
				}
				try {
					objMap.removeOverlay(objMarkerAry[i]);
				} catch (ex) {}
			}
		}
		return true;
	} catch(ex) {
		return false;
	}
}

//
function fnc_drop_icon(i_intIndex){
	try {
		if (objMap == null || objMarkerAry == null){
			return true;
		} else if (objMarkerAry.length > 0) {

			var obj_marker = document.getElementById(objMarkerAry[i_intIndex].obj_overlay_id);

			if (obj_marker != null){
				try {
					objMap.getPane(G_MAP_MARKER_PANE).removeChild(obj_marker);
				} catch (ex) { }
			}

			try {
				objMap.removeOverlay(objMarkerAry[i_intIndex]);
			} catch (ex) { }
		}
		return true;
	} catch(ex) {
		return false;
	}
}

//
function fncChkIconSet(i_formLatLng, i_ToLatLng){
	try {
		
		var distance = i_ToLatLng.distanceFrom(i_formLatLng);

		if (distance <= intFindArea) {
			return true;
		}
		else {
			return false;
		}

	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncGetFindCenter(i_intMode, i_strKeyword){
	try {

 		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {

				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);

					//Close
					fncCloseReFind();

					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					fncGetFindCenterRet(str_html)
		
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});
		
		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxGetFindCenter.php?t=' + objDate.getTime() 
			                                       + '&kid=' + escape(gkid, true) 
					  			                    + '&md=' + escape(i_intMode, true)
										            + '&kw=' + encodeURI(i_strKeyword)
													+ fncGetQ_RegNr());
			objXmlHttp.send(null);
		}

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncGetFindCenterRet(i_ret_text){
	try {
		
		//
		document.getElementById("div_parm").innerHTML = i_ret_text;

		var strRet = document.getElementById("div_f_ret").innerHTML;

		if (strRet == 'ok') {

			switch (document.getElementById("div_f_fkk").innerHTML){
				case '0':
//【住所検索】
					switch (document.getElementById("div_f_mlv").innerHTML){
						case '0':
//入力補助
							//
							fncAddressAssistant(document.getElementById("div_f_fwd").innerHTML
							                  , document.getElementById("div_f_fad").innerHTML
							                  , document.getElementById("div_f_fwd").innerHTML
							                  , gkid);
							break;

						case '1':
//地点検索開始

							//
							fnc_find_map_zoom(); 

							//
							fncFindKomutenCenterPointStart(document.getElementById("div_f_kid").innerHTML
							                             , document.getElementById("div_f_ido").innerHTML
							                             , document.getElementById("div_f_keido").innerHTML
														 ,0 ,"" );		
							break;
							
						default:
							//

//住所判定

							if (fncChkAddres(document.getElementById("div_f_fwd").innerHTML) == false){
								//住所エラー
								var str_kbn = "re" + new String(document.getElementById("div_f_fkk").innerHTML);
								fncOpenReFind(str_kbn, document.getElementById("div_f_fwd").innerHTML );
								
								return false;
								break;
							} 

							//
				   			var objGeocoder = new GClientGeocoder();
							objGeocoder.getLatLng(document.getElementById("div_f_fad").innerHTML, fncAddressGeo);
					}

					break;
				
				case '1':

					//
					fnc_find_map_zoom(); 

		   			var objGeocoder = new GClientGeocoder();

					//
					objGeocoder.getLatLng(document.getElementById("div_f_fad").innerHTML, fncGetGeoPoint );
					break;
				
				case '2':
//【工務店検索】

					//
					fnc_find_km_map_zoom(); 

					// 
					fncFindKomutenCenterPointStart(document.getElementById("div_f_kid").innerHTML
					                             , document.getElementById("div_f_ido").innerHTML
				               	                 , document.getElementById("div_f_keido").innerHTML
												 ,1 
												 ,document.getElementById("div_f_fwd").innerHTML);	

					break;
				default:
					break;
			}

		} else if (strRet.length > 0 ){
			fncOpenReFind(strRet, document.getElementById("div_f_fwd").innerHTML);
		}

		return true;
	} catch(ex) {
//alert("fncGetFindCenterRet:"+ex.description);
		return false;
	}
}


//再検索
function fncReFind(i_md){
try {
		var strKeywd = document.getElementById("txtarea_Search02").value;

		if (strKeywd.length > 0) {
			strKeywd = fncTrim(strKeywd);
		}
	
		if(strKeywd.length == 0) {
			alert('検索条件を入力してください。');
			return false;
		}			

		var intMode;

		switch(i_md){
			case 0:
				intMode = 0;
				break;
			case 1:
				intMode = 1;
				break;
			case 2:
				intMode = 2;
				break;
			default:
				return false;
		}

		fncGetFindCenter(intMode, strKeywd);

		return false;  //Not Submit
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//
function fncAddressAssistant(i_fwd, i_fad, i_fiad, i_kid){
	try {

 		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {

				if (fncChkReadyState(objXmlHttp) == true){

					fncCloseAssistant();

					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					//
					fncShowAssistant(str_html)
				}
			} catch(ex) {
				alert(ex.description);
			}
		});

		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxAddressAssistant.php?t=' + objDate.getTime() 
					  			                      + '&fwd=' + encodeURI(i_fwd)
					  			                      + '&fad=' + encodeURI(i_fad)
					  			                      + '&fiad=' + encodeURI(i_fiad)
										              + '&kid=' + escape(i_kid, true));
			objXmlHttp.send(null);
		}

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


// 住所入力補助
function fncShowAssistant(i_ret_text){
try {
		var retTex = i_ret_text;

		if (retTex == null || retTex.length < 2){
			if (document.getElementById("div_f_fwd") != null &&
			    document.getElementById("div_f_fwd").innerHTML.length > 0 ){
				//住所エラー
				fncOpenReFind("re0", document.getElementById("div_f_fwd").innerHTML );
			 }
			return false;
		}
		
		//
		var objDiv = document.createElement("div");
		objDiv.id='div_assistantin';
		objDiv.innerHTML = retTex;

		var objDiv_Ass = document.createElement("div");
		objDiv_Ass.id = "div_assistant";
		objDiv_Ass.className = "css_assistant";

		var int_width  = ASSI_W;
		var int_height = ASSI_H;

		objDiv_Ass.style.width = int_width + 'px';
		objDiv_Ass.style.height = int_height + 'px';
		objDiv_Ass.style.filter ='shadow(color=#000000,direction=135)';

		objDiv_Ass.style.left = fncGetMapCenterLeft(int_width) + "px";
		objDiv_Ass.style.top = fncGetMapCenterTop(int_height) + "px";
		
		objDiv_Ass.appendChild(objDiv);
		document.getElementById("left_Category").appendChild(objDiv_Ass);

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncAddresskensaku(i_id){
	try {

		var ccd = i_id.replace("a_assi_link_", "");
		var sken = "div_assi_kid_" + new String(ccd);
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);
					fncCloseAssistant();

					var str_html = fncGetHtmlText(objXmlHttp.responseText);
 					fncKensakuGeo(str_html)
		
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});
		
		if (objXmlHttp){
			objXmlHttp.open('GET','./rxKensakuGeo.php?t=' + objDate.getTime() 
			                                    + '&kbn=' + escape(1, true) 
			                                    + '&kid=' + escape(document.getElementById(sken).innerHTML, true) 
										  	    + '&ccd=' + escape(ccd, true)
											    + '&snm=' + encodeURI(document.getElementById(i_id).innerHTML) );
			objXmlHttp.send(null);

		}

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

function fncAddressGeo(iLatLng){
	try {
		var str_kbn = "re" + new String(document.getElementById("div_f_fkk").innerHTML);

		if (iLatLng == null || iLatLng == undefined){
			//エラーログ
			fncOpenReFind(str_kbn, document.getElementById("div_f_fwd").innerHTML );
			return false;
		}


		//検索ワード登録
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){
					var str_html = fncGetHtmlText(objXmlHttp.responseText);
					fncGetGeoPoint(iLatLng);			
				}
			} catch(ex) {
//alert(ex.description);
			}
		});
		
		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxFwl.php?t=' + objDate.getTime() 
			                             + '&flk=' + escape(str_kbn, true) 
			                           + '&flkid=' + escape(gkid, true) 
									    + '&flwd=' + encodeURI(document.getElementById("div_f_fwd").innerHTML));
			objXmlHttp.send(null);
		}

		return true;

	} catch(ex) {
//alert("fncAddressGeo:" + ex.description);
		return false;
	}	
}

//
function fncAddressGeoRet(i_ret_text){
	try {
		fncGetGeoPoint(objLatLng);
		objLatLng = null;
		return true;
	} catch(ex) {
//alert("fncAddressGeoRet:" + ex.description);
		return false;
	}	
}


//
function fncFindKenTop(i_id){
	try {
		var strKeywd;
		var intMode;

		switch(i_id){
			case 1:
				strKeywd = document.getElementById("txt_KeyWord001").value;
				intMode = 0;
				break;
			case 2:
				strKeywd = document.getElementById("txt_KeyWord002").value;
				intMode = 1;
				break;
			case 3:
				strKeywd = document.getElementById("txt_KeyWord003").value;
				intMode = 2;
				break;
			default:
				break;
		}

		if (strKeywd.length > 0) {
			strKeywd = fncTrim(strKeywd);
		}
		
		if(strKeywd.length == 0) {
			alert('検索条件を入力してください。');
			return false;
		}			

		if (intMode != 0 && intMode != 1 && intMode != 2 ){
			return false;
		}

		fncCloseAllWindow();
		fncGetFindCenter(intMode, strKeywd);

		return false;  //サブミットさせないため
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//Click
//Open
//
function fncClickListItem(i_id, i_No, i_kmid){
	try {
		fncShowListIcon(i_id, i_No, i_kmid);
		var objLatLng = new GLatLng(objMarkerAry[i_id].decLat, objMarkerAry[i_id].decLng);
		objMap.openInfoWindow(objLatLng, fncGetInfoHtml(i_id, i_No));
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//PageChg
//
function fncChgKListPage(i_page, i_st_page){
	try {
if (bln_show_flg == true){
	return false;	
}

		var f_kid = document.getElementById("spn_f_kmlist_fparm_kid").innerHTML;

		var f_clat = document.getElementById("spn_f_kmlist_fparm_clat").innerHTML;
		var f_clng = document.getElementById("spn_f_kmlist_fparm_clng").innerHTML;

		var f_swlat = document.getElementById("spn_f_kmlist_fparm_swlat").innerHTML;
		var f_swlng = document.getElementById("spn_f_kmlist_fparm_swlng").innerHTML;

		var f_nelat = document.getElementById("spn_f_kmlist_fparm_nelat").innerHTML;
		var f_nelng = document.getElementById("spn_f_kmlist_fparm_nelng").innerHTML;

		var f_kmfkbn = document.getElementById("spn_f_kmlist_fparm_kmfkbn").innerHTML;
		var f_kmfwd = document.getElementById("spn_f_kmlist_fparm_kmfwd").innerHTML;

		//MoveCenter
		fncMovePointLatLng(f_clat, f_clng);

		//指定した範囲内の工務店を検索する
		var objDate = new Date();

		var objXmlHttp = fncNewXHttp(function(){
			try {

				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);

					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					//
					fncRetFindKomuten(str_html);
		
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});

		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxFindKomutenRectRange.php?t=' + objDate.getTime() 
			                                              + '&kid=' + escape(f_kid, true) 
										  	             + '&clat=' + escape(f_clat, true)
										  	             + '&clng=' + escape(f_clng, true)
										                + '&swlat=' + escape(f_swlat, true)
										  	            + '&swlng=' + escape(f_swlng, true)
										  	            + '&nelat=' + escape(f_nelat, true)
										  	            + '&nelng=' + escape(f_nelng, true)
									  	                 + '&fkbn=' + escape(f_kmfkbn, true)
								  	                    + '&fword=' + encodeURI(f_kmfwd)
											  	          + '&pid=' + escape(i_page, true)
										  	              + '&stp=' + escape(i_st_page, true)
										  	              + '&dkb=' + escape(0, true)
										  	              + '&anm=' + escape(1, true));
			objXmlHttp.send(null);
		}
		
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//ListChg
//
function fncChgKojiList(){
	try {
		if (document.getElementById("wrap-right").innerHTML.indexOf("all-Number") >= 0){
			return true;
		}
		if (document.getElementById("div_klist_wk").innerHTML.length > 0 ){
			document.getElementById("wrap-right").innerHTML = document.getElementById("div_klist_wk").innerHTML; 
			document.getElementById("div_klist_wk").innerHTML = ""; 
		}
		if (document.getElementById("Right_Category") != null){
			document.getElementById("Right_Category").style.overflow = "";
		}
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncChgBkmkList(){
	try {
		if (document.getElementById("wrap-right").innerHTML.indexOf("all-Number") >= 0){
			if (document.getElementById("Right_Category") != null){
				document.getElementById("Right_Category").style.overflow = "hidden";
			}
			document.getElementById("div_klist_wk").innerHTML = document.getElementById("wrap-right").innerHTML; 
		}
		fncMakeBookmarkList();
		return true;
	} catch(ex) {
//alert("fncChgBkmkList" + ex.description);
		return false;
	}
}

//
function fncRegistMapBookmark(){
	try {
		//
		if (fncChkRegistMapBookmark() == false ){
			return false;
		}

//
		var obj_map_zi = new Object();
		var obj_map_zk = new Object();

		obj_map_zi.ary = new Array();
		obj_map_zk.ary = new Array();

		var obj_km = new Object();
		obj_km.ary = new Array();

		var obj_his = new Object();
		obj_his.ary = new Array();

		//地図のクッキー情報取得
		fncGetPointCookie(obj_map_zi, obj_map_zk);

		if (obj_map_zi.ary.length >= intMaxBkmarkCnt || obj_map_zk.ary.length >= intMaxBkmarkCnt){
			alert('地図のお気に入りは既に登録可能件数全て登録されています。不要なお気に入りデータを削除後、登録してください。');
			return false;
		}

		fncGetGeoReverce(objMap.getCenter().lat(), objMap.getCenter().lng());

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncChkRegistMapBookmark(){
	try {
		if (objMap == null || objMap == undefined){
			alert("地図が表示されていません。");
			return false;
		}

		if (fncChkCookieUse(true) == false ){
			return false;
		}
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncChkCookieUse(i_blnErrShow){
	try {
		  if(!navigator.cookieEnabled){
		  	if (i_blnErrShow == true) {
alert("この機能はクッキーが有効になっていない為、ご利用できません。");
			}
		    return false;
		  }
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncCookieRead(i_kword){
try {

		if(typeof(i_kword) == "undefined") {
			return "";
		}

		i_kword = i_kword + "=";
		o_ret = "";

		scookie = document.cookie + ";";
		start = scookie.indexOf(i_kword);  

		if (start != -1){ 
			end = scookie.indexOf(";", start);
			o_ret = unescape(scookie.substring(start + i_kword.length, end));
		}

		return o_ret;
	} catch(ex) {
//alert(ex.description);
		return "";
	}
}

//
function fncMakeBookmarkList(){
	try {
		var objDate = new Date();
		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){
					//
					fncLoodingOnOff(false);
					var str_html = fncGetHtmlText(objXmlHttp.responseText);
					//
					fncGetBookmark(str_html);
				} else {
					//Loading
					fncLoodingOnOff(true);
				}
			} catch(ex) {
//alert(ex.description);
				fncLoodingOnOff(false);
			}
		});

		if (objXmlHttp){
 			objXmlHttp.open('GET','./rxBookmark.php?t=' + objDate.getTime()
			                                      + fncGetQ_RegNr());
			objXmlHttp.send(null);
		}
		return true;
	} catch(ex) {
//alert("fncMakeBookmarkList" + ex.description);
		return false;
	}
}

//
function fncGetPointCookie(io_obj_zi, io_obj_zk){
	try {

		io_obj_zi.ary = new Array();
		io_obj_zk.ary = new Array();

		//位置情報のクッキー情報取得
		var wk_z;
		var bln_get_ary = false;

		wk_z = fncCookieRead("zi");

		if (wk_z.length > 0) {

			io_obj_zi.ary = wk_z.split(",");
			wk_z = fncCookieRead("zk");

			if (wk_z.length >= 0){

				io_obj_zk.ary = wk_z.split(",");

				if (io_obj_zi.ary.length == io_obj_zk.ary.length){
					bln_get_ary = true;
				}
			}
		}

		if (bln_get_ary == false){
			io_obj_zi.ary = new Array();
			io_obj_zk.ary = new Array();
			return false;
		}

		return true;

	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

function fncGetKmCookie(io_obj, i_p){
try {
		io_obj.ary = new Array();
			

		//位置情報のクッキー情報取得
		var wk_z;
		var bln_get_ary = false;

		if (i_p == 0) {
			wk_z = fncCookieRead("kmbk");
		} else if (i_p == 1){
			wk_z = fncCookieRead("kmhis");
		} else {
			return;
		}

		if (wk_z.length > 0) {
			io_obj.ary = wk_z.split(",");
			bln_get_ary = true;
		}

		if (bln_get_ary == false){
			io_obj.ary = new Array();
			return false;
		}

		return true;

	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

// 
function fncGetBookmark(i_ret_text){
	try {

		var retTex = i_ret_text;
		intSt = retTex.indexOf('<ul id="btn-Tab"');  

		if (intSt > -1) {

			var strOutText = retTex.substr(intSt, retTex.length - intSt);
			document.getElementById("wrap-right").innerHTML = strOutText;
			fncResize();
		}

		return true;
	} catch(ex) {
//alert("fncGetBookmark:" + ex.description);
		return false;
	}
}


//
function fncBookmarkKmAdd(i_id, i_p){
try {

		//クッキー情報登録
		var objDate = new Date();

		fncCloseInfoWin();
	
		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){

					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					//
					fncAddBookmarkRet(str_html);
				}
			} catch(ex) {
//alert(ex.description);
			}
		});
		
		if (objXmlHttp){
			objXmlHttp.open('GET','./rxAddBookmark.php?t=' + objDate.getTime() 
			                                    + '&kid=' + escape(gkid, true) 
			                                    + '&akey=' + escape(gkey, true) 
			                                    + '&bkid=' + escape(i_id, true) 
										         + '&i_p=' + escape(i_p, true));
			objXmlHttp.send(null);
		}
		
		return true;
	} catch(ex) {
//alert("fncBookmarkKmAdd:" + ex.description);
		return false;
	}
}

//
function fncAddBookmarkRet(i_ret_text){
try {
		var strRetStr = i_ret_text;

		if (strRetStr != undefined &&  strRetStr != null && strRetStr.length > 1){
//alert(strRetStr);
		}
		
		if (document.getElementById("ttl-Favorite") != null){
			fncChgBkmkList();
		}

		return true;
	} catch(ex) {
//alert("fncAddBookmarkRet:" + ex.description);
		return false;
	}
}

//
function fncShowMapBkmkPoint(i_la, i_lg){
try {
		//
		fncMovePointLatLng(i_la, i_lg);
		//
		fncFindKomutenCenterPointStart(gkid, i_la, i_lg ,0 ,"" );
		//
		fncChkMoveSubDomain();
		return true;
	} catch(ex) {
//alert("fncShowMapBkmkPoint:" + ex.description);
		return false;
	}
}


//
function fncShowMapBkmk(i_id, i_la, i_lg, i_kid){
try {
		//
		fncMovePointLatLng(i_la, i_lg);
		//
		fncFindKomutenCenterPointStart(i_kid, i_la, i_lg ,2 ,"");
		//
		fncChkMoveSubDomain();
		return true;
	} catch(ex) {
//alert("fncShowMapBkmk:" + ex.description);
		return false;
	}
}


//
function fncBookmarkMapAdd(i_la, i_ln, i_adrs, i_p){
try {
		//クッキー情報登録
		var objDate = new Date();
		fncCloseInfoWin();

		var objXmlHttp = fncNewXHttp(function(){
			try {
				if (fncChkReadyState(objXmlHttp) == true){
					var str_html = fncGetHtmlText(objXmlHttp.responseText);

					//
					fncAddBookmarkRet(str_html);
				}
			} catch(ex) {
//alert(ex.description);
			}
		});

		if (objXmlHttp){
			objXmlHttp.open('GET','./rxAddBookmark.php?t=' + objDate.getTime() 
			                                    + '&bla=' + escape(i_la, true) 
			                                    + '&bln=' + escape(i_ln, true) 
			                                    + '&i_p=' + escape(i_p, true) 
										       + '&badrs=' + encodeURI(i_adrs));
			objXmlHttp.send(null);
		}

		return true;
	} catch(ex) {
//alert("fncBookmarkMapAdd:" + ex.description);
		return false;
	}
}



//
function fncGetGeoReverce(i_la, i_ln){
try {
		var objDate = new Date();
		var objXmlHttp_bkmk = fncNewXHttp(function (){
			try {
				if (fncChkReadyState(objXmlHttp_bkmk) == true){
						//
						fncLoodingOnOff(false);

						var str_html = fncGetHtmlText(objXmlHttp_bkmk.responseText);

						//////
						fncGetGeoReverceRet(str_html);

					} else {
						//Loading
						fncLoodingOnOff(true);
					}
					return true;
				} catch(ex) {
//alert(ex.description);
					fncLoodingOnOff(false);
					return false;
			}				
		});

		if (objXmlHttp_bkmk){
			objXmlHttp_bkmk.open('GET','./rxGetGeoReverce.php?t=' + objDate.getTime() 
			                                       + '&grla=' + escape(i_la, true) 
			                                       + '&grln=' + escape(i_ln, true)
												   + fncGetQ_RegNr());
			objXmlHttp_bkmk.send(null);
		}

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncGetGeoReverceRet(i_ret_text){
try {
		var retTex = i_ret_text;
		var aryRet = new Array();
	
		aryRet = retTex.split(",");

		var str_ret;
		var num_la;
		var num_lg;
		var str_adrs;

		var intIndexOfRet;
		var strFindStr;

		for (i=0; i<aryRet.length; i++){

			strFindStr = "ret:";
			intIndexOfRet = aryRet[i].indexOf(strFindStr);

			if (intIndexOfRet >= 0){

				if (aryRet[i].length > strFindStr.length) {
					str_ret = aryRet[i].substr(strFindStr.length + 1);
				}
			
				if (str_ret != "ok"){
//						return false
				}
				
			} else {

				strFindStr ="grla:";
				intIndexOfRet = aryRet[i].indexOf(strFindStr);
				
				if (intIndexOfRet >= 0){
					if (aryRet[i].length > strFindStr.length) {
						num_la = aryRet[i].substr(strFindStr.length );
					}
					
				} else {

					strFindStr ="grln:";
					intIndexOfRet = aryRet[i].indexOf(strFindStr);
					
					if (intIndexOfRet >= 0){
						if (aryRet[i].length > strFindStr.length) {
							num_lg = aryRet[i].substr(strFindStr.length);
						}
	
						
					} else {
	
						strFindStr ="gradrs:";
						intIndexOfRet = aryRet[i].indexOf(strFindStr);
						
						if (intIndexOfRet >= 0){
							if (aryRet[i].length > strFindStr.length) {
								str_adrs = aryRet[i].substr(strFindStr.length);
							}
						}
					}
				}
			}
		} 

		fncOpenBookmarkRegist(num_la, num_lg, str_adrs, 0);
		
		return true;
	} catch(ex) {
//alert(ex.description);
		fncLoodingOnOff(false);
		return false;
	}	
}


//
function fncMoveDetail(i_id, i_ino){
try {
		gfnc_checkResize(objMap);
	
		document.getElementById("hdnkm").value = i_id;
		document.getElementById("hdnno").value = i_ino;
		document.getElementById("hdnkey").value = gkey;
		document.getElementById("hdnkid").value = gkid;

		document.getElementById("hdnlat").value = objMap.getCenter().lat();
		document.getElementById("hdnlng").value = objMap.getCenter().lng();
		document.getElementById("hdnlv").value = objMap.getZoom();

		fncSetFdata();

		document.frmMove.target = "_self";
		document.frmMove.method = "post";
		document.frmMove.action = "./map02_up.php?kmid=" + i_id;

		document.frmMove.submit();

		return true;
	} catch(ex) {
//alert("fncMoveDetail:" + ex.description);
		return false;
	}		
}

//
function fncSelectListItem(i_intIndex, i_strNo, i_kmid, i_objItem, ik, im){
try {
		
		if (i_objItem == null){
			return false;
		}	

		var strFindStr1 = "";
		var strRepStr2 = "";

		if (ik == 0){
			fncSelectItemOff(i_objItem);

			strFindStr1 = "/move/";
			strRepStr2 = "/stop/";
			
		} else if (ik == 1){
			fncSelectItemOn(i_objItem);

			strFindStr1 = "/stop/";
			strRepStr2 = "/move/";
		}

		if (bln_show_flg == true){
			return false;
		}

		if (objMarkerAry == null){
			return false;
		} else if (objMarkerAry.length <= 0) {
			return false;
		}

		var dec_cido = document.getElementById("spn_f_kmlist_fparm_clat").innerHTML;
		var dec_ckeido = document.getElementById("spn_f_kmlist_fparm_clng").innerHTML;

		var dec_ido = objMarkerAry[i_intIndex].decLat;
		var dec_keido = objMarkerAry[i_intIndex].decLng;

		var retAddFlg = fncChkIconSet(new GLatLng(dec_cido, dec_ckeido), new GLatLng(dec_ido, dec_keido));

		if (retAddFlg == false && objMarkerAry[i_intIndex].blnView == false){
			return false;
		}

		try{
			if (strFindStr1.length > 0 && strRepStr2.length > 0){
				var str_img_wk = objIconAry[i_intIndex].image;
				var str_img_wk_rep = objIconAry[i_intIndex].image;
				str_img_wk_rep = str_img_wk_rep.replace(strFindStr1, strRepStr2);
				if (str_img_wk ==  str_img_wk_rep){
					return true;
				}
			}
		} catch(ex){}
		
		objPoint = new GLatLng(dec_ido, dec_keido);

		fnc_drop_icon(i_intIndex);
		
		retAddFlg = true;
		
		var retBool;
		retBool = fncSetIcon(i_intIndex, i_strNo, im);
		retBool = fncSetMarker(i_intIndex, i_strNo, i_kmid, objPoint, im, dec_ido, dec_keido, objMarkerAry[i_intIndex].strTitle, retAddFlg);
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncShowListIcon(i_intIndex, i_strNo, i_kmid){
try {
		if (objMarkerAry == null){
			return false;
		} else if (objMarkerAry.length <= 0) {
			return false;
		}

//		if ( objMarkerAry[i_intIndex].blnView == true){
//			return true;
//		}

		var dec_cido = document.getElementById("spn_f_kmlist_fparm_clat").innerHTML;
		var dec_ckeido = document.getElementById("spn_f_kmlist_fparm_clng").innerHTML;

		var dec_ido = objMarkerAry[i_intIndex].decLat;
		var dec_keido = objMarkerAry[i_intIndex].decLng;

		fnc_drop_icon(i_intIndex);

		objPoint = new GLatLng(dec_ido, dec_keido);

		var retBool;
		var int_mode = 2;
		retBool = fncSetIcon(i_intIndex, i_strNo, int_mode);

		retBool = fncSetMarker(i_intIndex, i_strNo, i_kmid, objPoint, int_mode, dec_ido, dec_keido, objMarkerAry[i_intIndex].strTitle, true);
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//
function fncSetKmids(){
	try {

		document.getElementById("hdnKmids").value = "";
		document.getElementById("hdnKmvs").value = "";
		
		if (objMarkerAry == null || objMarkerAry.length == 0){
			return true	;
		}

		var strKmids = '';
		var strKmvs = '';

		for (i=0; i<objMarkerAry.length ; i++){

			if (i > 0){
				strKmids += ",";
				strKmvs +=",";
			}

			if (objMarkerAry[i].blnView == true){
				strKmvs +="1";
			} else{
				strKmvs +="0";
			}
			strKmids += objMarkerAry[i].strKmid;
		}

		document.getElementById("hdnKmids").value = strKmids;
		document.getElementById("hdnKmvs").value = strKmvs;

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//
function fncChkMoveSubDomainRet(i_ret_text){
	try {
			document.getElementById("div_parm").innerHTML = i_ret_text;
			var strRet = document.getElementById("div_f_ret").innerHTML;
			if (strRet == 'ok') {
			} else if (strRet == 'chgdm'){
				if (document.getElementById("div_f_sp") == null){
					return false;
				}

				//
				fncOpenInfo_JumpMsg(document.getElementById("div_f_sp").innerHTML);
			} 
		return true;
	} catch(ex) {
//alert("fncChkMoveSubDomainRet:" + ex.description);
		return false;
	}
}


//
function fncOpneInfo(i_html, i_w, i_h){
try {
		var objDivMap = document.getElementById("div_info")
		if (objDivMap != null) {
			fncCloseInfoWin();
		}

		fncCloseAllWindow();

		var objDiv = document.createElement("div");

		objDiv.id='div_infoin';
		objDiv.innerHTML = i_html;
		objDiv.className = "css_info_in";

		objDivMap = document.createElement("div");

		objDivMap.id = "div_info";
		objDivMap.className = "css_info";

		objDivMap.style.width = i_w + 2 + 'px';
		objDivMap.style.height = i_h + 2 + 'px';

		objDivMap.style.left = fncGetMapCenterLeft(i_w) + "px";
		objDivMap.style.top = fncGetMapCenterTop(i_h) + "px";

		objDivMap.appendChild(objDiv);
		document.getElementById("left_Category").appendChild(objDivMap);

		return true;
	} catch(ex) {
//alert("fncOpneInfo:" + ex.description);
		return false;
	}
}


//
function fncOpenBookmarkRegist(i_la, i_lg, i_adrs, i_kbn){
try {
		var int_width  = BKMRKINFO_W;
		var int_height = BKMRKINFO_H;
		
		var strFukin = "付近";
		if (i_adrs.length > 0 && i_adrs.indexOf("不明") > -1 ){
			strFukin = "";
		}

		var int_left = 115;

		if (fnc_chk_msie6() == true){
			int_left = 55;
		}
	
		var str_html = '<div class="wrap-Popup03" style="background-Color :#f2ffc6;width:'+int_width+'px;height:'+int_height+'px;">'
		                 + '<h3 id="ttl_Favo">'
 	                 	 + '<img src="img/icon_favo01.gif" border="0" align="left" />'
			                 + '<a href="javascript:void(0);" onClick="javascript:fncCloseInfoWin();return false;">'
				                 + '<img src="img/close_favo.gif" alt="閉じる" width="9" height="11" border="0" align="right" />'
			                 + '</a>'
		                 + '　お気に入りの追加（地図）'
		                 + '</h3>'

		                 + '<br/>'
		                 + '<p >'
						 + '<div class="css_info_item_lbl">'
		                 + '住所：'
		         	     + '</div>'
						 + '<div id="div_map_bkmark_b_adrs" class="css_info_item_addres">'
		                 + i_adrs
		         	     + '</div>'
						 + '<div id="div_map_bkmark_b_adrs_lbl" class="css_info_item_fukin">'
		                 + strFukin
		         	     + '</div>'
		                 + '</p>'

		                 + '<br/>'
		                 + '<p  >'
						 + '<div id="div_map_bkmark_b_la" class="css_all_hidden_item">'
		                 + i_la
		         	     + '</div>'
						 + '<div id="div_map_bkmark_b_lg" class="css_all_hidden_item">'
		                 + i_lg
		         	     + '</div>'
		                 + '</p>'

		                 + '<br/>'
		                 + '<div class="css_info_window_btn_frame">'
		                 + '<div class="css_info_window_btn" onClick="fncBookmarkMapAdd(document.getElementById(\'div_map_bkmark_b_la\').innerHTML, document.getElementById(\'div_map_bkmark_b_lg\').innerHTML, document.getElementById(\'div_map_bkmark_b_adrs\').innerHTML, 0);" style="margin-left: ' + int_left + 'px;" >登録</div>'
		                 + '<div class="css_info_window_btn" onClick="javascript:fncCloseInfoWin();" style="margin-left: 35px;" >取消</div>'
		                 + '</div>'
					     + '</div>';

		fncOpneInfo(str_html, int_width, int_height);

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}


//
function fncOpenBookmarkKmRegist(i_id, i_kmnm, i_kmadd, i_kmtel, i_kbn){
try {
		if (fncChkKmBookmark(i_id, i_kmnm, i_kmadd, i_kmtel, i_kbn, 0) == false){
			return false;
		}
		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}
}

//
function fncChkKmBkRegist(i_id){
try {
		if (fncChkCookieUse(false) == false ){
			return false;
		}
	
		var strRet = '';
		strRet = fncCookieRead("kmbk");

		if (strRet.indexOf(i_id) > -1){
			return true;
		}

		return false;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}


//
function fncMagniView(i_magni_kbn, i_clat, i_clng, i_plat, i_plng){
try {
		if (i_magni_kbn != "1") {
			return true;
		}	
		
		var clat = parseFloat(i_clat);
		var clng = parseFloat(i_clng);

		var plat2 = parseFloat(i_plat);
		var plng2 = parseFloat(i_plng);

		var dlat = clat - plat2;
		var dlng = clng - plng2;

		var plat1 = clat + dlat;
		var plng1 = clng + dlng;

		var objP1 = new GLatLng(plat1
		                        ,plng1);

		var objP2 = new GLatLng(plat2
		                        ,plng2);

		var objBound=new GLatLngBounds(objP1, objP2);

		intLv = objMap.getBoundsZoomLevel(objBound);

		objMap.setZoom(intLv);

		var objBound = objMap.getBounds();

		fncOpenMagniMsg();

		var int_interval = 5000;
		setTimeout("fncCloseInfoWin()", int_interval);

		setTimeout("fncOpenMoveInfo(1)", int_interval);


		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//
function fncOpenMagniMsg(){
try {
		var int_width = NOTFOUND_W;
		var int_height = NOTFOUND_H;

		var str_html = '<div class="wrap-Popup03" style="background-Color :#f2ffc6;width:'+int_width+'px;height:'+int_height+'px;">'
							 + '<div id="div_km_bkmark_b_nm" class="css_info_item_msg" style="margin-left:10px">'
			                 + 'お探しのエリアにリフォーム工事店がありませんでしたので'
			         	     + '</div>'
			                 + '<br/>'
			                 + '<br/>'
							 + '<div id="div_km_bkmark_b_nm" class="css_info_item_msg" style="margin-left:10px">'
			                 + '検索エリアを拡大して結果を表示しました。'
			         	     + '</div>'
			                 + '<br/>'
					 + '</div>';

		fncOpneInfo(str_html, int_width, int_height);

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}

//						
function fncExeFnc(){
try{
		var objFnc = document.getElementById("hdnfncName");
		if (objFnc == null){
			return false;
		}
		if (objFnc.value.length == 0){
			return false;
		}

		fncCallBack();
		
		objFnc.value = '';

		return true	;
	} catch(ex) {
//alert("fncExeFnc:"+ex.description);
		return false;
	}
}

//
function fncShutter(){
try{

		var  obj_r_div = document.getElementById("wrap-right");
		if (obj_r_div == null){
			return false;
		}

		var bln_shutter = false;

		if (obj_r_div.style.visibility != "hidden"){
			bln_shutter = true;
		}

		var  obj_map_div = document.getElementById("left_Category");
		var  obj_c_div = document.getElementById("Center_Category");
		var  obj_menu_div = document.getElementById("menu_Category");

		if (obj_map_div == null || obj_c_div == null || obj_menu_div == null){
			return false;
		}

		var int_r_w = RIGHT_W;

		var int_map_w = parseInt(obj_map_div.style.width);
		var int_menu_w = parseInt(obj_menu_div.style.width);

		var int_chg_map_w;
		var int_chg_menu_w;

		if (bln_shutter == true){

			obj_r_div.style.right = "0px";
			obj_c_div.style.right = int_r_w  + "px";

			int_chg_map_w = int_map_w + int_r_w;
			int_chg_menu_w = int_menu_w + int_r_w;

			obj_t_open = setInterval("fncShutter_open("+ int_chg_map_w + "," + int_chg_menu_w + ")", 1);

		} else {

			obj_r_div.style.right = - int_r_w + "px";
			obj_c_div.style.right = 0 + "px";

			int_chg_map_w = int_map_w - int_r_w;
			int_chg_menu_w = int_menu_w - int_r_w;

			obj_t_close = setInterval("fncShutter_close("+ int_chg_map_w + "," + int_chg_menu_w + ")", 1);
		}
		return true	;
	} catch(ex) {
//alert("fncShutter:"+ex.description);
		return false;
	}
}

//
function fncShutter_open(i_map_w, i_menu_w){
	try{

		var  obj_r_div = document.getElementById("wrap-right");
		var  obj_map_div = document.getElementById("left_Category");
		var  obj_c_div = document.getElementById("Center_Category");
		var  obj_menu_div = document.getElementById("menu_Category");

		var int_r_r_wk;
		var int_map_w_wk;
		var int_menu_w_wk;
		var int_c_r_wk;

//
		int_r_r_wk = parseInt(obj_r_div.style.right);
		int_r_r_wk -= int_shut_speed;
		obj_r_div.style.right = int_r_r_wk + "px";

//
		int_map_w_wk = parseInt(obj_map_div.style.width);
		int_map_w_wk += int_shut_speed;
		obj_map_div.style.width = int_map_w_wk + "px";

//
		int_menu_w_wk = parseInt(obj_menu_div.style.width);
		int_menu_w_wk += int_shut_speed;
		obj_menu_div.style.width = int_menu_w_wk +"px";

//
		int_c_r_wk = parseInt(obj_c_div.style.right);
		int_c_r_wk -= int_shut_speed;
		obj_c_div.style.right = int_c_r_wk  + "px";

//
		var int_map_w_now = parseInt(obj_map_div.style.width);
		if (int_map_w_now >= i_map_w){
			clearInterval(obj_t_open);
	
			obj_r_div.style.visibility = "hidden";
			obj_r_div.style.position = "absolute";
			obj_r_div.style.left = "0px";
			obj_r_div.style.top = "0px";
	
			obj_menu_div.style.width = i_menu_w + "px";
			obj_map_div.style.width = i_map_w + "px";
			obj_c_div.style.right = "0px";

			fncShowCenterIcon(true);
		}

		return true	;
	} catch(ex) {
//alert("fncShutter_open:"+ex.description);
		return false;
	}	
}

//
function fncShutter_close(i_map_w, i_menu_w){
try{
		var  obj_r_div = document.getElementById("wrap-right");
		var  obj_map_div = document.getElementById("left_Category");
		var  obj_c_div = document.getElementById("Center_Category");
		var  obj_menu_div = document.getElementById("menu_Category");

		var int_r_r_wk;
		var int_map_w_wk;
		var int_menu_w_wk;
		var int_c_r_wk;

//
		int_r_r_wk = parseInt(obj_r_div.style.right);
		int_r_r_wk += int_shut_speed;
		obj_r_div.style.right = int_r_r_wk + "px";

//
		int_map_w_wk = parseInt(obj_map_div.style.width);
		int_map_w_wk -= int_shut_speed;
		obj_map_div.style.width = int_map_w_wk + "px";

//
		int_menu_w_wk = parseInt(obj_menu_div.style.width);
		int_menu_w_wk -= int_shut_speed;
		obj_menu_div.style.width = int_menu_w_wk +"px";

//
		int_c_r_wk = parseInt(obj_c_div.style.right);
		int_c_r_wk += int_shut_speed;
		obj_c_div.style.right = int_c_r_wk  + "px"

		obj_r_div.style.position = "";
		obj_r_div.style.left = "";
		obj_r_div.style.top = "";
		obj_r_div.style.visibility = "";

//
		var int_map_w_now = parseInt(obj_map_div.style.width);

		if (int_map_w_now <= i_map_w){
			clearInterval(obj_t_close);
	
			obj_r_div.style.visibility = "";
			obj_r_div.style.position = "";
			obj_r_div.style.left = "";
			obj_r_div.style.top = "";
			obj_r_div.style.right = ""

			obj_menu_div.style.width = i_menu_w  + "px";
			obj_map_div.style.width = i_map_w + "px";
			obj_c_div.style.right = "";

			fncShowCenterIcon(true);
		}

		return true	;
	} catch(ex) {
//alert("fncShutter_open:"+ex.description);
		return false;
	}	
}


//
function fncShutter_resize(){
	try{

		if (objMap != null && objMap != undefined) {
			objMap.checkResize();
		}

		var  obj_r_div = document.getElementById("wrap-right");
		if (obj_r_div == null){
			return false;
		}

		var bln_shutter = false;
		if (obj_r_div.style.visibility != "hidden"){
			return false;
		}


		var  obj_map_div = document.getElementById("left_Category");
		var  obj_c_div = document.getElementById("Center_Category");
		var  obj_menu_div = document.getElementById("menu_Category");

		if (obj_map_div == null || obj_c_div == null || obj_menu_div == null){
			return false;
		}

		var int_r_w = RIGHT_W;
		var int_map_w = parseInt(obj_map_div.style.width);
		var int_menu_w = parseInt(obj_menu_div.style.width);

		obj_r_div.style.visibility = "hidden";
		obj_r_div.style.position = "absolute";
		obj_r_div.style.left = "0px";
		obj_r_div.style.top = "0px";
		obj_r_div.style.right = "";

		obj_menu_div.style.width = int_menu_w + int_r_w + "px";
		obj_map_div.style.width = int_map_w + int_r_w + "px";
		obj_c_div.style.right = "0px";

		return true	;
	} catch(ex) {
//alert("fncShutter_resize:"+ex.description);
		return false;
	}
}

//
function fncOpenMoveInfo(i_kbn){
try {
		var objDivMap = document.getElementById("div_move_info");
		if (objDivMap != null){
			return false;
		}

		var i_w = MOVEINFO_W;
		var i_h = MOVEINFO_H;

		var objDiv = document.createElement("div");

		objDiv.id='div_move_info_in';
		objDiv.className = "css_move_info_in";
		objDiv.innerHTML = fncGetHtml_move_info(i_w, i_h, i_kbn);

		objDivMap = document.createElement("div");

		objDivMap.id = "div_move_info";
		objDivMap.className = "css_move_info";

		objDivMap.style.width = i_w +2  + 'px';
		objDivMap.style.height = i_h +2  + 'px';

		objDivMap.style.left = fncGetMapCenterLeft(i_w) + "px";
		objDivMap.style.top = fncGetMapCenterTop(i_h) + "px";

		objDivMap.appendChild(objDiv);

		document.getElementById("left_Category").appendChild(objDivMap);

		return true;

	} catch(ex) {
//alert("fncMovePoint:" + ex.description);
		return false;
	}	
}

//
function fncGetHtml_move_info(i_width, i_height, i_kbn){
try {
		var str_html = "";

		var int_left = 145;

		if (fnc_chk_msie6() == true){
			int_left = 125;
		}

		var str_msg1 = '地図が移動しました。';
		var str_msg2 = '表示されている範囲内でリフォーム工事店を再検索しますか？';

		var str_btn_lbl1 = '再検索';
		var str_btn_lbl2 = '保留';


		if (isNaN(i_kbn) == false && i_kbn == 1){
			str_msg1 = 'お探しのエリアに一番近い工事店のみ1件表示しました。';
			str_msg2 = '表示されている地図内の工事店をすべて表示しますか？';
	
			str_btn_lbl1 = 'はい';
			str_btn_lbl2 = 'いいえ';
		}


		str_html = '<div class="css_move_info_frame" id="div_move_info_frame" style="width:' + i_width  + 'px;height:' + i_height + 'px;">'
						 + '<div id="div_move_info_datail" class="css_move_info_datail" >'
			                 + '<h3 id="ttl_Favo">'
				                 + '<a href="javascript:void(0);" onClick="fncClosingMinMoveInfo();return false;">'
					                 + '<img src="img/close_favo.gif" alt="保留" width="9" height="11" border="0" align="right" />'
				                 + '</a>'
			                 + '再検索'
			                 + '</h3>'
			         	     + '<div>'
							 + '<div class="css_move_info_item_lbl">'
			                 + str_msg1
			         	     + '</div>'
			         	     + '</div>'
			                 + '<br/>'
			         	     + '<div>'
							 + '<div class="css_move_info_item_lbl" >'
			                 + str_msg2
			         	     + '</div>'
			         	     + '</div>'
	
			                 + '<br/>'
			                 + '<br/>'

			         	     + '<div>'
		                 	 + '<div class="css_info_window_btn_frame" style="padding-top:5px;">'

				                 + '<div class="css_move_info_btn" style="margin-left: ' + int_left + 'px;" onClick="fncReFindCenter();return false;" >'
				                 	+ str_btn_lbl1
				                 + '</div>'

				                 + '<div class="css_move_info_btn" style="margin-left: 225px;" onClick="fncClosingMinMoveInfo();return false;" >'
				                 	+ str_btn_lbl2
				                 + '</div>'

		                 	+ '</div>'
		         	     + '</div>'


		         	     + '</div>'
						 + '<div id="div_move_info_mini" class="css_dmove_info_mini" >'
			                 + '<div class="css_move_info_btn_refind" onClick="fncMaxMoveInfo();return false;" >再検索</div>'
		         	     + '</div>'
				  + '</div>';

		return str_html;

	} catch(ex) {
//alert("fncGetHtml_move_info:" + ex.description);
		return "";
	}	
}

//
function fncReFindCenter(){
try {
		if (objMap == null){
			return false;
		} 

		fncCloseMoveInfo();
		fncFindKomutenCenterPointStart(gkid
		                             , objMap.getCenter().lat()
	               	                 , objMap.getCenter().lng()
									 ,0 
									 ,"" );

		return true;
	} catch(ex) {
//alert("fncReFindCenter:" + ex.description);
		return false;
	}
}

//
function fncClosingMinMoveInfo(){
try {
		var int_speed = 5;

		if (objMap == null){
			return false;
		}

		var objDivMap = document.getElementById("div_move_info");

		if (objDivMap == null){
			return false;
		}
		var int_top = parseInt(objDivMap.style.top);
		var int_left = parseInt(objDivMap.style.left);
		var int_width = parseInt(objDivMap.style.width);

		var int_map_width = objMap.getSize().width;
		var int_ary_cnt = 10;

		var ary_top = new Array(int_ary_cnt - 1);
		var ary_left = new Array(int_ary_cnt - 1);

		var flt_k = parseFloat(1 / int_ary_cnt);

		for (i = 0; i < int_ary_cnt; i++) {
			ary_top[i] = parseInt(int_top * parseFloat(1 - parseFloat(flt_k * i)));
			ary_left[i] = parseInt((int_map_width - int_left - int_width) * parseFloat(flt_k * i) + int_left);
			
			if (int_map_width > int_width) {
				if (ary_left[i] > int_map_width - int_width) {
					ary_left[i] = int_map_width - int_width;
				}
			}
			else {
				int_left_wk = 0;
			}
		}

		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[0] + "," + ary_left[0] + ")", 1 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[1] + "," + ary_left[1] + ")", 2 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[2] + "," + ary_left[2] + ")", 3 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[3] + "," + ary_left[3] + ")", 4 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[4] + "," + ary_left[4] + ")", 5 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[5] + "," + ary_left[5] + ")", 6 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[6] + "," + ary_left[6] + ")", 7 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[7] + "," + ary_left[7] + ")", 8 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[8] + "," + ary_left[8] + ")", 9 * int_speed);
		setTimeout("fncSetMoveInfoTopLeft("+ ary_top[9] + "," + ary_left[9] + ")", 10 * int_speed);

		setTimeout("fncMinMoveInfo()", 11 * int_speed);

		return true;

	} catch(ex) {
//alert("fncClosingMinMoveInfo:" + ex.description);
		return false;
	}
}

//
function fncSetMoveInfoTopLeft(i_top, i_left){
try {	
		var objDivMap = document.getElementById("div_move_info");

		if (objDivMap == null){
			return false;
		}

		objDivMap.style.top = i_top + "px";
		objDivMap.style.left = i_left + "px";

		return true;

	} catch(ex) {
//alert("fncSetMoveInfoTopLeft:" + ex.description);
		return false;
	}
}

//
function fncMinMoveInfo(){
try {
		var int_min_w = 57;
		var int_min_h = 24;

		var objDivMap = document.getElementById("div_move_info");

		if (objDivMap == null){
			return false;
		}

		var objDivMapIn = document.getElementById("div_move_info_in");

		if (objDivMapIn == null){
			return false;
		}

		var objDivFrame = document.getElementById("div_move_info_frame");
		if (objDivFrame == null){
			return false;
		}
		

		var objDiv = document.getElementById("div_move_info_datail");
		if (objDiv == null){
			return false;
		}

		var objDivMin = document.getElementById("div_move_info_mini");
		if (objDivMin == null){
			return false;
		}

		objDivMap.style.height = int_min_h + "px";
		objDivMap.style.width = int_min_w + "px";
		objDivMap.style.top = "0px";
		objDivMap.style.left = "";
		objDivMap.style.right = "0px";

		objDivFrame.style.position = "absolute";
		objDivFrame.style.top = "0px";
		objDivFrame.style.left = "";
		objDivFrame.style.right = "0px";
		objDivFrame.style.height = int_min_h + "px";
		objDivFrame.style.width = int_min_w + "px";

		objDiv.style.position = "absolute";
		objDiv.style.top = "0px";
		objDiv.style.left = "0px";
		objDiv.style.height = "0px";
		objDiv.style.width = "0px";
		objDiv.style.visibility = "hidden";
		
		objDivMin.style.height = int_min_h + "px";
		objDivMin.style.width = int_min_w + "px";
		objDivMin.style.visibility = "visible";

		return true;
	} catch(ex) {
//alert("fncMinMoveInfo:" + ex.description);
		return false;
	}
}


//
function fncMaxMoveInfo(){
try {
		var int_max_w = MOVEINFO_W;
		var int_max_h = MOVEINFO_H;

		var objDivMap = document.getElementById("div_move_info");

		if (objDivMap == null){
			return false;
		}

		var objDivMapIn = document.getElementById("div_move_info_in");

		if (objDivMapIn == null){
			return false;
		}

		var objDivFrame = document.getElementById("div_move_info_frame");
		if (objDivFrame == null){
			return false;
		}
		

		var objDiv = document.getElementById("div_move_info_datail");

		if (objDiv == null){
			return false;
		}

		var objDivMin = document.getElementById("div_move_info_mini");

		if (objDivMin == null){
			return false;
		}
		
		objDivMap.style.height = int_max_h + 2 + "px";
		objDivMap.style.width = int_max_w + 2 + "px";

		objDivMap.style.right = "";

		objDivMap.style.top = fncGetMapCenterTop(int_max_h) + "px";
		objDivMap.style.left = fncGetMapCenterLeft(int_max_w) + "px";

		objDivFrame.style.position = "";
		objDivFrame.style.top = "";
		objDivFrame.style.left = "";
		objDivFrame.style.right = "";
		objDivFrame.style.height = int_max_h + "px";
		objDivFrame.style.width = int_max_w + "px";

		objDiv.style.position = "";
		objDiv.style.top = "";
		objDiv.style.left = "";
		objDiv.style.height = "";
		objDiv.style.width = "";
		objDiv.style.visibility = "";
		
		objDivMin.style.height = "";
		objDivMin.style.width = "";
		objDivMin.style.visibility = "";

		return true;

	} catch(ex) {
//alert("fncMinMoveInfo:" + ex.description);
		return false;
	}
}

//
function fncChkShowKm(){
try {
		var intIconCnt;

		if (document.getElementById("div_list_cnt") == null || 
		    document.getElementById("div_list_cnt") == null){
			return false;
		}

		if (isNaN(document.getElementById("div_list_cnt").innerHTML) == true) {
			//Not Data
			return false;
		}

		intIconCnt = parseInt(document.getElementById("div_list_cnt").innerHTML);

		if (intIconCnt > 0){
			return true;
		}

		return false;

	} catch(ex) {
//alert("fncChkShowKm:" + ex.description);
		return false;
	}	
}


//
function  fncOpenInfo_JumpMsg(i_str_jump_url){
try {
		var int_width = JUMPMSG_W;
		var int_height = JUMPMSG_H;

		var str_html = '<div class="css_info_jump_msg_frame" id="div_info_jump_msg_frame"  style="width:'+ parseInt(int_width -10) +'px;height:'+int_height+'px;">'
							 + '<div id="div_info_item_jump_msg" class="css_info_item_jump_msg">'
			                 + 'お探しの都道府県エリア外に移動しました。'
			                 + '<br/>'
			                 + '<br/>'
			                 + '都道府県エリアを変更します。しばらくお待ちください。'
			         	     + '</div>'
					 + '</div>';

		if (objMap == null){
			return false;
		}

		var str_jump_url = i_str_jump_url;
		var objDate = new Date();

		
		str_jump_url += "?t=" + objDate.getTime() 
 					 + "&lat=" + objMap.getCenter().lat()
 					 + "&lng=" + objMap.getCenter().lng()
 					 + "&l=" + objMap.getZoom();

		fncOpneInfo(str_html, int_width + 2, int_height + 2);

		setTimeout("fncJump_other_domain('" + str_jump_url + "')", 5000);

		return false;
	} catch(ex) {
//alert("fncOpenInfo_JumpMsg:" + ex.description);
		return false;
	}	
}

//
function  fncJump_other_domain(i_str_jump_url){
try {
		fncCloseInfoWin();
		document.location = i_str_jump_url;
		return true;
	} catch(ex) {
//alert("fncJump_other_domain:" + ex.description);
		return false;
	}	
}

//
function  fncBackMovePointLatLng(i_str_latlng){
try {
		if (i_str_latlng == null || i_str_latlng.length == 0){
			return false;
		}

		var ary_parm = i_str_latlng.split(",");
		if (ary_parm.length != 3){
			return false;
		}

		fncCloseKenTop();
		fncFindKomutenCenterPointStart(gkid, ary_parm[1], ary_parm[2] , 0 , "");

		return true;
	} catch(ex) {
//alert("fncBackMovePointLatLng:" + ex.description);
		return false;
	}	
}

//
function  fncBackMovePointLatLngFind(i_str_latlng){
try {
		if (i_str_latlng == null || i_str_latlng.length == 0){
			return false;
		}

		var ary_parm = i_str_latlng.split(",");
		if (ary_parm.length < 5){
			return false;
		}
		fncCloseKenTop();
		fncFindKomutenCenterPointStart(gkid, ary_parm[1], ary_parm[2] , ary_parm[3] , ary_parm[4]);

		return true;

	} catch(ex) {
//alert("fncBackMovePointLatLng:" + ex.description);
		return false;
	}	
}

//
function fncMoveMapInfoShow(i_id){
try {
		if (objMarkerAry[i_id] == null){
			return false;
		}

		var dec_set_lat = objMarkerAry[i_id].decLat;
		var dec_set_lng = objMarkerAry[i_id].decLng;
		
		var dec_icon_lat = objMarkerAry[i_id].decLat;
		
		//
		var rectObj = gfnc_getBounds(objMap);

		var objLatLng_SW = rectObj.getSouthWest();
		var objLat_SW = objLatLng_SW.lat();

		var objLatLng_NE = rectObj.getNorthEast();
		var objLat_NE = objLatLng_NE.lat();

		var dec_lat_wk = objLat_NE - objLat_SW;

		dec_set_lat = parseFloat(dec_icon_lat) + parseFloat(dec_lat_wk * 0.49);	

		fncMovePointLatLng(dec_set_lat, dec_set_lng);
		
		return true;

	} catch(ex) {
//alert("fncMove_map_info_show:" + ex.description);
		return false;
	}	
}


//
function fnc_top_to_map_find(i_str_value){
try {
		if (i_str_value == null || i_str_value.length == 0){
			return false;
		}

		var ary_parm = i_str_value.split(",");
		if (ary_parm.length != 3){
			return false;
		}

		fncCloseAllWindow();
		fncGetFindCenter(ary_parm[1], ary_parm[2]);

		return true;
	} catch(ex) {
//alert(ex.description);
		return false;
	}	
}


//
function fnc_find_map_zoom(){
try {
		//
		objMap.setZoom(12);
		return true;
	} catch(ex) {
		return false;
	}	
}


//
function fnc_find_km_map_zoom(){
try {
		//
		objMap.setZoom(9);
		return true;
	} catch(ex) {
		return false;
	}	
}




//----------------------------------------------------------------------------------------
//-----------------------------------------------------------
//Log関連
//

//アクセスログ更新（直帰率更新）
function fncRegNr(){
try {
		var objDate = new Date();
		var intNr = fncGetNr();

		if (intNr > 1){
			return true;
		}

		objXmlHttp = fncNewXHttp(function(){});
		if (objXmlHttp){
			objXmlHttp.open('GET','./rxUanr.php?t=' + objDate.getTime() 
 			                                + '&alkey=' + escape(gkey, true) 
 			                                + '&alnr=' + escape(intNr, true) 
 			                                + '&alkid=' + escape(gkid, true));
			objXmlHttp.send(null);
		}
		return true;
	} catch(ex) {
//alert("fncRegNr:" + ex.description);
		return false;
	}
}
//
function fncGetQ_RegNr(){
try {
		var objDate = new Date();
		var intNr = fncGetNr();

		if (intNr > 1){
			return "";
		}

		var str_ret = '';
		str_ret = '&alkey=' + escape(gkey, true) 
 			    + '&alnr=' + escape(intNr, true) 
 			    + '&alkid=' + escape(gkid, true);
		return str_ret;
	} catch(ex) {
//alert("fncGetQ_RegNr:" + ex.description);
		return "";
	}
}


//工務店ポップアップカウントアップ
function fncCukmp(i_id){
try {
		var objDate = new Date();

		objXmlHttp = fncNewXHttp(function(){});
		if (objXmlHttp){
			objXmlHttp.open('GET','./rxCukmp.php?t=' + objDate.getTime() 
		                                 + '&akey=' + escape(gkey, true) 
  			                             + '&kmid=' + escape(i_id, true) 
 			                              + '&kid=' + escape(gkid, true));
			objXmlHttp.send(null);
		}
		return true;
	} catch(ex) {
//alert("fncCukmp:" + ex.description);
		return false;
	}
}
