function GeoAccess()
{
	/* public variables */
	// center
	this.CenterX;
	this.CenterY;
	// extent
	this.MaxX;
	this.MaxY;
	this.MinX;
	this.MinY;
	this.ScaleMax;
	this.ScaleMin;
	this.InitialSetting;
	// image scale setting
	this.ActiveImageMap;
	this.MapScaleSetting;

	/* private variables */
	var imageMapSettings;
	var ImageMapple			= 0x0001;
	var ImageOrtho			= 0x0002;
	var ImageDM				= 0x0004;
	var ImageKeymap			= 0x0008;
	
	var retryCount = 0;
	
	var printWindow;
	
	var initialized	= false;
	
	// 初期化.
	this.Initialize = function()
	{
		AjaxPro.timeoutPeriod = 100 * 1000;
		
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.GetInitialSetting(geoAccess.GetInitialSetting_Callback);
	}

	// initialzie callback.
	this.GetInitialSetting_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		
		// get initial setting(extents, center...)
		geoAccess.InitialSetting = resultObject;
		
//		currentDocument.ShowContents("Living");
		
		geoAccess.SetLayerCategory("0", "Mapple");
		//geoAccess.GetContents(geoAccess.InitialSetting.LayerCategory, 1, 10);
	}

	// 戻り値判定.
	// response				戻り値.
	function getResultObject(response)
	{
		var ajaxResult;
		
		if (response == null)
		{
			return null;
		}
		
		if (response.value == null)
		{
			return null;
		}
		ajaxResult = response.value;
		
		// 0:success 1:error
		if (ajaxResult.ResultCode == 1)
		{
			alert("セッションが切断された為、正しく処理が行われません。\nブラウザの更新を行い、再度表示してください。");
			return null;
		}
		return ajaxResult.ResultObject;
	}
	
	// キーワード検索.
	// keyword			検索文字列.
	this.Search = function(keyword)
	{
		document.getElementById("SearchCount").innerHTML = "検索しています...";
		document.getElementById("SearchList").innerHTML = "<img src = 'MapForm/img/nowloading.gif' style=' MARGIN: 150px 0px 0px 120px;'>";
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.Search(keyword, geoAccess.Search_Callback);
	}
	
	// キーワード検索 Callback.
	this.Search_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		if (resultObject != null)
		{
			document.getElementById("SearchList").innerHTML = resultObject[0];
			document.getElementById("SearchCount").innerHTML = resultObject[1];
		}
	}
	
	// カテゴリー設定.
	// layerCategory			レイヤカテゴリ定数.
	// imageMapName				背景図名称.
	this.SetLayerCategory =function(layerCategory, imageMapName)
	{
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.SetLayerCategory(layerCategory, imageMapName, geoAccess.SetLayerCategory_Callback);
	}

	// カテゴリー設定.
	// layerCategory			レイヤカテゴリ定数.
	// imageMapName				背景図名称.
	this.SetLayerCategoryContents =function(layerCategory, imageMapName)
	{
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.SetLayerCategory(layerCategory, imageMapName, geoAccess.SetLayerCategoryContents_Callback);
	}
	
	// SetLayerCategory_Callback.
	this.SetLayerCategory_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		if (resultObject != null && resultObject != "")
		{
			geoAccess.InitialSetting = resultObject;
		}	
	}
	
	// SetLayerCategoryContents_Callback.
	this.SetLayerCategoryContents_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		if (resultObject != null && resultObject != "")
		{
			geoAccess.InitialSetting = resultObject;

			geoAccess.GetContents("", 1, 10);
		}	
	}
	
	// 属性画面表示.
	// layerId				レイヤID.
	// itemId					アイテムID.
	this.FeatureClick = function(layerId, itemId)
	{
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.GetAttributeFromId(layerId, itemId, geoAccess.GetAttribute_Callback);
	}
	
	// GetAttribute_Callback
	this.GetAttribute_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		if (resultObject != null && resultObject != "")
		{
			
			var attributeDialog = new AttributeDialog(300, 300);
			
			attributeDialog.Show(resultObject);
		}
	}
	
	// コンテンツ情報取得.
	// layerKey				キー.
	// startCount			表示開始件数.
	// endCount				表示終了件数.
	this.GetContents = function(layerKey, startCount, endCount)
	{
		Nais.Gis2006.SubSystems.Citizen15216.IndexForm.GetContentsHtml(layerKey, startCount, endCount, geoAccess.GetContents_Callback);
	}
	
	// GetContents_Callback.
	this.GetContents_Callback = function(response)
	{
		var resultObject = getResultObject(response);
		if (resultObject != null)
		{
			document.getElementById("contentshtml").innerHTML = resultObject;
			document.getElementById("contentsbody").scrollTop = 0;
			
		}
	}
}
