//-----------------------------------------------------
// 定数
//-----------------------------------------------------
var FIRST_ZOOM_POINT	= 12	//最初のＺＯＯＭレベル
var SECOND_ZOOM_POINT	= 16	//最後のＺＯＯＭレベル
var ROWS_MAX			= 25	//1ページの最大数
var PAGE_MAX			= 5		//ページングの最大数
var NOTSHOP_NO			= 9999	//ショップ番号ありえない

//ＪＡ名
var JASHOP_NAME = {
	'6342' : 'JAあいら伊豆',
	'6328' : 'JA伊豆太陽',
	'6338' : 'JA伊豆の国',
	'6391' : 'JA遠州中央',
	'6387' : 'JA遠州夢咲',
	'6377' : 'JA大井川',
	'6386' : 'JA掛川市',
	'6351' : 'JA御殿場',
	'6373' : 'JA静岡市',
	'6363' : 'JAしみず',
	'6362' : 'JAするが路',
	'6403' : 'JAとぴあ浜松',
	'6345' : 'JAなんすん',
	'6382' : 'JAハイナン',
	'6355' : 'JA富士市',
	'6357' : 'JA富士宮',
	'6426' : 'JA三方原開拓',
	'6333' : 'JA三島函南',
	'6423' : 'JAみっかび',
	'3021' : '静岡県信連'
};

