
	var map;                            //
	var omap;                           //
	var marker_point;                   //
	var current_read;                   //

	var pointPosition = new Array( 0 ); //
	var markPoint;                      //
	var loading_image = '';             // ローディングイメージの情報

	var personal  = 0;                   // 個人用物件のアイコンを指定するための定数
	var garage    = 1;                   // 駐車場物件のアイコンを指定するための定数
	var business  = 2;                   // 事業用物件のアイコンを指定するための定数
	var point     = '';                  // グーグルマップデフォルトのアイコンを指定するための定数
	var mark      = 3;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var office    = 4;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var store     = 5;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var factory   = 6;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var warehouse = 7;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var land      = 8;                   // 一覧の物件を触れたときにつけるマークアイコンを指定するための定数
	var load_center = 'true';
	var message   = ''; //

	var search_inner       = '';        // 検索パネルのHTML保存用
	var panel_width        = 330;       // 検索パネルの幅
	var hidden             = '';        // 検索パネル幅変更アニメーション用

	var current_center_x     = 34.782556;
	var current_center_y     = 135.630542;
	var current_center_scale = '';

	var panel_button_width = 8;         // 検索パネル表示非表示切り替えボタンの幅

	var static_url = '';
	var script     = '';
	var public_url = '';
	var module     = '';

	var research = false;

	var window_size = '300px';

	var click_move = false;

	function setScript( arg )
	{
		script = arg;
	}

	function setStaticUrl( arg )
	{
		static_url = arg;
	}

	function setMessage( arg )
	{
		message = arg;
	}

	//-------------------------------------------
	// Ajax
	function searchEstate( lat_min, lat_max, long_min, long_max, page, view, read, single, map_search )
	{
		var area = getElementObject( 'area' ).value;

		search_url = script;

		action_name = getElementObject( 'action' ).value;

		var search_params =
		{
			module   : module,
			action   : 'search_do',
			return_a : action_name,
			area     : area,
			lat_min  : lat_min,
			lat_max  : lat_max,
			long_min : long_min,
			long_max : long_max,
			read     : read,
			single   : single,
			page     : page,
			view     : view
		};

		if( map_search != 'false' )
		{
			$(
				function()
				{
					_search_list_with_map( search_url, search_params );
				}
			);
		}
		else
		{
			$(
				function()
				{
					_search_list_without_map( search_url, search_params );
				}
			);
		}
	}

	function _search_list_without_map( search_url, search_params )
	{
		var httpObj = $.post
		(
			search_url,
			search_params,
			function( text, success )
			{
				// 一覧の書き換え
				result = getElementObject( 'list' );
				result.innerHTML = text;
			}
		);
	}

	function _search_list_with_map( search_url, search_params )
	{
		var httpObj = $.post
		(
			search_url,
			search_params,
			function( text, success )
			{
				if( panel_width == 330 )
				{
					result = getElementObject( 'list' );
					result.innerHTML = text;
				}

				_search_map( search_url, search_params );
			}
		);
	}

	function _search_map( search_url, search_params )
	{
		search_params.action = 'point_do';

		var javascriptObj = $.post
		(
			search_url,
			search_params,
			function( script_text, success )
			{
				// マップ上のアイコンのクリア
				GMclearPoint();

				// マップ上にアイコンを追加
				eval( script_text );

				load_center = 'true';

				// 地図の書き換え
				if( current_read == 'true' )
					reload( current_center_scale, 'false', static_url, window_size, 'true', public_url, module );
				else
					reload( current_center_scale, 'false', static_url, window_size, 'false', public_url, module );

				if( message != '' )
				{
					getElementObject( 'map_message_space' ).innerHTML = '<div id="map_message">' + message + '</div>';
					message = '';
				}

				map.setCenter( center, current_center_scale );
			}
		);
	}

	//-------------------------------------------
	// ポイントの追加
	//
	// latitude integer 緯度
	// logitude integer 経度
	// type     integer アイコンの種類 personal | garage | business
	// image    URL     間取り図のURL
	// name     string  建物名
	// money    integer 賃料
	// id       integer ID
	//
	function GMaddPoint( latitude, longitude, type, image, name, money, id )
	{
		pointPosition.push( new Array( latitude, longitude, type, image, name, money, id ) );
	}

	//-------------------------------------------
	// ポイントのクリア
	//
	function GMclearPoint()
	{
		map.clearOverlays();
		pointPosition = new Array( 0 );
	}

	//-------------------------------------------
	// ディスプレイのサイズを取得
	//
	// return object width & height
	//
	function getDispSize()
	{
		if( document.all )
		{
			if( window.opera )
			{
				return { width : document.body.clientWidth, height : document.body.clientHeight };
			}
			else
			{
				// IE
				return { width : document.documentElement.clientWidth, height : document.documentElement.clientHeight };
			}
		}
		else if( document.layers )
		{
			// NN
			return { width : window.innerWidth, height : window.innerHeight };
		}
		else if( document.getElementById )
		{
			// firefox
			return { width : document.documentElement.clientWidth, height : document.documentElement.clientHeight };
		}
	}

	//-------------------------------------------
	// 地図のサイズを自動で指定
	//
	function GMresize()
	{
		//画面がリサイズされた
		var map_div = getElementObject( 'map' );

		if( window_size == 'true' )
		{
			var disp    = getDispSize();

			var new_height = disp.height - 200;

			map_div.style.height = new_height + 'px';
		}
		else
		{
			map_div.style.height = window_size + 'px';
		}
	}

	//-------------------------------------------
	// 検索枠の非表示切り替えボタンを大きくするアニメーション
	//
	function GMbuttonToLarge()
	{
		panel_button_width = 15;

		getElementObject( 'panel_button_image' ).width  = 13;
		getElementObject( 'panel_button_image' ).height = 17;

		getElementObject( 'panel_button' ).width = panel_button_width + 'px';
	}

	//-------------------------------------------
	// 検索枠の非表示切り替えボタンを小さくするアニメーション
	//
	function GMbuttonToSmall()
	{
		panel_button_width = 8;

		getElementObject( 'panel_button_image' ).width  = 6;
		getElementObject( 'panel_button_image' ).height = 8;

		getElementObject( 'panel_button' ).width = panel_button_width + 'px';
	}

	//-------------------------------------------
	// 検索枠の表示非表示のアニメーションの設定
	//
	function GMhidden()
	{
		if( panel_width == 330 )
		{
			search_inner = getElementObject( 'panel' ).innerHTML;
			getElementObject( 'panel' ).innerHTML = '';
			hidden = setInterval( "searchHidden()", 1 );
		}
		else if( panel_width == 1 )
		{
			hidden = setInterval( "searchView()", 1 );
		}
	}

	//-------------------------------------------
	// 検索枠の非表示のアニメーション
	//
	function searchHidden()
	{
		panel_width = panel_width - 20;

		if( panel_width <= 1 )
		{
			getElementObject( 'hidden_link' ).innerHTML = '<img src="' + static_url + '/images/system/map/arrow_right.gif" border="0" id="panel_button_image">';
			panel_width = 1;
			clearInterval( hidden );
			hidden = '';

			GMbuttonToSmall();
		}

		getElementObject( 'panel' ).style.width = panel_width + 'px';
	}

	//-------------------------------------------
	// 検索枠の表示のアニメーション
	//
	function searchView()
	{
		panel_width = panel_width + 20;

		if( panel_width >= 330 )
		{
			getElementObject( 'hidden_link' ).innerHTML = '<img src="' + static_url + '/images/system/map/arrow_left.gif" border="0" id="panel_button_image">';
			panel_width = 330;
			clearInterval( hidden );
			getElementObject( 'panel' ).innerHTML = search_inner;
			hidden = '';

			GMbuttonToSmall();
		}

		getElementObject( 'panel' ).style.width = panel_width + 'px';
	}

	function setResearch( arg )
	{
		research = arg;
	}

	//-------------------------------------------
	// グーグルマップの初期化
	//
	// scale integer スケール
	// edit  bool    編集の可否 true:編集可 | false:編集不可
	//
	function load( scale, edit, url, size, center, public_u, module_u )
	{
		window_size = size;
		static_url  = url;
		public_url  = public_u;
		module      = module_u;
		GMresize();

		if( GBrowserIsCompatible() )
		{
			map = new GMap2( document.getElementById( 'map' ) );

			map.addControl( new GLargeMapControl() );
			map.addControl( new GMapTypeControl()  );
			map.addControl( new GScaleControl()    );

			current_center_scale = scale;

			//			if( navigator.userAgent.match( 'MSIE' ) )
			//			{
			//				document.getElementById( 'map' ).attachEvent( 'onmousewheel', mouseWheelZoomingIE );
			//			}
			//			else if( navigator.userAgent.match( 'Gecko' ) )
			//			{
			//				document.getElementById( 'map' ).addEventListener( 'DOMMouseScroll', mouseWheelZoomingGecko, false );
			//			}
			//			else if( navigator.userAgent.match( 'Safari' ) )
			//			{
			//				document.getElementById( 'map' ).onmousewheel = mouseWheelZoomingIE;
			//			}

			initialLoadingImage();

			if( center != 'false' )
			{
				// 画面の中心の設定
				latlng = new GLatLng( pointPosition[ 0 ][ 0 ], pointPosition[ 0 ][ 1 ] );

				if( pointPosition[ 0 ][ 0 ] != 0 && pointPosition[ 0 ][ 1 ] != 0 && load_center == 'true' )
				{
					map.setCenter( latlng, scale );
					current_center_x     = pointPosition[ 0 ][ 0 ];
					current_center_y     = pointPosition[ 0 ][ 1 ];
				}
				else
				{
					map.setCenter( new GLatLng( current_center_x, current_center_y ), current_center_scale );
				}

				current_center_scale = scale;
			}
			else
			{
				map.setCenter( new GLatLng( current_center_x, current_center_y ), current_center_scale );
			}

			// ポイントの設定
			for( var pointIndex in pointPosition )
			{
				changeToPointAndViewPoint( pointPosition[ pointIndex ][ 0 ], pointPosition[ pointIndex ][ 1 ], pointPosition[ pointIndex ][ 2 ], pointPosition[ pointIndex ][ 3 ], pointPosition[ pointIndex ][ 4 ], pointPosition[ pointIndex ][ 5 ], pointPosition[ pointIndex ][ 6 ] );
			}

			// editがtrueで、ポイントデータが一つのときだけ、ポイントの移動が可能になる
			if( edit == 'true' && pointPosition.length == 1 )
			{
				// 地図上のクリックイベント作成
				GEvent.addListener
				(
					map,
					'click',
					function( overlay, point )
					{
						if( point )
						{
							map.clearOverlays();

							viewPoint( point, pointPosition[ 0 ][ 2 ] );

							map.panTo( new GLatLng( parseFloat( marker_point.lat() ), parseFloat( marker_point.lng() ) ) );
						}
					}
				);
			}
			else if( research )
			{
				GEvent.addListener
				(
					map,
					'moveend',
					function()
					{
						if( click_move == false )
						{
							current_center_x = map.getCenter().lat();
							current_center_y = map.getCenter().lng();
							getElementObject( 'page'  ).value = 1;
							checkMove( map.getBounds() );
						}

						click_move = false;
					}
				);
				GEvent.addListener
				(
					map,
					'zoomend',
					function( oldZoomLevel, newZoomLevel )
					{
						current_center_scale = newZoomLevel;
						getElementObject( 'page'  ).value = 1;
						searchInViewArea( 'false' );
					}
				);

				var bounds = map.getBounds();

				getElementObject( 'old_lat_min'  ).value = bounds.getSouthWest().lat();
				getElementObject( 'old_lat_max'  ).value = bounds.getNorthEast().lat();
				getElementObject( 'old_long_min' ).value = bounds.getSouthWest().lng();
				getElementObject( 'old_long_max' ).value = bounds.getNorthEast().lng();
			}

			OVLoad();

			hiddenLoadingImage();
		}
	}

	//-------------------------------------------
	// 初期表示以降はこっちを呼ぶ
	//
	function reload( scale, edit, url, size, center, public_u, module_u )
	{
		if( current_read == 'true' )
		{
			map.setCenter( new GLatLng( pointPosition[ 0 ][ 0 ], pointPosition[ 0 ][ 1 ] ), current_center_scale );
		}

		// ポイントの設定
		for( var pointIndex in pointPosition )
		{
			changeToPointAndViewPoint( pointPosition[ pointIndex ][ 0 ], pointPosition[ pointIndex ][ 1 ], pointPosition[ pointIndex ][ 2 ], pointPosition[ pointIndex ][ 3 ], pointPosition[ pointIndex ][ 4 ], pointPosition[ pointIndex ][ 5 ], pointPosition[ pointIndex ][ 6 ] );
		}

		hiddenLoadingImage();
	}

	//-------------------------------------------
	// 右下の小さいコントロールウィンドウの表示
	//
	function OVLoad()
	{
		omap = new GOverviewMapControl( new GSize( 150, 150 ) );
		map.addControl( omap );
	}

	//-------------------------------------------
	// 一覧上のマウス位置の物件にマークをつける
	//
	// latitude  float 緯度
	// longitude float 経度
	//
	function changeMark( latitude, longitude )
	{
		markPoint = changeToPointAndViewPoint( latitude, longitude, mark );
	}

	//-------------------------------------------
	// 地図上のマークを消す
	//
	function deleteMark()
	{
		markPoint.hide();
	}

	//-------------------------------------------
	// 緯度・経度を使える形に変換して、ポイントを表示するメソッドを呼ぶ
	//
	// latitude  float   緯度
	// longitude float   経度
	// type      integer アイコンの種類
	// image     URL     画像のURL
	// name      string  建物名
	// money     integer 賃料
	// id        integer ID
	//
	// return    GMarker マーカーオブジェクト
	//
	function changeToPointAndViewPoint( latitude, longitude, type, image, name, money, id )
	{
		latlng = new GLatLng( latitude, longitude );

		var marker = viewPoint( latlng, type );

		if( type != mark )
		{
			var f = function()
			{
				if( id != 'undefined' )
				{
					marker.openInfoWindowHtml( createInfo( image, name, money, id ) );
				}
			};

			GEvent.addListener( marker, 'click', f );
		}

		return marker;
	}

	//-------------------------------------------
	// openInfoWindowHtmlに表示する情報を作成
	//
	// image  URL     画像のURL
	// name   string  間取り
	// money  integer 賃料
	// id     integer ID
	//
	// return string  openInfoWindowHtmlに表示するタグ
	//
	function createInfo( image, name, money, id )
	{
		detail_module = module;
		align         = 'right';
		if( module == 'map_personal' || module == 'personal' )
		{
			detail_module = 'personal';
			align         = 'left';
		}
		if( module == 'map_garage' || module == 'garage'  )
		{
			detail_module = 'garage';
			align         = 'right';
		}
		if( module == 'map_business' || module == 'business' )
		{
			detail_module = 'business';
			align         = 'right';
		}
		detail_url = public_url + '/' + detail_module + '/detail_index/' + id;
		click_move = true;

		var info = ''                                                                               +
			'<table border="0" cellpadding="3" cellspacing="0">'                                    +
			'<tr align="center">'                                                                   +
			'<td width="117" rowspan="3">'                                                          +
			'<a href="' + detail_url + '"><img src="' + image + '" width="100" height="80"></a>'    +
			'</td>'                                                                                 +
			'<td align="' + align + '">'                                                            +
			'<div style="font-size:24px; color:#A7224F;">'                                          +
			'<p style=" font-family: Arial, Helvetica, sans-serif; "><B>' + name + '</B></p>'       +
			'</div>'                                                                                +
			'</td>'                                                                                 +
			'</tr>'                                                                                 +
			'<tr align="center">'                                                                   +
			'<td align="right">'                                                                    +
			'<div style="font-size:28px;"><p style=" font-family: Arial, Helvetica, sans-serif; ">' +
			'<B>' + money + '</B>'                                                                  +
			'</p></div>'                                                                            +
			'</td>'                                                                                 +
			'</tr>'                                                                                 +
			'<tr align="center"><td align="right">'                                                 +
			'<a href="' + detail_url + '">詳細はこちら</a>'                                         +
			'</td></tr>'                                                                            +
			'</table>';

		return info;
	}

	//-------------------------------------------
	// マーカーの作成
	//
	// point  GPoint  マーカーを表示する位置
	// type   integer アイコンの種類
	//
	// return GMarker マーカーオブジェクト
	//
	function viewPoint( point, type )
	{
		marker_point = point;

		var marker = new GMarker( point, getIcon( point, type ) );

		map.addOverlay( marker );

		return marker;
	}

	//-------------------------------------------
	// アイコンの作成
	//
	// point  GPoint  マーカーを表示する位置
	// type   integer アイコンの種類
	//
	// return GPoint  アイコンオブジェクト
	//
	function getIcon( point, type )
	{
		var icon = new GIcon();

		icon.iconSize         = new GSize( 35,35 );
		icon.infoWindowAnchor = new GPoint( 20, 0 );
		icon.iconAnchor       = new GPoint( 0, 0 );

		switch( type )
		{
			case 0 :
			case 'personal' :
				// personal
				icon.iconSize         = new GSize( 44,54 );
				icon.image = static_url + '/images/map/icon_house.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 1 :
			case 'garage' :
				// garage
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_car.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 2 :
			case 'business' :
				// business
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_business.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 3 :
			case 'mark' :
				// mark
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_mark.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 4 :
			case 'office' :
				// business
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_office.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 5 :
			case 'store' :
				// business
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_store.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 6 :
			case 'factory' :
				// business
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_factory.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 7 :
			case 'warehouse' :
				// business
				icon.iconSize         = new GSize( 44, 54 );
				icon.image = static_url + '/images/map/icon_warehouse.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 8 :
			case 'land' :
				// business
				icon.iconSize         = new GSize( 44, 63 );
				icon.image = static_url + '/images/map/icon_land.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height );
				break;
			case 100 :
			case 'loading' :
				// business
				icon.iconSize         = new GSize( 51,50 );
				icon.image = static_url + '/images/map/nowloading.gif';
				icon.iconAnchor = new GPoint( icon.iconSize.width/2, icon.iconSize.height/2 );
				break;
		}

		return icon;
	}

	function mouseWheelZoomingIE( event )
	{
		var delta = event.wheelDelta;

		event.returnValue = false;

		delta < 0 ? map.zoomOut() : map.zoomIn();
	}

	function mouseWheelZoomingGecko( event )
	{
		var delta = event.detail * -1;

		event.preventDefault();

		delta < 0 ? map.zoomOut() : map.zoomIn();
	}

	//-------------------------------------------
	// 緯度と経度とスケールを特定のアクションへ飛ばす
	function saveMap()
	{
		getElementObject( 'latitude'  ).value = marker_point.lat();
		getElementObject( 'longitude' ).value = marker_point.lng();
		getElementObject( 'scale'     ).value = map.getZoom();
	}

	//-------------------------------------------
	// 移動範囲を調べる
	function checkMove( bounds )
	{
		// 最後に移動した表示範囲を取得
		var old_lat_min  = getElementObject( 'old_lat_min'  ).value;
		var old_lat_max  = getElementObject( 'old_lat_max'  ).value;
		var old_long_min = getElementObject( 'old_long_min' ).value;
		var old_long_max = getElementObject( 'old_long_max' ).value;
		var new_lat_min  = bounds.getSouthWest().lat();
		var new_lat_max  = bounds.getNorthEast().lat();
		var new_long_min = bounds.getSouthWest().lng();
		var new_long_max = bounds.getNorthEast().lng();

		var lat_min  = new_lat_min  - old_lat_min;
		var lat_max  = new_lat_max  - old_lat_max;
		var long_min = new_long_min - old_long_min;
		var long_max = new_long_max - old_long_max;

		getElementObject( 'page'   ).value = 1;

		move_lat  = ( lat_min  + lat_max  ) / 2;
		move_long = ( long_min + long_max ) / 2;

		searchInViewArea( 'false' );
	}

	//-------------------------------------------
	// 表示範囲の情報を特定のアクションへ飛ばす
	function setParams( params )
	{
		for( var i in params )
		{
			getElementObject( i ).value = params[ i ];
		}
	}

	//-------------------------------------------
	// 表示範囲の情報を特定のアクションへ飛ばす
	function searchInViewArea( read, map_search )
	{
		if( !map_search )
		{
			map_search = true;
		}

		if( map_search != 'false' )
		{
			// 改ページでは地図をロードしない。
			viewLoadingImage()
		}

		bounds = map.getBounds();

		current_read = read;

		if( read == 'true' )
		{
			// 最後に移動した表示範囲を保存
			getElementObject( 'old_lat_min'  ).value = bounds.getSouthWest().lat();
			getElementObject( 'old_lat_max'  ).value = bounds.getNorthEast().lat();
			getElementObject( 'old_long_min' ).value = bounds.getSouthWest().lng();
			getElementObject( 'old_long_max' ).value = bounds.getNorthEast().lng();

			// 現在の表示範囲をセットして送る
			getElementObject( 'lat_min'  ).value = bounds.getSouthWest().lat();
			getElementObject( 'lat_max'  ).value = bounds.getNorthEast().lat();
			getElementObject( 'long_min' ).value = bounds.getSouthWest().lng();
			getElementObject( 'long_max' ).value = bounds.getNorthEast().lng();
		}
		else
		{
			// 最後に移動した表示範囲を保存
			getElementObject( 'old_lat_min'  ).value = bounds.getSouthWest().lat();
			getElementObject( 'old_lat_max'  ).value = bounds.getNorthEast().lat();
			getElementObject( 'old_long_min' ).value = bounds.getSouthWest().lng();
			getElementObject( 'old_long_max' ).value = bounds.getNorthEast().lng();

			// 現在の表示範囲をセットして送る
			getElementObject( 'lat_min'  ).value = bounds.getSouthWest().lat();
			getElementObject( 'lat_max'  ).value = bounds.getNorthEast().lat();
			getElementObject( 'long_min' ).value = bounds.getSouthWest().lng();
			getElementObject( 'long_max' ).value = bounds.getNorthEast().lng();
		}

		// 必要な情報の取得
		var page   = getElementObject( 'page'   ).value;
		var view   = getElementObject( 'view'   ).value;
		var single = getElementObject( 'single' ).value;

		searchEstate( getElementObject( 'lat_min'  ).value, getElementObject( 'lat_max'  ).value, getElementObject( 'long_min' ).value, getElementObject( 'long_max' ).value, page, view, read, single, map_search );
	}

	//-------------------------------------------
	// ローディングの画像の表示
	function initialLoadingImage()
	{
		loading_image = document.createElement( 'img' );

		loading_image.style.display = 'none';

		loading_image.setAttribute( 'id',  'nowloading'  );
		loading_image.setAttribute( 'src', static_url + '/images/map/nowloading.gif' );
		loading_image.style.width  = 51;
		loading_image.style.height = 50;

		loading_image.style.position  = 'absolute';
		viewLoadingImage();
		loading_image.style.filter   = 'opacity:85';

		loading_image.style.top  = ( map.getSize().height - 51 ) / 2 + 'px';
		loading_image.style.left = ( map.getSize().width  - 50 ) / 2 + 'px';

		mapTray = document.getElementById( map.getContainer().id ).firstChild;
		mapTray.appendChild( loading_image );

		loading_image.style.display = 'block';

		setAlpha( 90 );
	}

	//-------------------------------------------
	// 画像を半透明にする
	function setAlpha( b )
	{
		var c = 0.7;

		if( typeof(loading_image.style.filter ) == 'string' )
		{
			loading_image.style.filter = 'alpha( opacity : ' + b + ' )';
		}

		if( typeof( loading_image.style.KHTMLOpacity ) == 'string' )
		{
			loading_image.style.KHTMLOpacity = c;
		}

		if( typeof( loading_image.style.MozOpacity ) == 'string' )
		{
			loading_image.style.MozOpacity = c;
		}

		if( typeof( loading_image.style.opacity ) == 'string' )
		{
			loading_image.style.opacity = c;
		}
	}

	function hiddenLoadingImage()
	{
		loading_image.style.zIndex   = -25500;
	}

	function viewLoadingImage()
	{
		loading_image.style.zIndex   = 25500;
	}

//==========================================================================================

	// GlocalSearchオブジェクトを生成
	var search;

	search = new GlocalSearch();

	// 検索完了時のコールバック関数をセット
	search.setSearchCompleteCallback( null, OnLocalSearch );

	// qはフォームのテキストエリアの値
	function localSearch( q )
	{
		search.execute( q );
		return false;
	}

	// 検索完了時に呼ばれるコールバック関数
	function OnLocalSearch()
	{
		if( !search.results ) return;

		// 検索結果の1番目を取得
		var first = search.results[ 0 ];

		// その結果の緯度・経度を地図の中心にセット
		map.setCenter( new GLatLng( parseFloat( first.lat ), parseFloat( first.lng ) ) );
	}
