var _UEXT_SCRIPT_ROOT = 'http://api.urmap.com/uext';UMap.prototype.findWithin=function(){var _UMap=this;var timer=null;var timeout=1000;var addMoveHandler=function(){_UMap.addListener('moveend',updateTimer);};var removeMoveHandler=function(){_UMap.removeListener('moveend',updateTimer);};var updateTimer=function(){if(timer)clearTimeout(timer);timer=setTimeout(send,timeout);};var send=function(){var centerLatlng=_UMap.getCenter();var url='http://www.urmap.com/TaiwanFindWithin/FindWithin?lat='+centerLatlng.lat()+'&lng='+centerLatlng.lng()+'&callback='+'Ubreadcrumb.changeMenu&file=.js';UGeneric.getScript(url);};addMoveHandler();};UMap.prototype.addDelayListener=function(d,h,e,a){if(!d){return}var h=h||1000;var e=typeof(e)==="string"?e:"moveend";var a=a?true:false;var f=this;var g=null;var c=f.getBounds();var b=function(){if(g){clearTimeout(g);g=null}if(a){var i=f.getCenter();if(c&&!c.contains(i)){g=setTimeout(function(){d();c=f.getBounds()},h)}}else{g=setTimeout(function(){d()},h)}};f.addListener(e,b);return b};UMap.prototype.adService=function(a){var k=this;var h=320;var m=false;var l,p;var d=UGeneric.getScript;var f="__getnd__";var j="http://ad.urmap.com/newad/get?size=100x200&";var c="http://ad.urmap.com/newad/refer?id=";var b=7;var o='<div class="ad"><a target="_blank" href="http://www.urmap.com/adservice/Advertise_01.html"><img border="0" src="http://www.urmap.com/newAd/imgs/goad.gif"/></a></div>';var e="__BINGO__";var n=[];var i=0;var g=true;(function(){var B=new UPoint(300,400);var G="UAD_box"+(+new Date());var D="UAD_content"+(+new Date());var A="UAD_pre"+(+new Date());var w="UAD_nxt"+(+new Date());var u="UAD_close"+(+new Date());var F=['<div class="head" >','<div class="title">本區快訊</div>',"</div>",'<div id="'+D+'" class="content">',"</div>",'<div class="footer" style="cursor:pointer">','<div id="'+u+'" class="close"></div>','<div id="'+A+'" class="first"><a href="javascript:void(0)" title="下一則廣告"> </a></div>','<div id="'+w+'" class="next"><a href="javascript:void(0)" title="前一則廣告"> </a></div>',"</div>"];l=document.createElement("div");var t=document.createElement("div");t.className="UAD_box_MIN";t.style.display="none";t.innerHTML='<div class="head_close">本區快訊</div>';l.id=G;l.className="UAD_box";l.innerHTML=F.join("");p=new UDom(l);DOM_Overlay2=new UDom(t);k.addStaticOverlay(p,URightBottom,new UPoint(5,0));k.addStaticOverlay(DOM_Overlay2,URightBottom,new UPoint(5,0));var x=document.getElementById(A);l.ondblclick=function(K){K=K||UEvent.getEvent(K);UEvent.stopPropagation(K)};t.ondblclick=function(){return false};x.onclick=function(){if(k.getZoomLevel()<b||!g){y(o)}else{var K=i-1;if(K<0){K=n.length-1}s(K)}return};var q=document.getElementById(w);q.onclick=function(){if(k.getZoomLevel()<b||!g){y(o)}else{var K=i+1;if(K>=n.length){C()}else{s(K)}}return};var z=document.getElementById(u);var I=function(){l.style.display="none";t.style.display="block";t.style.zIndex="1";return};var v=function(){l.style.display="block";t.style.display="none"};z.onclick=I;t.onclick=v;var C=function(){if(!g){y(o);return}var M=k.getBounds();var L=M.getSouthWest();var K=M.getNorthEast();var N=["minlat="+L.lat(),"minlng="+L.lng(),"maxlat="+K.lat(),"maxlng="+K.lng(),"number=1","callback="+f];d(j+N.join("&"))};var E=function(K){n.push(K);s(n.length-1)};var s=function(T){var N=n[T];var M=[];var P=N.length>1?true:false;for(var O in N){var K=N[O].id;var Q=N[O].content;var R=c+K;if(Q){M.push('<div class="'+(P?"ad_txt":"ad")+'">');if(R.indexOf("javascript")>0){var S="?link=";var L=R.substring(R.indexOf(S)+S.length,R.lastIndexOf("&t="));L=decodeURIComponent(L);M.push("<a href='"+L+"' onclick='"+e+'("'+R+"\")'>")}else{M.push('<a href="'+R+'" target="_blank">')}M.push(Q);M.push("</a>");M.push("</div>")}}y(M.join(""));i=T};var y=function(M){var K=document.getElementById(D);K.innerHTML=M;var N=K.getElementsByTagName("img");if(N.length>0){for(var L in N){N[L].border="0"}}};var J=function(){if(!a){return}var K=new Image();K.src=a.image;K.onload=function(){var N=new ULatLng(a.latlng,"DES");var M=new UIcon({image:a.image,iconWidth:this.width,iconHeight:this.height,iconAnchor:new UPoint(this.width/2,this.height),infoWindowAnchor:new UPoint(this.width/2,0)});var L=new UMarker(N,M);L.addListener("click",function(P,O,Q){O.openInfoWindow(a.html)});k.addOverlay(L)}};var H=function(L){var K=new Image();K.src=L;K=null};var r=k.container.clientHeight;C();window[f]=E;window.__getndgo__=C;window.__adClick__=function(L,M,K){var L=L||window.event;if(M&&M.lat){k.openInfoWindow(M,K);UEvent.cancelDefault(L);UEvent.stopPropagation(L);return}};window[e]=H;k.addDelayListener(C,1000,"moveend",true);k.addListener("zoom",function(L,K){if(K<b||!g){y(o)}else{if(n.length>0){s(n.length-1)}}});if(r>h){m=true}else{I()}})()};(function(){var b=function(){var c=UGeneric.activeMaps;for(var d in c){if(c.hasOwnProperty(d)&&!c[d].isOverView){c[d].adService()}}};if(window.urmapEvent&&typeof window.urmapEvent=="function"){var a=window.urmapEvent;window.urmapEvent=function(){a();b()}}else{if(!window.urmapEvent){window.urmapEvent=function(){b()}}}})();// Copyright 2004 www.urmap.com Inc.
//Update by urmapapi@olemap.com 2009/12/10W 05:11
var UGeoCoder=function(){var h="http://www.urmap.com/api/geo/get.jsp";var j=[];var k=[];var c=(document.charset||document.characterSet).replace("-","").toLowerCase();var b=null;var g=null;var m=UGeneric.inArray;var d=UGeneric.getScript;var i=function(n,r,q){if(!n){return}n=encodeURIComponent(n);var p=f(n);b=r;g=q;if(p){e(p)}else{var o=h+"?callback=__U__GEO&qs="+n+"&output="+c;d(o)}};var e=function(p){var n;if(p["api-data-root"]){n=p["api-data-root"]["records"]["record"]}else{n=p}var q=parseFloat(n.latitude);var o=parseFloat(n.longitude);var r;if(q==0&&o==0){r=null}else{r=new ULatLng(q,o)}a(n.address,n);if(typeof b==="function"){b(r,n)}if(r==null&&typeof g=="function"){g()}};var a=function(o,p){if(!UGeneric.GeoCache){UGeneric.GeoCache={};UGeneric.GeoCache.cacheqs=[];UGeneric.GeoCache.opts=[]}var r=false;o=encodeURIComponent(o);if(UGeneric.GeoCache.cacheqs.length){var q=UGeneric.GeoCache.cacheqs;var n=m(q,o);if(n<0){r=true}}if(r){return}UGeneric.GeoCache.cacheqs.push(o);UGeneric.GeoCache.opts.push(p)};var f=function(o){var q=UGeneric.GeoCache?UGeneric.GeoCache.cacheqs:null;if(!q){return null}var n=m(q,o);if(n<0){return null}else{var p=UGeneric.GeoCache.opts[n];return p}};var l=function(){delete UGeneric.GeoCache};window.__U__GEO=e;this.getLatLng=i;this.clearCache=l};UMarker.prototype.locateTo=UMap.prototype.locateTo=function(a,h,g){if(!a){return}var c="UMAP";var f=this;var b=null;if(this.isUMarker){c="UMarker";f=this.parentMap;b=this}if(!f){return}var d=this;var e=UGeneric.GeoCoder;if(!e){UGeneric.GeoCoder=new UGeoCoder();e=UGeneric.GeoCoder}e.getLatLng(a,function(j,i){if(b){if(j){b.setPoint(j)}b.refreshInfoWindow()}else{if(j){f.centerMap(j)}}f.refreshMap();if(typeof h==="function"){h(j,i)}},g)};if(typeof UGeneric != 'undefined')
	UGeneric.getCss('uextcss', 'http://api.urmap.com/uext/css/uext.css');
	
