﻿var eF="<table cellspacing='0' cellpadding='4' style='width:100%'><tr><td style='width:100%;color:white;background-color:black' align='center'>"+"<b>Placefinder</b>"+"</td></tr></table>"+"<br />"+"Name<br />"+"<input id='placeText' type='textbox' style='width:95%' /> "+"<br /><br />"+"Type<br /><select id='placeType' title='Select Place Type to Find' style='font-size:12px;width:95%; font-family:Sans-serif'>"+"<option value='P'>City/Town/Village</option>"+"<option value='A'>Country/Region</option>"+"<option value='H'>Stream/Lake</option>"+"<option value='L'>Parks/Open Areas</option>"+"<option value='R'>Road/Railroad</option>"+"<option value='S'>Building</option>"+"<option value='T'>Terrain</option>"+"<option value='U'>Undersea</option>"+"<option value='V'>Vegetation</option>"+"</select>"+"<br /><br /><br />"+"<table style='width:100%'><tr><td style='width:100%' align='center'>"+"<input onclick='mc_find()' id='geonamesearchbutton' type='button' style='width:60px' value='Find' />"+"</tr></tr></table>"+"<br /><br /><br />"+"<table style='width:100%'><tr><td style='width:100%' align='center'>"+"Search powered by<br /><b>Geo-names</b><br /><br />"+"</tr></tr></table>";dq.prototype.df=function(a){this.I=new GLatLng(a.lat,a.lng);if(a.name){this.F=a.name;}if(a.countryName){this.hC=a.countryName;}if(a.population){this.bJ=parseInt(a.population);}if(a.adminName1){this.fT=a.adminName1;}if(a.adminName2){this.fR=a.adminName2;}if(a.fcodeName){this.fi=a.fcodeName;}var aw=this.I.distanceFrom(Q)+99;var bc=parseInt(aw/100);this.ai=bc/10;};dq.prototype.cf=function(ac,i){var ix=i+1;var gg=((i%2)==0)?"aliceblue":"white";var g="<div style='padding:4px;color:black;background-color:"+gg+"'  onmouseover='showSearchTip("+i+")' onmouseout='hideSearchTip("+i+")' >";if(ac){g+="<font style='color:white;background-color:black'>&nbsp;"+ix+"&nbsp;</font> ";}if(ac){g+="<a href='javascript:viewResult("+i+")' style='text-decoration:underline;color:black' title='view "+this.F+" on map' >"+this.F+"</a><br />";}else{g+="<b>"+this.F+"</b><br />";}if(this.fT.length>0){g+=this.fT+"<br />";}if(this.fR.length>0){g+=this.fR+"<br />";}g+="Country : "+this.hC+"<br />";if(this.fi.length>0){g+="<i>"+this.fi+"</i><br />";}if(this.bJ>0){g+="Population: "+this.bJ+"<br />";}var aw=cw(this.ai);g+="<font style='color:red'><b>Distance:</b> "+aw+"</font>";if(!ac){g+=bb("");}g+="</div></div>";return g;};dq.prototype.M=function(){hideSearchTip();var g="<div style='width:240px'>"+this.cf(false,0)+"</div><br />";this.K.openInfoWindowHtml(g);};dq.prototype.ay=function(){var cZ=6;var cR=20;var aH=12;var az=20;var bD=6;var bB=0;this.T=f.markerPath+"purple.png";var aa=f.markerPath+"shadow.png";var C=new GIcon();C.image=this.T;C.iconSize=new GSize(aH,az);C.shadow=aa;C.shadowSize=new GSize(22,20);C.printImage=this.T;C.mozPrintImage=this.T;C.iconAnchor=new GPoint(cZ,cR);C.infoWindowAnchor=new GPoint(bD,bB);C.infoShadowAnchor=new GPoint(bD,bB);var bG=this.F;var H=new GMarker(this.I,{icon:C});this.K=H;map.addOverlay(H);var o=this;GEvent.addListener(H,'click',function(){o.M();});GEvent.addListener(H,"mouseover",function(){bx(o);});GEvent.addListener(H,"mouseout",function(){aZ(o);});};function cbPF(a){var cs=[];if(a.geonames){cs=a.geonames;}var au=mcX.displaySideWidth-16;var s=cs.length==1?"":"s";var g="<table cellspacing=0 cellpadding=2 style='width:"+au+"px'><tr><td><a href='javascript:vuASR()' title='View All'>"+cs.length+" place"+s+"</td></tr></table>";e("resultHeaderDiv").innerHTML=ad(g,2);for(var i=0;i<cs.length;i++){var o=new dq();o.df(cs[i]);A.push(o);o.ay();}vuASR();L++;e("resultProgressDiv").style.display="none";as=4;ao();};function fq(cr){var ll=e("placeText").value;var aF="http://ws.geonames.org/searchJSON?q="+ci(ll);var fy=e("placeType");var lh=fy.options[fy.selectedIndex].value;aF+="&fclass="+lh;aF+="&maxRows=25&alt=json-in-script&callback=cbPF";var ak=new ap(aF);ak.bz();ak.bY();}