/////////////////////////////////////////////////////////////////////
// 静岡マップクラス
////////////////////////////////////////////////////////////////////
function ShizuokaMap ( x, y ) {

	var type;				// 検索方法　０⇒地域検索　１⇒ＪＡ名検索
	var area;				// 地域
	var ja_name;			// JA名
	var page_no;			// ページ番号
	var rows_num;			// 店舗数
	var icon_tenpo;			// 店舗アイコン
	var icon_atm;			// ATMアイコン
	
	
	//--------------------------------------------------
	// 初期化
	//--------------------------------------------------
	ShizuokaMap.prototype.Init = function( type, janame, pref ) {

		this.type		= type;		//type
		this.area		= pref;		//地域		
		this.ja_name	= janame;	//JA		
		this.page_no	= 0;		//ページ番号
		this.rows_num	= 0;		//店舗数
		
	
		//緯度経度セット
		g_Map.setCenter	(new GLatLng( x, y ), FIRST_ZOOM_POINT );
		
		//店舗アイコン
		this.icon_tenpo	= this.createIcon( "./images/icon_map_l.png", 44, 31, 13, 30 );
		this.setIconShadow( this.icon_tenpo, "./images/icon_map_l_shadow.png",44,31 );
		
		//ＡＴＭアイコン
		this.icon_atm	= this.createIcon( "./images/icon_atm_l.png", 44, 31, 13, 30 );
		this.setIconShadow( this.icon_atm, "./images/icon_map_l_shadow.png",44,31 );
		
		//タイプ・コントロール
		this.setControl( CTRL_SMALL | CTRL_TYPE | CTRL_SCALE );
		
		//マウスズーム
		this.setWheelZoom();

		//右下のウィンドウ
		this.setOverview();

		//ウィンドウ表示なし
		this.setInfoWindow(false);

		//なめらかズーム
		if (navigator.userAgent.match("MSIE") ){
			this.setContZoom(true);
		}
	}


	//-------------------------------------------------
	// get
	//-------------------------------------------------
	ShizuokaMap.prototype.getArea = function() { return this.area;	}
	ShizuokaMap.prototype.getPage = function() { return this.page_no; }


	//-------------------------------------------------
	// set
	//-------------------------------------------------
	ShizuokaMap.prototype.setPage = function( no )	{ this.page_no	= no; }
	ShizuokaMap.prototype.setRows = function( num ) { this.rows_num = num; }

	
	//-------------------------------------------------
	// マーカーセット
	//-------------------------------------------------
	ShizuokaMap.prototype.setMarker = function( json, first, length ) {

		if (!first)		first	= 0;
		
		length += first;
		if (!length || length > json.length)	length	= json.length;
		
		for (var i = first; i < length; i++ ) {
			this._setMarkerEvent( json[i], this.ja_name );	
		}
	}
	
	
	//-------------------------------------------------
	// 店舗テーブルセット
	//-------------------------------------------------
	ShizuokaMap.prototype.setShopTable = function( json, first, length ) {

		var line = (this.type) ? '<div id="mod_tenpotitle"><h3>店舗・ＡＴＭ一覧</h3></div>' : '<div id="mod_tenpotitle"><h3>最寄りの店舗・ATM一覧</h3></div>';
    	line	+= '<div id="mod_tenpo_tablebox_02"><table><tr><th>No</th><th>支店名</th><th nowrap>金融機関<br/>（店舗）<br/>コード</th><th>郵便番号</th><th>住所</th><th>電話番号</th><th>店舗</th><th>ATM</th></tr>';
	
		if (!first)		first	= 0;
		
		length += first;
		if (!length || length > json.length)	length	= json.length;
		
		for (var i = first; i < length; i++) {
		
			var num = (3-json[i].no.length);
			for( var j = 0; j < num; j++ ){
				json[i].no = '0'+String(json[i].no);
			}
		
			line += '<tr>';
			line += '<td class="number">'+(i+1)+'</td>';
			line += '<td><a href="#" onclick="shizuoka_map.setListEvent('+i+',\''+this.ja_name+'\')">'+json[i].tenpo+'</a></td>';
			if (json[i].atm){
				line += '<td>'+json[i].code+'</td>';
			}
			else {
				line += '<td>'+json[i].code+'('+json[i].no+')</td>';
			}
    		line += '<td>'+json[i].zip+'</td>';
    		line += '<td>'+json[i].address+'</td>';
			line += '<td>'+json[i].tel+'</td>';
    		line += '<td>'+(json[i].atm!= 0 ? '' : '○')+'</td>';
			line += '<td>'+(json[i].flag=="1" ? '' : '○')+'</td>';
   			line += '</tr></div>';
	
		}

		document.getElementById('shop_table').innerHTML = line;
	}


	//-------------------------------------------------
	// マーカーイベントセット
	//-------------------------------------------------
	ShizuokaMap.prototype._setMarkerEvent = function( json, janame ) {
		
		var marker = new GMarker(new GLatLng(json.x,json.y), (json.atm) ?  this.icon_atm : this.icon_tenpo);
		
		g_Map.addOverlay( marker );
	
		// ATM 情報
		if (json.atm) {
			GEvent.addListener( marker, "click", function(){
				
				document.getElementById('shop_table').innerHTML = '';
		
				GDownloadUrl('/tenpo/get_atm.php?atm='+json.atm+'&code='+json.code+'&no='+NOTSHOP_NO, onLoadShop);
				
				shizuoka_map.setPankuzu( shizuoka_map.getArea(), true, json.tenpo  ); 
			
				shizuoka_map._setClickEvent( json.x, json.y, json.code);
				
				shizuoka_map.getConfigButton( new Array(json.x, json.y, SECOND_ZOOM_POINT), true, new Array(json.code, json.atm, json.tenpo), 1);
			});
		}

		// 支店の情報
		else {
			GEvent.addListener( marker, "click", function(){

				GDownloadUrl('/tenpo/get_atm.php?atm='+json.atm+'&code='+json.code+'&no='+json.no, onLoadShop);

				shizuoka_map._setShopList(json, JASHOP_NAME[json.code]);
				
				shizuoka_map.setPankuzu( shizuoka_map.getArea(), true, json.tenpo  ); 
			
				shizuoka_map._setClickEvent( json.x, json.y, json.code);		
				
				//ボタンセット
				shizuoka_map.getConfigButton( new Array(json.x, json.y, SECOND_ZOOM_POINT), true, new Array(json.code, json.no, json.tenpo ), 0 );
			
			});
		}
		
	}


	//-------------------------------------------------
	// listイベントセット
	//-------------------------------------------------
	ShizuokaMap.prototype.setListEvent = function(id, janame) {
	
		// ATMの場合
		if (shopdata[id].atm) {
			
			GDownloadUrl('/tenpo/get_atm.php?atm='+shopdata[id].atm+'&code='+shopdata[id].code+'&no='+NOTSHOP_NO, onLoadShop);
				
			document.getElementById('shop_table').innerHTML = '';
			
			this._setClickEvent( shopdata[id].x, shopdata[id].y, shopdata[id].code );		

			this.getConfigButton( new Array(shopdata[id].x, shopdata[id].y, SECOND_ZOOM_POINT), true, new Array(shopdata[id].code, shopdata[id].atm,shopdata[id].tenpo ),1 );
		}
		// 支店の場合
		else {

			GDownloadUrl('/tenpo/get_atm.php?atm='+shopdata[id].atm+'&code='+shopdata[id].code+'&no='+shopdata[id].no, onLoadShop);
	
			this._setShopList(shopdata[id], JASHOP_NAME[shopdata[id].code]);
			
			this._setClickEvent( shopdata[id].x, shopdata[id].y, shopdata[id].code );		
	
			//ボタンセット
			this.getConfigButton( new Array(shopdata[id].x, shopdata[id].y, SECOND_ZOOM_POINT), true, new Array(shopdata[id].code, shopdata[id].no,shopdata[id].tenpo ), 0 );
		}
		
		this.setPankuzu		( this.area, true, shopdata[id].tenpo  ); 
	}


	//-------------------------------------------------
	// クリックイベントセット
	//-------------------------------------------------
	ShizuokaMap.prototype._setClickEvent = function( x, y, code ) {
	
		g_Map.setCenter	(new GLatLng( x, y ), SECOND_ZOOM_POINT );
		
		document.getElementById('center_ja').innerHTML		= JASHOP_NAME[code];
		
		document.getElementById('front_pager').innerHTML	= '';
		
		document.getElementById('back_pager').innerHTML		= '';
	}


	//-------------------------------------------------
	// shoplistセット
	//-------------------------------------------------
	ShizuokaMap.prototype._setShopList = function(json, janame) {
	
		var ten = json.tenpo.replace("静岡県信連"," ");

		var num = (3-json.no.length);
		for( var i = 0; i < num; i++ ){
			json.no = '0'+String(json.no);
		}
		
		var line = '<div id="mod_tenpotitle"><h3>'+janame+"　"+ten+'</h3></div>';
		line	+=	'<div id="mod_tenpo_tablebox_03"><table border="0" cellspacing="0" cellpadding="0">';			
		line 	+= 	'<tr><th scope="row">住所</th>';
		line 	+=	'<td>'+json.address+'</td>';
		line	+=	'</tr><tr>';
		line	+= 	'<th scope="row">郵便番号</th>';
		line	+=  '<td>'+json.zip+'</td>';
		line	+= 	'</tr><tr>';
		line	+=  '<th scope="row">電話番号</th>';
		line	+= 	'<td>'+json.tel+'</td>';
		line	+= 	'</tr><tr>';
		line	+= 	'<th scope="row">金融機関(店舗)コード</th>';
		line	+=	'<td>'+json.code+'('+json.no+')</td>';
		line	+=  '</tr></table></div>';
		
		document.getElementById('shop_table').innerHTML = line;
	}


	//-------------------------------------------------
	// 一覧に移動
	//-------------------------------------------------
	ShizuokaMap.prototype.moveIndex = function() {
		
		// 元の場所へ
//		g_Map.setCenter		(new GLatLng( shopdata[0].x, shopdata[0].y ), FIRST_ZOOM_POINT );
		this.getConfigButton( new Array(shopdata[0].x, shopdata[0].y, FIRST_ZOOM_POINT), true );

		// 店舗テーブルに戻す
		if ( this.rows_num ) {
			this.createPages	(0);
//			this.setMarker		(shopdata, 0, ROWS_MAX );		//マーカーセット
			this.setShopTable	(shopdata, 0, ROWS_MAX );		//店舗テーブルセット
		}
		else {
			this.setShopTable	(shopdata);
		}
		

		// パンクズも元へ
		this.setPankuzu		(this.area, false);
	}

	//-------------------------------------------------
	// ページングセット
	//-------------------------------------------------
	ShizuokaMap.prototype.createPages = function( indexno ) {

		//最高ページ数取得
		var maxnum 	= (((indexno+1)*ROWS_MAX) > this.rows_num ) ? this.rows_num : ((indexno+1)*ROWS_MAX);
		
		//上のページ
		document.getElementById('front_pager').innerHTML = "<h4>検索結果　　"+this.rows_num+"件中　"+(indexno*ROWS_MAX+1)+"～"+maxnum+"件を表示</h4>"+
				"<p class=\"pages\">"+this._createPageNo( this.rows_num, indexno )+"</p>";

		//下のページ
		document.getElementById('back_pager').innerHTML = "<p class=\"pages\">"+this._createPageNo( this.rows_num, indexno )+"</p>";
	}

	
	//-------------------------------------------------
	// ページング番号作成
	//-------------------------------------------------
	ShizuokaMap.prototype._createPageNo = function( max, indexno ) {
		var pagenum		= Math.floor(max/ROWS_MAX)+1;
		var centergap	= Math.floor(PAGE_MAX/2);
		var maxpage		= pagenum;

		var pagestart = 0;
		if( pagenum >= PAGE_MAX ){
			if( indexno > centergap ){
				pagestart = indexno-centergap;
				if( pagestart+PAGE_MAX > pagenum ){
					pagestart = pagenum-PAGE_MAX;
				}
			}
			maxpage = pagestart+PAGE_MAX;
			//最大チェック
			if( maxpage >= pagenum )	maxpage = pagenum;
		}
		
		var html='';
		
		//後ろのページがある場合作成
		if (indexno!= 0) {
			html = "<a href=\"#\" onClick=\"shizuoka_map.nextPage("+(this.page_no-1)+")\">&lt;&lt;&nbsp;前の"+ROWS_MAX+"件へ</a>";
		}
	
		//ページ作成
		for ( var n = pagestart; n < maxpage; n++ ) {
	
			if (indexno == n) {
				html += "&nbsp;|&nbsp;"+(n+1)+"&nbsp;|&nbsp;";
			}
			else{
				html += "&nbsp;|&nbsp;<a href=\"#\" onClick=\"shizuoka_map.nextPage("+n+")\">"+(n+1)+"</a>&nbsp;|&nbsp;";
			}
		}
		
		//前にページがある場合作成
		if (indexno != maxpage-1) {
			html += "<a href=\"#\" onClick=\"shizuoka_map.nextPage("+(this.page_no+1)+")\">次の"+ROWS_MAX+"件へ&nbsp;&gt;&gt;</a>";
		}
		return html;
	}


	//-------------------------------------------------
	//　ページ選択 
	//-------------------------------------------------
	ShizuokaMap.prototype.nextPage = function(page) {
		
		//アイコン消去
//		g_Map.clearOverlays();
		
		//現在のページset
		shizuoka_map.setPage( page );
		shizuoka_map.createPages( page );
	
		first = page * ROWS_MAX;
	
//		shizuoka_map.setMarker		(shopdata, first, ROWS_MAX );		//マーカーセット
		shizuoka_map.setShopTable	(shopdata, first, ROWS_MAX );		//店舗テーブルセット
	}


	//---------------------------------------------------------------------
	// 別ウィンドウでURL表示
	//---------------------------------------------------------------------
	ShizuokaMap.prototype.GetShopURL = function( code, no, shop, atm ) {
		element = window.open( "", "win_url", "width=600,height=300");
		element.document.open();
		var html = "<html>"+
			"<head>"+
			"<link href=\"../common/css/basic/base.css\" rel=\"stylesheet\" type=\"text/css\" />"+
			"<link href=\"../common/css/3rd/base.css\" rel=\"stylesheet\" type=\"text/css\" />"+
			"<link href=\"../common/css/tenpo/base.css\" rel=\"stylesheet\" type=\"text/css\" />"+
			"<title>地図URL</title>"+
			"</head>"+
			"<body id=\"popup_url\">"+
			"<div id=\"popup_url_contents\">"+
			"<h3>"+
			"地図URL"+
			"</h3>"+
			"<div id=\"url_area\">"+
			JASHOP_NAME[code]+"　>>　"+shop+"　の地図URL"+
			"<form>";
        if (atm == 1) {
			html    +=  "<textarea name=\"urlerea\" rows=\"5\" cols=\"50\" >http://www.jabank-shizuoka.gr.jp/tenpo/atm_search.php?code="+code+"&no="+no+"</textarea>";
        }
        else {
		    html    +=	"<textarea name=\"urlerea\" rows=\"5\" cols=\"50\" >http://www.jabank-shizuoka.gr.jp/tenpo/shiten_search.php?code="+code+"&no="+no+"</textarea>";
        }
	    html +=		"<p class=\"urlbtn\">"+
			"<a href=\"javascript:window.close();\">"+
			"<img src=\"../common/images/util/btn_close.gif\" alt=\"ウィンドウを閉じる\" width=\"115\" height=\"29\" border=\"0\" />"+
			"</a>"+
			"</p>"+
			"</form>"+
			"</div>"+
			"</div>"+
			"</body>"+
			"</html>";
		element.document.write( html );
		element.document.close();
	}


	//-------------------------------------------------
	//　ボタンセット 
	//-------------------------------------------------
	ShizuokaMap.prototype.getConfigButton = function( reset, print, url, atm ) {

		var button = '<p style="text-align: left; width: 500px;">';

		if( reset ){
			button += "<a href='#' onClick=\"g_Map.setCenter( new GLatLng( "+reset[0]+", "+reset[1]+" ), "+reset[2]+" )\"><img src=\"images/btn_mapreset.gif\" alt=\"表示位置をリセット\" width=\"111\" height=\"29\" border=\"0\" class=\"btn_reset\" /></a>&nbsp;";
		}
		if( print ){
			button += "<a href='#' onClick=\"window.print()\"><img src=\"images/btn_print.gif\" alt=\"このページを印刷する\" width=\"128\" height=\"29\" border=\"0\" class=\"btn_print\" /></a>&nbsp;";
		}
		if( url ){
			button += "<a href='#' onClick='shizuoka_map.GetShopURL( \""+url[0]+"\",\""+url[1]+"\",\""+url[2]+"\", \""+atm+"\")'\"><img src=\"images/btn_mapurl.gif\" alt=\"地図URLを表示\" width=\"128\"  height=\"27\" border=\"0\" class=\"btn_url\" /></a>";
		}
		button += "</p>";

		document.getElementById('config_button').innerHTML = button;
	}


	//-------------------------------------------------
	// パンクズセット
	//-------------------------------------------------
	ShizuokaMap.prototype.setPankuzu = function( pref, list, shopname ) {

		var _pan;
		
		switch (this.type) {
		case 0:
			var AREA_NAME = new Array(
				'熱海市',
				'伊豆市',
				'伊豆の国市',
				'伊東市',
				'庵原郡富士川町',
				'庵原郡由比町',
				'磐田市',
				'御前崎市',
				'掛川市',
				'賀茂郡河津町',
				'賀茂郡西伊豆町',
				'賀茂郡東伊豆町',
				'賀茂郡松崎町',
				'賀茂郡南伊豆町',
				'菊川市',
				'湖西市',
				'御殿場市',
				'静岡市葵区',
				'静岡市清水区',
				'静岡市駿河区',
				'志太郡大井川町',
				'志太郡岡部町',
				'島田市',
				'下田市',
				'周智郡森町',
				'裾野市',
				'駿東郡小山町',
				'駿東郡清水町',
				'駿東郡長泉町',
				'田方郡函南町',
				'沼津市',
				'榛原郡川根町',
				'榛原郡川根本町',
				'榛原郡吉田町',
				'浜名郡新居町',
				'浜松市',
				'袋井市',
				'藤枝市',
				'富士郡芝川町',
				'富士市',
				'富士宮市',
				'牧之原市',
				'三島市',
				'焼津市'
			);
		
			_pan = '<a href="/tenpo/area.php?pref='+pref+'">'+AREA_NAME[pref-1]+'</a>';
		
			_pan += (list) ? '　>>　<a href="#" onClick="shizuoka_map.moveIndex()">店舗・ATM一覧</a>　>>　'+shopname : '　>>　店舗・ATM一覧';

			break;

		case 1:
			_pan = (list)	? '<a href="#" onClick="shizuoka_map.moveIndex()">'+JASHOP_NAME[pref]+'  店舗・ATM一覧</a>　>>　'+shopname
						　	: JASHOP_NAME[pref]+'  店舗・ATM一覧';
			break;

		case 2:
        case 3:

			var JANAME_COUNT = {
				'6342' : '6342001',
				'6328' : '6328400',
				'6338' : '6338001',
				'6391' : '6391001',
				'6387' : '6387400',
				'6377' : '6377600',
				'6386' : '6386001',
				'6351' : '6351001',
				'6373' : '6373010',
				'6363' : '6363001',
				'6362' : '6362200',
				'6403' : '6403800',
				'6345' : '6345080',
				'6382' : '6382001',
				'6355' : '6355001',
				'6357' : '6357001',
				'6426' : '6426001',
				'6333' : '6333001',
				'6423' : '6423001',
				'3021' : '3021001'
			};
			_pan = '<a href="/tenpo/jasearch.php?jano='+JANAME_COUNT[pref]+'">'+JASHOP_NAME[pref]+'  店舗・ATM一覧</a>　>>　'+shopname;
			break;
		}
		document.getElementById('mod_pankuzu').innerHTML = _pan;
	}
}


