function initWebsite(){if(vaccDataset=JSON.parse($("#VaccData").text()),typeof TGOS!="undefined"){if(initMap("TGOS"),tgMap){$(document).keydown(function(n){curMap=="TGOS"&&(n.ctrlKey?tgMap.setOptions({scrollwheel:!0}):tgMap.setOptions({scrollwheel:!1}))});$(document).keyup(function(){curMap=="TGOS"&&tgMap.setOptions({scrollwheel:!1})});$("#TGMap").on("wheel",function(n){curMap=="TGOS"&&(n.ctrlKey||($("#ScrollHint").show(),setTimeout(function(){$("#ScrollHint").hide()},1e3)))})}}else document.getElementById("hint").innerHTML="<span class='glyphicon glyphicon-warning-sign' style='color:red;'><\/span> 初始地圖載入失敗",document.getElementById("hintLoader").style.display="none"}function initMap(n){var u,t,i,r;n=="TGOS"?(curMap="TGOS",t=document.getElementById("TGMap"),u={disableDefaultUI:!1,mapTypeControl:!1,scrollwheel:!1},tgMap=new TGOS.TGOnlineMap(t,TGOS.TGCoordSys.EPSG3857,u),getCurrentLocation("TGOS"),TGOS.TGEvent.addListener(tgMap,"idle",function(){updateMarkerDataset("TGOS")})):n=="GOOGLE"&&(curMap="GOOGLE",t=document.getElementById("GMap"),tgMap?(i=tgMap.getCenter(),r=tgMap.getZoom()):(currentLocation||(currentLocation=taipei),i={x:currentLocation.lng(),y:currentLocation.lat()},r=15),gMap=new google.maps.Map(t,{gestureHandling:"cooperative",zoom:r,center:new google.maps.LatLng(i.y,i.x)}),getCurrentLocation("GOOGLE"),gMap.addListener("idle",function(){updateMarkerDataset("GOOGLE")}));document.getElementById("hint").innerHTML="";document.getElementById("hintLoader").style.display="none"}function getCurrentLocation(n){function t(n){n=="TGOS"?(tgMap.setCenter(new TGOS.TGPoint(currentLocation.lng(),currentLocation.lat())),tgMap.setZoom(15),updateMarkerDataset("TGOS"),loadMarkers("TGOS")):n=="GOOGLE"&&(gMap.setCenter(currentLocation),gMap.setZoom(15),updateMarkerDataset("GOOGLE"),loadMarkers("GOOGLE"))}function i(n){var t,r,i;n=="TGOS"?(t=new TGOS.TGPoint(currentLocation.lng(),currentLocation.lat()),r=new TGOS.TGMarker(tgMap,t,"目前位置",cdc_icon,markerOptions),r.setVisible(!0),tgCurInfoWindow?tgCurInfoWindow.open(tgMap):(tgCurInfoWindow=new TGOS.TGInfoWindow("您在這裡",t,infoWindowOptions),tgCurInfoWindow.open(tgMap))):n=="GOOGLE"&&(i=new google.maps.Marker({title:"目前位置",position:currentLocation,map:gMap,icon:"/Image/dc_marker2.png"}),gCurInfowindow?gCurInfowindow.open(gMap,i):(gCurInfowindow=new google.maps.InfoWindow({content:"您在這裡",disableAutoPan:!0}),gCurInfowindow.open(gMap,i)))}currentLocation?(t(n),i(n)):navigator.geolocation?navigator.geolocation.getCurrentPosition(function(r){currentLocation=new google.maps.LatLng(r.coords.latitude,r.coords.longitude);t(n);i(n)},function(){alert("地圖定位失敗，將為您定位至疾管署");currentLocation=taipei;t(n);i(n)}):(alert("您的瀏覽器不支援定位服務"),currentLocation=taipei,t(n),i(n))}function loadMarkers(n){var t;if(document.getElementById("main").style.cursor="wait",document.getElementById("loadHint").style.display="block",n=="TGOS")for(t=0;t<markerDataset.length;t++)addTGMarker(markerDataset[t]);else if(n=="GOOGLE")for(t=0;t<markerDataset.length;t++)addGMarker(markerDataset[t]);setMarkersVisible();document.getElementById("main").style.cursor="default";document.getElementById("loadHint").style.display="none"}function updateMarkerDataset(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;updateTimeout||(document.getElementById("loadHint").style.display="block",updateTimeout=setTimeout(function(){"use strict";var u=markerDataset.map(function(n){return n.Id}),i=initialBounds,r;n=="TGOS"?tgMap&&(i=tgMap.getBounds()):n=="GOOGLE"&&gMap&&gMap.getBounds()!=null&&(r=gMap.getBounds().toJSON(),i.left=r.west,i.right=r.east,i.top=r.north,i.bottom=r.south);$.ajax({url:"/Home/GetHospitalData",type:"POST",data:{ids:u,bottom:i.bottom,left:i.left,right:i.right,top:i.top},async:!1,success:function(i){var r=i;r&&r.length>0&&r.forEach(function(n){if(!t||n.Id!=t){var i={Id:n.Id,HospitalId:n.HospitalId,HospitalName:n.HospitalName,City:n.City,Dist:n.Dist,ZipCode:n.ZipCode,Address:n.Address,Phone:n.Phone,Lat:n.Lat,Long:n.Long,Note:n.Note,Vaccines:n.Vaccines,OpenTime:n.OpenTime,OpenTime_Travel:n.OpenTime_Travel,IsTravel:n.IsTravel,IsExaminationCounter:n.IsExaminationCounter,InfoWindowMessage:n.InfoWindowMessage,tgMarker:null,gMarker:null,tgInfoWindow:null,gInfoWindow:null};i.Lat&&i.Long||typeof TGOS!="undefined"&&mkLocateAddress(i);markerDataset.push(i)}});loadMarkers(n)},error:function(){}});updateTimeout=null;document.getElementById("loadHint").style.display="none"},delayTime))}function addTGMarker(n){var t,r,i;n.tgMarker||(t=n.OpenTime.Morning!=null&&n.OpenTime.Afternoon!=null&&n.OpenTime.Night!=null?n.OpenTime.Morning||n.OpenTime.Afternoon||n.OpenTime.Night?new TGOS.TGMarker(tgMap,new TGOS.TGPoint(n.Long,n.Lat),n.HospitalName,icon,markerOptions):new TGOS.TGMarker(tgMap,new TGOS.TGPoint(n.Long,n.Lat),n.HospitalName,gray_icon,markerOptions):new TGOS.TGMarker(tgMap,new TGOS.TGPoint(n.Long,n.Lat),n.HospitalName,orange_icon,markerOptions),t.setVisible(!0),r=n.InfoWindowMessage,i=new TGOS.TGInfoWindow(r,new TGOS.TGPoint(n.Long,n.Lat),infoWindowOptions),TGOS.TGEvent.addListener(t,"mouseover",function(){t.setCursor("pointer")}),TGOS.TGEvent.addListener(t,"mousedown",function(){preTGInfoWindow?(preTGInfoWindow.close(tgMap),preTGInfoWindow=i):preTGInfoWindow=i;setTimeout(function(){var f={x:tgMap.getCenter().x,y:tgMap.getCenter().y},t={x:n.Long,y:n.Lat},r=tgMap.getBounds(),e=tgMap.getMapSize(),o=i.getElement(),u;e.width/2<=o.offsetWidth&&(t.x=n.Long+(r.right-r.left)/2);e.height/2-135<=o.offsetHeight&&(t.y=n.Lat+(r.top-r.bottom)*.4);tgTransformSys.wgs84totwd97(f.x,f.y);u=tgTransformSys.transResult;tgTransformSys.wgs84totwd97(t.x,t.y);var s=tgTransformSys.transResult,h=s.x-u.x,c=s.y-u.y;tgMap.panBy(h,c)},300);i.open(tgMap)}),n.tgMarker=t,n.tgInfoWindow=i,t.data=n,tgMarkers.push(t))}function addGMarker(n){var t,r,i;n.gMarker||(t=n.OpenTime.Morning!=null&&n.OpenTime.Afternoon!=null&&n.OpenTime.Night!=null?n.OpenTime.Morning||n.OpenTime.Afternoon||n.OpenTime.Night?new google.maps.Marker({title:n.HospitalName,position:{lat:n.Lat,lng:n.Long},map:gMap,icon:"/Image/mark.png"}):new google.maps.Marker({title:n.HospitalName,position:{lat:n.Lat,lng:n.Long},map:gMap,icon:"/Image/graymark.png"}):new google.maps.Marker({title:n.HospitalName,position:{lat:n.Lat,lng:n.Long},map:gMap,icon:"/Image/orangemark.png"}),r=n.InfoWindowMessage,i=new google.maps.InfoWindow({content:r,disableAutoPan:!1}),t.addListener("mousedown",function(){preGInfoWindow?(preGInfoWindow.close(),preGInfoWindow=i):preGInfoWindow=i;gMap.panTo(new google.maps.LatLng(n.Lat,n.Long));i.open(gMap,t)}),n.gMarker=t,n.gInfoWindow=i,t.data=n,gMarkers.push(t))}function locateTGDistrict(n){if(tgMap&&typeof TGOS!="undefined"){var t=new TGOS.TGLocateService;tgFill&&tgFill.setMap(null);t.locateWGS84({district:n},function(t,i){if(i!=TGOS.TGLocatorStatus.OK){alert("查無行政區");return}switch(n){case"臺北市":tgMap.fitBounds(taipeiBounds);break;case"基隆市":tgMap.fitBounds(keelungBounds);break;case"新北市":tgMap.fitBounds(newTaipeiBounds);break;case"新竹市":tgMap.fitBounds(hsinchuCityBounds);break;case"新竹縣":tgMap.fitBounds(hsinchuCountyBounds);break;case"桃園市":tgMap.fitBounds(taoyuanBounds);break;case"苗栗縣":tgMap.fitBounds(miaoliBounds);break;case"臺中市":tgMap.fitBounds(taichungBounds);break;case"彰化縣":tgMap.fitBounds(changhuaBounds);break;case"南投縣":tgMap.fitBounds(nantouBounds);break;case"雲林縣":tgMap.fitBounds(yunlinBounds);break;case"嘉義市":tgMap.fitBounds(chiayiCityBounds);break;case"嘉義縣":tgMap.fitBounds(chiayiCountyBounds);break;case"臺南市":tgMap.fitBounds(tainanBounds);break;case"高雄市":tgMap.fitBounds(kaohsiungBounds);break;case"屏東縣":tgMap.fitBounds(pingtungBounds);break;case"宜蘭縣":tgMap.fitBounds(yilanBounds);break;case"臺東縣":tgMap.fitBounds(taitungBounds);break;case"花蓮縣":tgMap.fitBounds(hualienBounds);break;case"澎湖縣":tgMap.fitBounds(penghuBounds);break;case"金門縣":tgMap.fitBounds(kinmenBounds);break;case"連江縣":tgMap.fitBounds(lienchiangBounds);break;default:tgMap.fitBounds(t[0].geometry.viewport)}var r=t[0].geometry.geometry;tgFill=new TGOS.TGFill(tgMap,r,{fillColor:"#00AAAA",fillOpacity:.2,strokeColor:"#009090",strokeWeight:5,strokeOpacity:1});tgFill.setZIndex(-1)})}}function locateGDistrict(n){if(gMap&&typeof TGOS!="undefined"){var t=new TGOS.TGLocateService;gFill&&gFill.setMap(null);t.locateWGS84({district:n},function(t,r){var u,e;if(r!=TGOS.TGLocatorStatus.OK){alert("查無行政區");return}u=null;switch(n){case"臺北市":u=taipeiBounds;break;case"基隆市":u=keelungBounds;break;case"新北市":u=newTaipeiBounds;break;case"新竹市":u=hsinchuCityBounds;break;case"新竹縣":u=hsinchuCountyBounds;break;case"桃園市":u=taoyuanBounds;break;case"苗栗縣":u=miaoliBounds;break;case"臺中市":u=taichungBounds;break;case"彰化縣":u=changhuaBounds;break;case"南投縣":u=nantouBounds;break;case"雲林縣":u=yunlinBounds;break;case"嘉義市":u=chiayiCityBounds;break;case"嘉義縣":u=chiayiCountyBounds;break;case"臺南市":u=tainanBounds;break;case"高雄市":u=kaohsiungBounds;break;case"屏東縣":u=pingtungBounds;break;case"宜蘭縣":u=yilanBounds;break;case"臺東縣":u=taitungBounds;break;case"花蓮縣":u=hualienBounds;break;case"澎湖縣":u=penghuBounds;break;case"金門縣":u=kinmenBounds;break;case"連江縣":u=lienchiangBounds;break;default:u=t[0].geometry.viewport}e=new google.maps.LatLngBounds(new google.maps.LatLng(u.bottom,u.left),new google.maps.LatLng(u.top,u.right));gMap.fitBounds(e);gMap.setZoom(gMap.getZoom()+1);var s=t[0].geometry.geometry,f=s.toGeoJson().coordinates[0],o=[];for(i=0;i<f.length;i++)o[i]={lat:f[i][1],lng:f[i][0]};gFill=new google.maps.Polygon({paths:o,fillColor:"#00AAAA",fillOpacity:.2,strokeColor:"#009090",strokeWeight:5,strokeOpacity:1});gFill.setMap(gMap)})}}function mkLocateAddress(n){locator.locateTWD97({address:n.address},function(t,i){i==TGOS.TGLocatorStatus.OK&&(n.Lat=t[0].geometry.location.y,n.Long=t[0].geometry.location.x)})}function setMapCenter(n,t,i){if(curMap=="GOOGLE"){if(!gMap)return;gMap.setCenter({lat:n,lng:t});i>0&&gMap.setZoom(i)}else{if(!tgMap)return;tgMap.setCenter({x:t,y:n});i>0&&tgMap.setZoom(i)}$("#hpModal .close").click()}function openInfoWindow(n){"use strict";var t=markerDataset.find(function(t){return t.Id==n});if(t)if(setMapCenter(t.Lat,t.Long,14),curMap=="GOOGLE"){if(!gMap)return;preGInfoWindow!=null&&preGInfoWindow.close();t.gInfoWindow.open(gMap,t.gMarker);preGInfoWindow=t.gInfoWindow}else{if(tgMap==null)return;preTGInfoWindow!=null&&preTGInfoWindow.close(tgMap);t.tgInfoWindow.open(tgMap);preTGInfoWindow=t.tgInfoWindow}else $.ajax({url:"/Home/GetHospitalOne",type:"POST",data:{id:n},async:!1,success:function(n){var t={Id:n.Id,HospitalId:n.HospitalId,HospitalName:n.HospitalName,City:n.City,Dist:n.Dist,ZipCode:n.ZipCode,Address:n.Address,Phone:n.Phone,Lat:n.Lat,Long:n.Long,Note:n.Note,Vaccines:n.Vaccines,OpenTime:n.OpenTime,OpenTime_Travel:n.OpenTime_Travel,IsTravel:n.IsTravel,IsExaminationCounter:n.IsExaminationCounter,InfoWindowMessage:n.InfoWindowMessage,tgMarker:null,gMarker:null,tgInfoWindow:null,gInfoWindow:null};if(t.Lat&&t.Long||typeof TGOS!="undefined"&&mkLocateAddress(t),markerDataset.push(t),curMap=="GOOGLE"){if(!gMap)return;addGMarker(t);preGInfoWindow!=null&&preGInfoWindow.close();t.gInfoWindow.open(gMap,t.gMarker);preGInfoWindow=t.gInfoWindow}else{if(tgMap==null)return;addTGMarker(t);preTGInfoWindow!=null&&preTGInfoWindow.close(tgMap);t.tgInfoWindow.open(tgMap);preTGInfoWindow=t.tgInfoWindow}setMapCenter(n.Lat,n.Long,14)},error:function(){}});$("#hpModal .close").click()}function routeDirection(n,t){currentLocation||(currentLocation=taipei);current=currentLocation.lat()+","+currentLocation.lng();target=n+","+t;website="https://www.google.com.tw/maps/dir/"+current+"/"+target+"/";window.open(website,"_blank")}function setCurrentMapType(n){var t,r,i,u;if(n||(n="TGOSMAP"),n=="GOOGLE")curMap="GOOGLE",$("#GMap").show(),$("#TGMap").hide(),gMap||initMap("GOOGLE"),gMap&&(tgMap&&(t=tgMap.getCenter(),r=tgMap.getZoom(),gMap.setCenter({lat:t.y,lng:t.x}),gMap.setZoom(r)),loadMarkers("GOOGLE"));else{if(tgMap==null)return;loadMarkers("TGOS");curMap="TGOS";$("#GMap").hide();$("#TGMap").show();tgMap.setMapTypeId(n);gMap!=null&&(i=gMap.getCenter(),u=gMap.getZoom(),tgMap.setCenter({x:i.lng(),y:i.lat()}),tgMap.setZoom(u))}tgFill&&tgFill.setMap(null);gFill&&gFill.setMap(null);preGInfoWindow!=null&&(preGInfoWindow.close(),preGInfoWindow=null);preTGInfoWindow!=null&&(preTGInfoWindow.close(tgMap),preTGInfoWindow=null)}function setModalData(n,t){$("#SubTitle").val(n);$("#SubAddress").val(t)}function changeCity(n){if(n){$("#ulCityTitle").html(n+" <span class='caret'><\/span>");$("#ulDistrictTitle").html("行政區 <span class='caret'><\/span>");$("#SearchHPTitle").text("您目前搜尋："+n);$("#searchSelectCity").val(n);$("#searchSelectCity").change();var i=$("#ulMapTypeTitle").val(),t=$("#searchSelectCity").val()+$("#searchSelectDistrict").val();i==="GOOGLE"?locateGDistrict(t):locateTGDistrict(t);$.ajax({url:"/Home/TaiwanAreaDropDownList",type:"POST",data:{parentName:n},async:!1,success:function(n){$("#ulDistrict").empty();$("#ulDistrict").append("<li><a href='#' onclick=\"changeDistrict('')\">行政區<\/a><\/li>");$.each(n,function(n,t){$("#ulDistrict").append("<li><a href='#' onclick=\"changeDistrict('"+t.Value+"')\">"+t.Text+"<\/a><\/li>")})},error:function(){return $("#ulDistrict").empty(),$("#ulDistrict").append("<li><a href='#' onclick=\"changeDistrict('')\">行政區<\/a><\/li>"),!1}})}else $("#ulCityTitle").html("縣市別 <span class='caret'><\/span>"),$("#ulDistrictTitle").html("行政區 <span class='caret'><\/span>"),$("#ulDistrict").empty(),$("#ulDistrict").append("<li><a href='#' onclick=\"changeDistrict('')\">行政區<\/a><\/li>"),$("#SearchHPTitle").text("　"),$("#searchSelectCity").val(""),$("#searchSelectCity").change()}function changeDistrict(n){if($("#searchSelectDistrict").val(n),n){$("#ulDistrictTitle").html(n+" <span class='caret'><\/span>");$("#SearchHPTitle").text("您目前搜尋："+n);$("#searchSelectDistrict").val(n);$("#searchSelectDistrict").change();var i=$("#ulMapTypeTitle").val(),t=$("#searchSelectCity").val()+$("#searchSelectDistrict").val();i==="GOOGLE"?locateGDistrict(t):locateTGDistrict(t)}else $("#ulDistrictTitle").html("行政區 <span class='caret'><\/span>"),$("#SearchHPTitle").text("您目前搜尋："+$("#searchSelectCity").val()),$("#searchSelectDistrict").val(""),$("#searchSelectDistrict").change();$("#myNavbar").collapse("hide")}function changeMapType(n){$("#ulMapTypeTitle").html(mtypes[n]+" <span class='caret'><\/span>");$("#ulMapTypeTitle").val(n);$("#myNavbar").collapse("hide");setCurrentMapType(n)}function selectFluObjs(n){for(var i,r,o,u,f=!0,t=0;t<vaccDataset.length+2;t++){var i=t,r="#select_"+i,e=$(r).attr("class");if(e!="active"){f=!1;break}}if(f){for(t=0;t<vaccDataset.length+2;t++)i=t,r="#select_"+i,$(r).removeClass("active");$("#selectAll").removeClass("active");$("#"+n.id).addClass("active")}else{for(o=$("#"+n.id).attr("class"),o=="active"?$("#"+n.id).removeClass("active"):$("#"+n.id).addClass("active"),u=!0,t=0;t<vaccDataset.length+2;t++){var i=t,r="#select_"+i,e=$(r).attr("class");if(e!="active"){u=!1;break}}u?$("#selectAll").addClass("active"):$("#selectAll").removeClass("active")}setMarkersVisible();$("#selectFluObjsHint").show()}function setMarkersVisible(){var c=$("#select_0").attr("class"),f=c=="active",n,r,i,t,u;if(tgMarkers)for(n=0;n<tgMarkers.length;n++){for(r=tgMarkers[n].data.Vaccines,i=!1,t=0;t<vaccDataset.length;t++){var e=t+2,o="#select_"+e,s=$(o).attr("class"),h=vaccDataset[t],u=r.find(function(n){return n.Name==h.Name});s=="active"&&u&&(tgMarkers[n].setVisible(!0),i=!0);f==!0&&tgMarkers[n].data.IsTravel==!0&&(tgMarkers[n].setVisible(!0),i=!0)}i||tgMarkers[n].setVisible(!1)}if(gMarkers)for(n=0;n<gMarkers.length;n++){for(r=gMarkers[n].data.Vaccines,i=!1,t=0;t<vaccDataset.length;t++){var e=t+2,o="#select_"+e,s=$(o).attr("class"),h=vaccDataset[t];u=r.find(function(n){return n.Name==h.Name});s=="active"&&u&&(gMarkers[n].setVisible(!0),i=!0);f==!0&&gMarkers[n].data.IsTravel==!0&&(gMarkers[n].setVisible(!0),i=!0)}i||gMarkers[n].setVisible(!1)}}function searchHospital(){var n=document.getElementById("SearchValue").value,t=document.getElementById("searchSelectCity").value,i=document.getElementById("searchSelectDistrict").value,r=encodeURI("/Home/SearchHospital?SearchValue="+n+"&City="+t+"&District="+i);$("#hospitalList").empty();document.getElementById("dataNumber").innerHTML="<center>請稍後，資料載入中 <div class='loader'><\/div><\/center>";$.ajax({type:"POST",url:r}).done(function(n){var i=JSON.parse(n),u,e,o,f;if(i!="")for(document.getElementById("dataNumber").innerHTML=i.length>1e3?"<center>總共有 "+i.length+" 家醫療院所符合條件<br /><span style='color:red;'>本次搜尋結果的資料量較多，可能會使網頁速度下降，敬請見諒<\/span><\/center>":"<center>總共有 "+i.length+" 家醫療院所符合條件<\/center>",u=0;u<i.length;u++){var r=i[u],s=i[u].Vaccines,t="<div class='searchResult'>";for(t+="<h4 class='pointer' onmousedown=\"openInfoWindow('"+r.Id+"')\">"+r.HospitalName+"<\/h4>",t+="<p><a href='#' onclick='routeDirection("+r.Lat+","+r.Long+", 15)'><span class='glyphicon glyphicon-send'><\/span> "+r.Address+"<\/a><\/p>",t+="<p><a href='tel:"+r.Phone+"'><span class='glyphicon glyphicon-earphone'><\/span> "+r.Phone+"<\/a><\/p>",e=0;e<vaccDataset.length;e++){if(o=vaccDataset[e],f=s.find(function(n){return n.Name==o.Name}),t+=o.Name,o.IsActiveNum==!0)if(f&&f.StockLevel!=null)switch(f.StockStatus){case 1:t+="：<span style='color:red;'>調度中<\/span>";break;case 2:t+="：<span style='color:orange;'>尚可<\/span>";break;case 3:t+="：<span style='color:green;'>充足<\/span>";break;default:t+="：<span class='glyphicon glyphicon-remove-sign' style='color:#6D758D;'>查無庫存<\/span>"}else t+="：<span class='glyphicon glyphicon-remove-sign' style='color:#6D758D;'>查無庫存<\/span>";else t+=f?"：<span class='glyphicon glyphicon-ok-sign' style='color:green;'><\/span>":"：<span class='glyphicon glyphicon-remove-sign' style='color:red;'><\/span>";t+="<br />"}t+="<\/div><hr />";$("#hospitalList").append(t)}else document.getElementById("dataNumber").innerHTML="<center>總共有 0 家醫療院所符合條件<\/center>",$("#hospitalList").append("<div class='searchResult'><h4>查無資料<\/h4><\/div>")})}var updateSelete=function(n){const u=n.url,f=n.data,t=n.targetId,i=n.selValue;let r=n.defText;if(typeof u=="undefined"||typeof t=="undefined"||typeof f=="undefined")return!1;typeof r=="undefined"&&(r="-請選擇-");$("#"+t).empty();$("#"+t).append($("<option><\/option>").val("").text(r));$.ajax({url:u,type:"POST",data:f,async:!1,success:function(n){$.each(n,function(n,r){i!==null&&i!=="undefined"&&r.Value===i?$("#"+t).append("<option selected value='"+r.Value+"'>"+r.Text+"<\/option>"):$("#"+t).append("<option value='"+r.Value+"'>"+r.Text+"<\/option>")})},error:function(){return!1}})},tgMap,gMap,curMap="TGOS",markerDataset=[],vaccDataset=[],taipei=new google.maps.LatLng(25.0434,121.522754),initialBounds={left:121.48676948385628,right:121.55873851614388,top:25.05975404069282,bottom:25.027043778002639},currentLocation=null,preTGInfoWindow=null,preGInfoWindow=null,tgMarkers=[],gMarkers=[],taipeiBounds={left:121.23143599526608,right:121.88477952391396,top:25.233506822678628,bottom:24.953369017880267},keelungBounds={left:121.5495403486894,right:121.87621211301337,top:25.189780429387774,bottom:25.049741526517636},newTaipeiBounds={left:120.73343629045634,right:122.38138633644158,top:25.35536788819066,bottom:24.654678949285405},hsinchuCityBounds={left:120.60043037527217,right:121.25377390392005,top:24.931138622705863,bottom:24.650311624632518},hsinchuCountyBounds={left:120.50142936894707,right:121.80811642624283,top:24.987647660541878,bottom:24.425615936385586},taoyuanBounds={left:120.57198937457773,right:121.87867643187349,top:25.15556222717553,bottom:24.594292475890146},miaoliBounds={left:120.27454315306849,right:121.59290318985664,top:24.796150135864572,bottom:24.233255354817377},taichungBounds={left:120.29979198610906,right:121.60647904340482,top:24.501459487725739,bottom:23.937248940217223},changhuaBounds={left:119.79780010610308,right:121.10448716339887,top:24.278387382305279,bottom:23.713190828199703},nantouBounds={left:119.674279142803,right:122.28765325739457,top:24.405588159728659,bottom:23.273847773698169},yunlinBounds={left:119.71178975545314,right:121.0184768127489,top:23.934949413772674,bottom:23.368251685482345},chiayiCityBounds={left:120.28129882219218,right:120.61088883138923,top:23.554445106643215,bottom:23.412588509275338},chiayiCountyBounds={left:119.75681586891727,right:121.07517590570545,top:23.734892322436078,bottom:23.167329583354675},tainanBounds={left:119.6699033518493,right:120.98826338863745,top:23.455874815658287,bottom:22.887117287341514},kaohsiungBounds={left:119.37178407356529,right:121.98515818815686,top:23.598703564188806,bottom:22.460003279919498},pingtungBounds={left:119.34981140628535,right:121.96318552087692,top:23.021160846913,bottom:21.877619255464072},yilanBounds={left:120.34405972151055,right:122.95743383610211,top:25.246126049705918,bottom:24.12187766487304},taitungBounds={left:118.49894571859397,right:123.72568942474091,top:24.023556565881361,bottom:21.743857375576582},hualienBounds={left:118.85600466052351,right:124.08274836667044,top:25.007090882618037,bottom:22.7443949173363},penghuBounds={left:118.25689578303721,right:120.87026989762872,top:24.074759284108865,bottom:22.940137705146508},kinmenBounds={left:118.01189527997074,right:118.66523880861865,top:24.592339453470569,bottom:24.310749548180276},lienchiangBounds={left:119.52995476042105,right:120.83664181771681,top:26.465452012222734,bottom:25.910292467282908},icon,orange_icon,gray_icon,cdc_icon,markerOptions,infoWindowOptions,tgTransformSys,tgCurInfoWindow,gCurInfowindow,tgFill,gFill,mtypes;typeof TGOS!="undefined"&&(icon=new TGOS.TGImage("/Image/mark.png",new TGOS.TGSize(45,45),new TGOS.TGPoint(0,0),new TGOS.TGPoint(15,30)),orange_icon=new TGOS.TGImage("/Image/orangemark.png",new TGOS.TGSize(45,45),new TGOS.TGPoint(0,0),new TGOS.TGPoint(15,30)),gray_icon=new TGOS.TGImage("/Image/graymark.png",new TGOS.TGSize(45,45),new TGOS.TGPoint(0,0),new TGOS.TGPoint(15,30)),cdc_icon=new TGOS.TGImage("/Image/dc_marker2.png",new TGOS.TGSize(30,30),new TGOS.TGPoint(0,0),new TGOS.TGPoint(15,30)),markerOptions={flat:!0,draggable:!1},infoWindowOptions={maxWidth:640,pixelOffset:new TGOS.TGSize(5,-30),zIndex:99,disableAutoPan:!0},tgTransformSys=new TGOS.TGTransformation);var updateTimeout=null,delayTime=500,isIE=/*@cc_on!@*/!1||!!document.documentMode;isIE==!0&&(delayTime=1e3,document.getElementById("loadMessage").innerText="地圖更新中 (若您使用IE瀏覽器，可能需要等候較長的時間，敬請見諒)");tgFill=null;gFill=null;mtypes={"":"地圖顯示類型",TGOSMAP:"TGOS 地圖",GOOGLE:"Google 地圖",NLSCMAP:"通用版電子地圖",F2IMAGE:"福衛二號衛星影像",ROADMAP:"福衛混合地圖",HILLSHADEMIX:"地形暈渲混合地圖",HILLSHADE:"地形暈渲圖",IMAGENLSC:"航照圖"};$("#searchSelectCity").on("change",function(){"use strict";$(this).val()!==null&&$(this).val()!=="undefined"&&$(this).val()!==""?$("#SearchHPTitle").text("您目前搜尋："+$(this).val()):$("#SearchHPTitle").text("　");const n={url:"/Home/TaiwanAreaDropDownList",data:{parentName:$(this).val()},selValue:null,targetId:"searchSelectDistrict",defText:"行政區"};updateSelete(n)});$("#searchSelectDistrict").on("change",function(){var n=$("#searchSelectCity").val()+$("#searchSelectDistrict").val();$("#SearchHPTitle").text("您目前搜尋："+n)});if($("#searchSelectCity").val()!==undefined&&$("#searchSelectCity").val()!=="0"&&$("#searchSelectCity").val()!==""){const n={url:"/Home/TaiwanAreaDropDownList",data:{parentName:$("#searchSelectCity").val()},selValue:$("#PreTaiwanArea").val(),targetId:"searchSelectDistrict",defText:"行政區"};updateSelete(n)}$("#hpModal").on("hidden.bs.modal",function(){$("p[name=dataNumber]").text("");$("#hospitalList").empty()});$("#selectAll").on("click",function(){for(var t,i,n=0;n<vaccDataset.length+2;n++)t=n,i="#select_"+t,$(i).addClass("active");$(this).addClass("active");setMarkersVisible();$("#selectFluObjsHint").show();$("#logoName").text("流感防治一網通");$("#footerText").text("本資料來源為醫療院所每日回報，可能與實際情形有落差，建議接種前仍應電洽院所確認。如有相關疑問可撥打免付費防疫專線1922(或0800 - 001922)洽詢。")});$("#selectFluObjsHint").hide();$("#SearchName").on("click",searchHospital);$("#SearchValue").keypress(function(n){n.which==13&&searchHospital()});$("#downloadFile").on("click",function(){var n=document.getElementById("SearchValue").value,t=document.getElementById("searchSelectCity").value,i=document.getElementById("searchSelectDistrict").value;location.href="/Home/DownloadHospital?SearchValue="+n+"&City="+t+"&District="+i});$("#btnMainFeedback").on("click",function(){var n=document.getElementById("MainContact").value,t=document.getElementById("MainFeedback").value,i=encodeURI("/Home/Feedback?Contact="+n+"&Feedback="+t);$.ajax({type:"POST",url:i}).done(function(n){n!=""?alert(n):$("#mainModal .close").click()})});$("#btnSubFeedback").on("click",function(){var n=document.getElementById("SubTitle").value,t=document.getElementById("SubAddress").value,i=document.getElementById("SubContact").value,r=document.getElementById("SubFeedback").value,u=encodeURI("/Home/Feedback?Name="+n+"&Address="+t+"&Contact="+i+"&Feedback="+r);$.ajax({type:"POST",url:u}).done(function(n){n!=""?alert(n):$("#subModal .close").click()})});$("#mainModal,#hpModal,#selectModal,#infoModal").on("hidden.bs.modal",function(){$("#myNavbar").collapse("hide")});$("#selectModal").on("hidden.bs.modal",function(){$("#selectFluObjsHint").hide()});(function(n){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4)))&&(document.getElementById("downloadFile").style.display="none")})(navigator.userAgent||navigator.vendor||window.opera),function(n){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(n.substr(0,4)))&&(document.getElementById("hpHint").style.display="block")}(navigator.userAgent||navigator.vendor||window.opera)