if (typeof itsmo == 'undefined') { var itsmo = {}; } if (typeof itsmo.vars == 'undefined') { itsmo.vars = {}; } itsmo.search = function() {}; //------------------------------------------------------------- // フリーワード //------------------------------------------------------------- itsmo.search.freewd = function() {};//フリーワード itsmo.search.freewd.CntViewSelect = function(){ $('#ajax_rowcnt_div').toggle(); }; //------------------------------------------------------------- // 路線図 //------------------------------------------------------------- itsmo.search.rail = function() {}; itsmo.search.rail.loadMap = function(no) { rmap = new ZdcSearchRailwayMap(); var opts = new ZdcSearchRailwayMapOptions(); opts.mapNo = no; // 路線図の範囲を東京周辺にする opts.callback = itsmo.search.rail.dispResult; // 検索終了時に呼ぶ関数を指定する rmap.addMainMap(document.getElementById('ajax_rail'), opts); // レイヤに路線図検索を追加する }; itsmo.search.rail.dispResult = function(result) {//callback if( result.status == 0 ) { document.getElementById('ajax_rail').style.visibility = 'hidden'; // 路線図を非表示にする rmap.removeMainMap(); // 路線図検索オブジェクトを削除する rmap.removeSubMap(); // 路線図検索オブジェクトを削除する //location.href = "/map/?lat="+result.items[0].point.my+"&lon="+result.items[0].point.mx+"&name="+encodeURI(result.items[0].stationName); location.href = "/search/rail/?lat="+result.items[0].point.my+"&lon="+result.items[0].point.mx+"&name="+encodeURI(result.items[0].stationName); } } itsmo.search.sponsor_list = {}; itsmo.search.sponsor_list.init1 = function() { $.getScript('/js/jquery.clearfield.packed.js', itsmo.search.sponsor_list.init2); }; itsmo.search.sponsor_list.init2 = function() { $('#ajax_search_sponsor_list_keyword').clearField().blur(); }; //------------------------------------------------------------- // 機能ボタン遷移処理 //------------------------------------------------------------- itsmo.search.set_init_data = function() { var details = {}; $(".sis-access input[type='hidden']").each(function(i, v) { var elem = $(this); var name = elem.attr('name'); var val = elem.val(); switch (name) { case 'nm': // 駅詳細の場合 name = 'name'; break; case 'id': // 駅詳細の場合 name = 'poiid'; break; case 'adcd': // 住所一覧の場合 name = 'poiid'; break; } details[name] = val; }); if (details['name'] == details['addr']) { details['addr'] = ''; // 住所一覧の場合、住所を取得し直すためここではセットしない details['ckbn'] = 'ADDR'; } // 遷移データCookieセット itsmo.setCookieTemp(details); }; // 詳細画面地図・アクセスタブ itsmo.search.g_map_obj = null; itsmo.search.initAreaMap = function(url) { if (typeof ZDC === 'undefined' || typeof ZDC.Map === 'undefined') { return; } var e = $('#idMapLatLon'); if (e.length <= 0) { return; } e = e.val().split(','); var lat = parseInt(e[0], 10) / (60 * 60 * 1000); var lon = parseInt(e[1], 10) / (60 * 60 * 1000); var latlon = new ZDC.LatLon(lat, lon); var lvl = 13; ZDC._TILE_PATHS["4"] = ZDC._TILE_PATHS["24"]; itsmo.search.g_map_obj = new ZDC.Map( $('#idMap').get(0), { mapType: ZDC.MAPTYPE_COLOR, latlon: latlon, zoom: lvl } ); itsmo.search.g_map_obj.dragOn(); itsmo.search.g_map_obj.zoomOn(); // クリック地点を地図の中心点として移動 ZDC.addListener(itsmo.search.g_map_obj, ZDC.MAP_CLICK, function(){ var latlon = itsmo.search.g_map_obj.getClickLatLon(); itsmo.search.g_map_obj.moveLatLon(latlon); }); // ココアイコン e = new ZDC.UserWidget(latlon, { size: new ZDC.WH(22, 34), html: '', offset: new ZDC.Pixel(-10, -29) }); itsmo.search.g_map_obj.addWidget(e); e.open(); // +ボタン var sz = new ZDC.WH(44, 44); e = new ZDC.StaticUserWidget({ top: 8, left: 8}, { html: '
', size: sz }); itsmo.search.g_map_obj.addWidget(e); e.open(); // -ボタン e = new ZDC.StaticUserWidget({ top: 51, left: 8}, { html: '', size: sz }); itsmo.search.g_map_obj.addWidget(e); e.open(); }; /** 地域情報画面 */ itsmo.search.g_map_obj = null; itsmo.search.areainfo_init = function() { var s = $('#latlon').val().split(','); var lat = parseInt(s[0], 10); var lon = parseInt(s[1], 10); var latlon = {latlon: itsmo.lib.toLatLon(lat, lon)}; ZDC.Search.getWeatherTwoDays(latlon, function(code, result) { var e = $('#idWeather'); if ('000' != code.code || result.item.length <= 0) { e.fadeOut('fast'); return; } result = result.item[0]; e.find('img:first').attr('alt', result.weatherName).attr('src', result.weatherIconUrl).show(); e.find('strong:first').text(result.weatherName); e.find('span.highest').text(null == result.maxTemperature ? '-' : ('' + result.maxTemperature)); e.find('span.lowest').text(null == result.minTemperature ? '-' : ('' + result.minTemperature)); e.find('span.rainpercent').text('' + result.rainPercent); }); if (typeof ZDC === 'undefined' || typeof ZDC.Map === 'undefined') { return; } var lvl = 9; ZDC._TILE_PATHS["4"] = ZDC._TILE_PATHS["24"]; latlon = itsmo.lib.toLatLon(lat, lon); itsmo.search.g_map_obj = new ZDC.Map( $('#idMap').get(0), { mapType: ZDC.MAPTYPE_COLOR, latlon: latlon, zoom: lvl } ); itsmo.search.g_map_obj.dragOn(); itsmo.search.g_map_obj.zoomOn(); // クリック地点を地図の中心点として移動 ZDC.addListener(itsmo.search.g_map_obj, ZDC.MAP_CLICK, function(){ var latlon = itsmo.search.g_map_obj.getClickLatLon(); itsmo.search.g_map_obj.moveLatLon(latlon); }); }; itsmo.search.initDetailTabMap = function(url) { if (typeof ZDC === 'undefined' || typeof ZDC.Map === 'undefined') { return; } var e = $('#idMapLatLon').val().split(','); var lat = parseInt(e[0], 10) / (60 * 60 * 1000); var lon = parseInt(e[1], 10) / (60 * 60 * 1000); var latlon = new ZDC.LatLon(lat, lon); var lvl = 13; ZDC._TILE_PATHS["4"] = ZDC._TILE_PATHS["24"]; itsmo.search.g_map_obj = new ZDC.Map( $('#idMap').get(0), { mapType: ZDC.MAPTYPE_COLOR, latlon: latlon, zoom: lvl } ); itsmo.search.g_map_obj.dragOn(); itsmo.search.g_map_obj.zoomOn(); // クリック地点を地図の中心点として移動 ZDC.addListener(itsmo.search.g_map_obj, ZDC.MAP_CLICK, function(){ var latlon = itsmo.search.g_map_obj.getClickLatLon(); itsmo.search.g_map_obj.moveLatLon(latlon); }); // ココアイコン e = new ZDC.UserWidget(latlon, { size: new ZDC.WH(22, 34), html: '', offset: new ZDC.Pixel(-10, -29) }); itsmo.search.g_map_obj.addWidget(e); e.open(); // +ボタン var sz = new ZDC.WH(44, 44); e = new ZDC.StaticUserWidget({ top: 8, left: 8}, { html: '', size: sz }); itsmo.search.g_map_obj.addWidget(e); e.open(); // -ボタン e = new ZDC.StaticUserWidget({ top: 51, left: 8}, { html: '', size: sz }); itsmo.search.g_map_obj.addWidget(e); e.open(); }; itsmo.search.initDetailTabSpotInfo = function(url) { itsmo.search.initDetailTabMap(url); var latlons = []; $('div.basic-1col-syuhen li').each(function() { var e = $(this); var s = e.find('input:hidden').val().split('_', 3); if (s.length != 3) { return; } s[0] = parseInt(s[0], 10) / (60 * 60 * 1000); s[1] = parseInt(s[1], 10) / (60 * 60 * 1000); s[2] = decodeURIComponent(s[2]).replace('"', '"'); s[0] = new ZDC.LatLon(s[0], s[1]); var url = e.find('a').attr('href'); var f = new ZDC.UserWidget(s[0], { size: new ZDC.WH(22, 34), html: '' + e.find('span.syuhen-num').text() + '', offset: new ZDC.Pixel(-11, -34 + 3) }); itsmo.search.g_map_obj.addWidget(f); f.open(); latlons.push(s[0]); }); latlons = itsmo.search.g_map_obj.getAdjustZoom(latlons, true); itsmo.search.g_map_obj.setZoom(latlons.zoom); }; //天気 itsmo.search.weather = function() {}; //曜日配列 itsmo.search.weather.daysNameStr = [ '日', '月', '火', '水', '木', '金', '土' ]; // 天気コード配列 itsmo.search.weather.codes = {}; itsmo.search.weather.codes['01'] = { nm: '晴れ(昼)', _class: 'fine'}; itsmo.search.weather.codes['02'] = { nm: '晴れ(夜)', _class: 'star'}; itsmo.search.weather.codes['03'] = { nm: '曇り', _class: 'cloudy'}; itsmo.search.weather.codes['04'] = { nm: '雪', _class: 'snow'}; itsmo.search.weather.codes['05'] = { nm: '雨', _class: 'rain'}; itsmo.search.weather.codes['100'] = { nm: '晴れ', _class: ''}; itsmo.search.weather.codes['101'] = { nm: '晴れ時々曇り', _class: ''}; itsmo.search.weather.codes['100'] = { nm: '晴れ', _class: ''}; itsmo.search.weather.codes['102'] = { nm: '晴れ一時雨', _class: ''}; itsmo.search.weather.codes['103'] = { nm: '晴れ時々雨', _class: ''}; itsmo.search.weather.codes['104'] = { nm: '晴れ一時雪', _class: ''}; itsmo.search.weather.codes['105'] = { nm: '晴れ時々雪', _class: ''}; itsmo.search.weather.codes['111'] = { nm: '晴れのち曇り', _class: ''}; itsmo.search.weather.codes['114'] = { nm: '晴れのち雨', _class: ''}; itsmo.search.weather.codes['117'] = { nm: '晴れのち雪', _class: ''}; itsmo.search.weather.codes['200'] = { nm: '曇り', _class: ''}; itsmo.search.weather.codes['201'] = { nm: '曇り時々晴れ', _class: ''}; itsmo.search.weather.codes['202'] = { nm: '曇り一時雨', _class: ''}; itsmo.search.weather.codes['203'] = { nm: '曇り時々雨', _class: ''}; itsmo.search.weather.codes['204'] = { nm: '曇り一時雪', _class: ''}; itsmo.search.weather.codes['205'] = { nm: '曇り時々雪', _class: ''}; itsmo.search.weather.codes['209'] = { nm: '霧', _class: ''}; itsmo.search.weather.codes['211'] = { nm: '曇りのち晴れ', _class: ''}; itsmo.search.weather.codes['214'] = { nm: '曇りのち雨', _class: ''}; itsmo.search.weather.codes['217'] = { nm: '曇りのち雪', _class: ''}; itsmo.search.weather.codes['300'] = { nm: '雨', _class: ''}; itsmo.search.weather.codes['301'] = { nm: '雨時々晴れ', _class: ''}; itsmo.search.weather.codes['302'] = { nm: '雨時々やむ', _class: ''}; itsmo.search.weather.codes['303'] = { nm: '雨時々雪', _class: ''}; itsmo.search.weather.codes['304'] = { nm: '雨もしくは雪', _class: ''}; itsmo.search.weather.codes['309'] = { nm: '雨一時雪', _class: ''}; itsmo.search.weather.codes['311'] = { nm: '雨のち晴れ', _class: ''}; itsmo.search.weather.codes['313'] = { nm: '雨のち曇り', _class: ''}; itsmo.search.weather.codes['315'] = { nm: '雨のち雪', _class: ''}; itsmo.search.weather.codes['340'] = { nm: '雪もしくは雨', _class: ''}; itsmo.search.weather.codes['400'] = { nm: '雪', _class: ''}; itsmo.search.weather.codes['401'] = { nm: '雪時々晴れ', _class: ''}; itsmo.search.weather.codes['402'] = { nm: '雪時々やむ', _class: ''}; itsmo.search.weather.codes['403'] = { nm: '雪時々雨', _class: ''}; itsmo.search.weather.codes['409'] = { nm: '雪一時雨', _class: ''}; itsmo.search.weather.codes['411'] = { nm: '雪のち晴れ', _class: ''}; itsmo.search.weather.codes['413'] = { nm: '雪のち曇り', _class: ''}; itsmo.search.weather.codes['414'] = { nm: '雪のち雨', _class: ''}; itsmo.search.weather.codes['999'] = { nm: '不明', _class: ''}; // 天気コード取得 itsmo.search.weather.getCodes = function() { return itsmo.search.weather.codes; }; itsmo.search.weather.getTenkiImgUrl = function(code) { var s = itsmo.search.weather.getCodes(); s = s[code]; if (undefined == s || null == s) { return null; } return '/design/img/weath/' + code + '.gif'; } itsmo.search.weather.getTenkiText = function(code) { var s = itsmo.search.weather.getCodes(); s = s[code]; if (undefined == s || null == s) { return null; } return s.nm; } // 天気のhtmlを取得 itsmo.search.weather.getTenkiHtml = function(code, isAddName) { var s = itsmo.search.weather.getCodes(); s = s[code]; if (undefined == s || null == s) { s = '不明'; } else { var nm = s.nm; if ('' == s._class) { s = '