/////////////////////////////////////////////////////////////////
// SHOP + ATM ロード
/////////////////////////////////////////////////////////////////
function onLoadShop( txt, status ) {
	
	if (!txt) return;
	eval('var json = '+txt);
    setAtm(json);
    setOnButton(json);
}

/////////////////////////////////////////////////////////////////
// ATM情報セット
/////////////////////////////////////////////////////////////////
function setAtm (json, ret) {
	var line = '';
    if (ret != 1) line = '<br />';
    line    += '<div id="mod_tenpotitle"><h3>ATM</h3></div>';
	line	+= '<div id="mod_tenpo_tablebox_03">';
	line	+= '<table border="0" cellspacing="0" cellpadding="0">';
	line	+= '<tr><th scope="row">ATM名</th>';
	line	+= '<td>'+json.atm_name+'</td></tr>';
	line	+= '<tr><th scope="row">住所</th>';
	line 	+= '<td>'+json.atm_address+'</td></tr>';
	line	+= '<tr><th scope="row">ATM利用時間</th>';
	line	+= '<td>月～金　'+json.time1+'<br />';
	line	+= '	土　　　　　'+json.time2+'<br />';
	line	+= '	日・祝日　'+json.time3+'</td>';
	line	+= '</tr></table>';
    if (ret) {
        document.getElementById('shop_table').innerHTML		= line;
    }
    else {
        document.getElementById('shop_table').innerHTML		+= line;
    }
}

/////////////////////////////////////////////////////////////////
//  上のボタンset
/////////////////////////////////////////////////////////////////
function setOnButton (json) {
	if ( !json.shop ) {
		document.getElementById('shop_lone').style.display		= 'inline'; 
		document.getElementById('shop_savings').style.display	= 'inline'; 
	}
	else if ( json.shop != 'shinren' ) {
		document.getElementById('shop_lone').style.display		= 'inline'; 
		document.getElementById('shop_savings').style.display	= 'inline'; 
		document.getElementById('shop_lone').href 				= "/finance/?mode=0&ja="+json.shop;
		document.getElementById('shop_savings').href			= "/finance/?mode=1&ja="+json.shop;
	}
	else {
		document.getElementById('shop_url').href 				= json.url;
		document.getElementById('shop_lone').style.display		= 'none'; 
		document.getElementById('shop_savings').style.display	= 'none'; 
	}
}

/////////////////////////////////////////////////////////////////
// トリガー
/////////////////////////////////////////////////////////////////
function Load( type, janame, name, num ) {
	ShizuokaMap.prototype 	= new MapBase('map');	//継承
	shizuoka_map 			= new ShizuokaMap( shopdata[0].x, shopdata[0].y );	//マップ作成
	shizuoka_map.Init			( type, janame, name );	//初期化
	shizuoka_map.setPankuzu		( name );			//パンクズセット

	//数をセットするときはページング
	if (type < 2 ) {
		
		shizuoka_map.getConfigButton( new Array(shopdata[0].x, shopdata[0].y, FIRST_ZOOM_POINT), true );

		if (num){
			shizuoka_map.setRows		(num);
			shizuoka_map.createPages	(shizuoka_map.getPage());
			shizuoka_map.setShopTable	(shopdata, 0, ROWS_MAX );		//店舗テーブルセット
		}
		else {
			shizuoka_map.setShopTable	( shopdata );		//店舗テーブルセット
		}
	}
	else{
		shizuoka_map._setShopList(shopdata[0], JASHOP_NAME[name]);

        if (shopdata[1]) {
            setAtm(shopdata[1]);
            document.getElementById('shop_url').href 			= shopdata[1].url;
        }
        else{
            document.getElementById('shop_url').href 			= shopdata[0].url;
        }
        setOnButton(shopdata[0]);

		shizuoka_map.setPankuzu( shizuoka_map.getArea(), true, shopdata[0].tenpo  ); 

        if (type == 2) {
            shizuoka_map.getConfigButton( new Array(shopdata[0].x, shopdata[0].y, SECOND_ZOOM_POINT), true, new Array(shopdata[0].code,shopdata[0].no, shopdata[0].tenpo), 0 );
        }
        else {
            setAtm(shopdata[0], 1);
            shizuoka_map.getConfigButton( new Array(shopdata[0].x, shopdata[0].y, SECOND_ZOOM_POINT), true, new Array(shopdata[0].code,shopdata[0].atm, shopdata[0].tenpo), 1 );
        }

		g_Map.setCenter		(new GLatLng( shopdata[0].x, shopdata[0].y ), SECOND_ZOOM_POINT );

		document.getElementById('center_ja').innerHTML		= JASHOP_NAME[name];
		document.getElementById('front_pager').innerHTML	= '';
		document.getElementById('back_pager').innerHTML		= '';
	}
	shizuoka_map.setMarker		( shopdata );		//マーカーセット
}


