popwidth=mywindowwidth()*.8;
var w8=popwidth;
var w7=popwidth*.9;
var load=' alt=Loading...  ';
var aname='';
var gotbroker=readCookie('gotbroker');
var amoreurl='';
var today = new Date();
var day=pad2(today.getUTCDate());
var yesterday=pad2(today.getUTCDate()-1+(day=='01')*30);
var beginmonth=monthname(1+today.getUTCMonth()-(day==1));
var beginmonth=(1+today.getUTCMonth()-(day==1));
var thismonth=pad2(1+today.getUTCMonth());
var yestermonth=pad2(today.getUTCMonth()+1-(day=='01'));
var thisyear=today.getUTCFullYear();
var yearmonth=thisyear+'-'+thismonth;
var tomorrow=pad2(today.getDate()+1);if (tomorrow>'30') tomorrow=30;
var tomomorrow=pad2(today.getDate()+2);if (tomorrow>'30') tomomorrow=30;
atitle=(typeof(atitle)=='undefined'?'':atitle);
acountynbr=(typeof(acountynbr)=='undefined'?0:acountynbr);
dadenbr=23;palmbeachnbr=60;browardnbr=16;
photo='';
var recordkeycriterion='';
var arecvector=new Array();
ispopup=(typeof(ispopup)=='undefined'?0:ispopup);
istabulate=(typeof(istabulate)=='undefined'?0:istabulate);
tabwidth=(typeof(tabwidth)=='undefined'?'100%':tabwidth);
if (tabwidth=='10%') dw('<title>tabwidth='+tabwidth+'</title>');
p='<p>';
beston=0;
printable=(typeof(printable)=='undefined'?0:printable);
showminimaps=(typeof(showminimaps)=='undefined'?0:showminimaps);
areatype0=(typeof(areatype)=='undefined')?'':areatype;
tester=(typeof(tester)=='undefined'?'':tester);
var demognamecompound='';
var lastareatype='allworld';
blockopen=0;
vid=(typeof(vid)=='undefined'?'':vid);
iscondex=(vid=='condex.com'||vid=='uscondex.com');
felipa=1;
isArquery=(typeof(isArquery)=='undefined')?0:isArquery;
showPremium=!iscondex;
real_on=(typeof(real_on)=='undefined'?'':real_on);
tfdata='http://tfdata.cs.fiu.edu/';
itfdata='http://tsi.cs.fiu.edu/';
n1='http://n1.cs.fiu.edu/';
n2='http://n2.cs.fiu.edu/';
n3='http://n3.cs.fiu.edu/';
vn4='http://vn4.cs.fiu.edu/';
n1=((typeof(gserver)=='undefined')?n1:((gserver=='')?n1:gserver)).replace(/\/*$/,'/');
n1c=n1+'cgi-bin';
n2c=n2+'cgi-bin';
n3c=n3+'cgi-bin';
vn4c=vn4+'cgi-bin';
vn4c=n1+'cgi-bin';
images=vn4+'images/';
newgif='<img src='+images+'New.gif>';
gnisdispcgi=vn4c+'/gnis'+tester+'.cgi?';
gniscgi=vn4c+'/gnis'+tester+'.cgi?';
h='http://';
sl='/';
hh=''+h;
function ismaph(width_m,height_m,resolution,clat,clong) {
var latdelta=height_m/surface_height_in_meters_of_one_latitude_millidegree_at(0+clat,0+clong)/2/1000;
var longdelta=width_m/surface_width_in_meters_of_one_longitude_millidegree_at(0+clat,0+clong)/2/1000;
ismaphlat(clat-latdelta,clat+latdelta,clong-longdelta,clong+longdelta,width_m/resolution,height_m/resolution);
}
function ismapimg(imgurl,minlat,maxlat,minlong,maxlong,alt) {return alt}
function ismaphlat(minlat,maxlat,minlong,maxlong,width_pix,height_pix) {

var url=vn4c+'/gnis'+tester+'.cgi?vid='+vid+'&srvc='+srvc+'&tfaction='+tfaction+'&minlat='+minlat+'&minlong='+minlong+'&maxlat='+maxlat+'&maxlong='+maxlong+'&pixel_of_max_lat=0&pixel_of_min_lat='+height_pix+'&pixel_of_min_long=0&pixel_of_max_long='+width_pix;
dw('<a border=1 href="'+url+'">');

}
function surface_width_in_meters_of_one_longitude_millidegree_at(latitude,longitude) {
   return DistanceLongLat(longitude - .001, latitude,  longitude, latitude);
}

function surface_height_in_meters_of_one_latitude_millidegree_at(latitude,longitude) {
   return DistanceLongLat(longitude, latitude - .001,  longitude, latitude);
}


function DistanceLongLat(long1, lat1, long2, lat2) {

var REarth = 6.371229*1e6;
var PI = 3.14159;

var long1Radian = long1*PI/180;
var long2Radian = long2*PI/180;
var lat1Radian = lat1*PI/180;
var lat2Radian = lat2*PI/180;

var distance = REarth * Math.acos( 
                      Math.cos(lat1Radian) * Math.cos(lat2Radian) *
Math.cos(long1Radian-long2Radian)
                      + Math.sin(lat1Radian)*Math.sin(lat2Radian) 
                      );
return distance;
}
function displayif(preffix,value,suffix) {
return (mlike(value+'','[^ 0]')?preffix+value+(typeof(suffix)=='undefined'?'':suffix):'')}

function arectab(tabrecord){
arecvector=tabrecord.split(/	/);
}


function cleanse_unit(unit) {
if (mlike(unit,'^sq.*f.*t')) return 'sf';
if (mlike(unit,'^sq.*mi')) return 'smi';
if (mlike(unit,'^sq.*k.*m')) return 'skm';
if (mlike(unit,'^sq.*m')) return 'sm';
if (mlike(unit,'^mi.*')) return 'mi';
if (mlike(unit,'^mm.*')) return 'mm';
if (mlike(unit,'^m.*')) return 'm';
if (mlike(unit,'^f.*')) return 'f';
if (mlike(unit,'^k.*m.*')) return 'm';
if (mlike(unit,'^acr')) return 'a';
return(unit);
}
function elevationdisplay(ft){
return measuredisplay(ft,'ft','Elevation');
}
function measuredisplay(value,unit, prefix){
var displayunit=' '+unit;
var fullunit=unit;
if (unit=='ft') {displayunit="'";fullunit='feet';}
if (unit=='inch') {displayunit='"'; fullunit="inches"}
var explain=(typeof(prefix)=='undefined'?'':prefix+' ')+value+ ' '+fullunit +convert_units(value,unit);
var title=' title= "'+explain+'. Click for Measure Converter." ';
return ' <a '+title+' href="http://allmeasures.com/conversion.asp?Submit=Converter" target="_blank">'+value+displayunit+'</a>';

}

function convert_units(value,unit){

var vals=''+value;
var valn=1*value;
if (mlike(vals,'^ *[0-9]+ *x *[0-9]+ *$')) {
var x=vals.replace(/ *[xX].*/,'');
var y=vals.replace(/^.*[xX] */,'');
return ' ='+(x*y);
}
if (numericG(vals)) {
var u=cleanse_unit(unit);
var f=0.3048;
var mi=1609.3;
var acre=4046.86;
var inch=f/12;
if (u=='mm') return ' ='+ K(valn/inch/1000)+ 'inches';
if (u=='m') return ' ='+ K(valn/f)+ 'ft' +(valn>200?' ='+K(valn/1000)+'km ='+K(valn/1609)+'miles':'');
if (u=='f') return ' ='+ K(valn*f)+ 'meters';
if (u=='sf') return ' ='+ K(valn*f*f)+ 'sq.meters'+ (valn>5000?' = '+K(valn*f*f/4047)+' acres':'');
if (u=='sq.ft.') return ' ='+ K(valn*f*f)+ 'sq.meters'+ (valn>5000?' = '+K(valn*f*f/4047)+' acres':'');
if (u=='smi') return ' ='+ K(valn*mi/1000*mi/1000)+ 'sq.km ='+ K(valn*mi/acre*mi)+ 'acres';
}
return('');
}

function arquery(category,label,arcriteria,poptext,levelOfIframe,levelOfReport) {
var display=(typeof(label)=='undefined'?category:label);
var criteria=(typeof(arcriteria)=='undefined'?'':'&arcriteria=1&'+arcriteria);
var text=(typeof(poptext)=='undefined'?'browse/query '+display:poptext);
var url=vn4c+'/arquery'+tester+'.cgi?category='+category+'&y1='+latitude+'&x1='+longitude+'&vid='+vid+'&srvc='+srvc+'&tfaction='+tfaction+criteria;
pophb(url,display,text);
}

function pointdata_aurl(){return vn4c+'/gnis'+tester+'.cgi?Lat='+alatitude+'&Long='+alongitude+'&vid='+vid+'&srvc='+srvc+'&tfaction='+tfaction;}
function arquery_aurl(category){ var criteria='';return vn4c+'/arquery'+tester+'.cgi?fulldisplay=1&category='+category+'&y1='+alatitude+'&x1='+alongitude+'&vid='+vid+'&tfaction='+basetfaction+criteria}
function arquery_aurlm(category){ var criteria='';return vn4c+'/arquery'+tester+'.cgi?category='+category+'&y1='+alatitude+'&x1='+alongitude+'&vid='+vid+'&tfaction='+basetfaction+criteria}
function arquery_url(category){return vn4c+'/arquery'+tester+'.cgi?category='+category+'&y1='+latitude+'&x1='+longitude+'&vid='+vid+'&tfaction='+basetfaction;}
function arquery_keyurl(category){return vn4c+'/arquery'+tester+'.cgi?fulldisplay=1&category='+category+'&y1='+alatitude+'&x1='+alongitude+'&vid='+vid+'&tfaction='+basetfaction+(recordkeycriterion==''?'':'&arcriteria=1&'+recordkeycriterion);}


var v = new Array();  //argument: fieldnumbers*1000+valueindex, gives shortnaame, units, fullname, and frequent values
var nbrfields=0;
var fieldnbrs = new Array(); //argument is shortname, computed from v[]
function fieldvalue(fieldnbr,valuenbr) {
var i=100*fieldnbr+valuenbr;
return (typeof(v[i])=='undefined'?'':v[i])};
function fieldnbrof(shortname) {
return (typeof(fieldnbrs[shortname])=='undefined'?'':fieldnbrs[shortname])};

var mins=new Array();
var maxs=new Array();
var totals=new Array();
var counted=new Array();
var actnbrvalues=new Array();
var field_vectors_initialized=0;
function initialize_field_vectors(){
if (field_vectors_initialized) return;
field_vectors_initialized=1;
fieldnbrs['anyfield']=0;
v[0]='Keywords in any fields';
v[-1]='anyfield';
v[-2]='';

if (nbrfields==0) {
var i=0;
while (fieldshortname(i)!='') i++
nbrfields=i-1;}
for (i=1;i<=nbrfields;i++){
mins[i]=0;
maxs[i]=0;
counted[i]=0;
actnbrvalues[i]=0;
totals[i]=0;
fieldnbrs[fieldshortname(i)]=i;
}
}



function nbrvalues(fieldnbr) {
var n=1;
while (fieldvalue(fieldnbr,n)!='') n++;
return n-1}

function fieldvalues(fieldnbr) {
var s=fieldvalue(fieldnbr,1).replace(/:.*/,'');
n=nbrvalues(fieldnbr);
for (i=2;i<=n;i++) s=s+' '+fieldvalue(fieldnbr,i).replace(/:.*/,'');
return s;
}

function fieldvalue_deabbreviate(fieldnbr,value){
for (i=1;i<=nbrvalues(fieldnbr);i++) {
      //dw(fieldnbr);
     var vv=fieldvalue(fieldnbr,i)+':::'; //dw('i='+i+' vv='+vv);
     var v1=vv.replace(/:.*/,'');
     var v2=vv.replace(/^[^:]*:/,'').replace(/:.*/,''); 
     var v3=vv.replace(/^[^:]*:[^:]*:/,'').replace(/:.*/,''); 
     if ((''+value).replace(/^0*/,'')==v1.replace(/^0*/,'')&&v2!='') return v2;
     }
return value}

function fieldvalue_explain(fieldnbr,value){
for (i=1;i<=nbrvalues(fieldnbr);i++) {
      //dw(fieldnbr);
     var vv=fieldvalue(fieldnbr,i)+':::'; //dw('i='+i+' vv='+vv);
     var v1=vv.replace(/:.*/,'');
     var v2=vv.replace(/^[^:]*:/,'').replace(/:.*/,''); 
     var v3=vv.replace(/^[^:]*:[^:]*:/,'').replace(/:.*/,''); 
     if (value==v1&&v2!='') {if (v3!='') return v2+' ('+v3+')'; else return v2}
     }
return value}



function fieldfullname(fieldnbr) {
var  u=fieldvalue(fieldnbr,-2);
return fieldvalue(fieldnbr,0) + (u!=''?' ('+u+')':u )}
function fieldshortname(fieldnbr) {return fieldvalue(fieldnbr,-1)}
function fieldunit(fieldnbr) {return fieldvalue(fieldnbr,-2)}


n157o='n150.cs.fiu.edu';
n157='http://'+n157o+'/';
n157e=hh+n157o+sl;
miniaddress=(typeof(miniaddress)=='undefined')?'':miniaddress;
addressplus=(typeof(addressplus)=='undefined')?'':addressplus;
stree=(typeof(stree)=='undefined')?'stree.cs.fiu.edu:8080':stree;
strip=n157e+'wde-fmt/Executor?'
longitude=(typeof(longitude)=='undefined'?'':longitude);
latitude=(typeof(latitude)=='undefined'?'':latitude);
place_name=(typeof(place_name)=='undefined'?'':place_name);
fires=n1c+'/fire.cgi?x1='+longitude+'&y1='+latitude;
arcoord='&x1='+longitude+'&y1='+latitude+'&';
stripend=arcoord+'numfind=100&F=SHTML&SName=';
real=strip+stripend+'REA_STAT';
schoolref='http://n150.cs.fiu.edu/geodata/schl.iq2?Query=GetSchoolsByPoint&x1='+longitude+'&y1='+latitude+'&format=html'
hotels=strip+stripend+'HOT_STAT&filter=sql&Where=supplier%3c%3e%27TRWB%27+and+supplier%3c%3e%27AMDS%27';
aerial0=vn4c+'/tfdispense.cgi?long='+longitude+'&lat='+latitude+'&';
aerial=aerial0+'width=2000&height=1600';
q="'";
title=searchstring+' '+cityorkountryname+' - Data on the Point You Clicked';
floodzoominhref='http://www.hazardmaps.gov/atlas.php?ex%5Bminx%5D='+longitude+'&ex%5Bmaxx%5D=&ex%5Bminy%5D='+latitude+'&ex%5Bmaxy%5D=&command=panW&currentView=1&zoomLevel=9&mapImageSrc=images%2Farcims%2Fmmi_image_PEISIN21801176395.png&selState=--&selCounty=0&selCongress=--&txtZipCode=&radioCmd=zoomInPoint&selView=1&viewType=normal&layerSet%5B46%5D%5Bvisible%5D=1&layerSet%5B46%5D%5Bin%5D=1&layerSet%5B81%5D%5Bvisible%5D=1&layerSet%5B81%5D%5Bin%5D=1&layerSet%5B8%5D%5Bvisible%5D=1&layerSet%5B8%5D%5Bin%5D=1&layerSet%5B5%5D%5Bvisible%5D=1&layerSet%5B5%5D%5Bin%5D=1&layerSet%5B6%5D%5Bvisible%5D=1&layerSet%5B6%5D%5Bin%5D=1&layerSet%5B7%5D%5Bvisible%5D=1&layerSet%5B7%5D%5Bin%5D=1&layerSet%5B1%5D%5Bvisible%5D=1&layerSet%5B1%5D%5Bin%5D=1&layerSet%5B2%5D%5Bvisible%5D=1&layerSet%5B2%5D%5Bin%5D=1&layerSet%5B3%5D%5Bvisible%5D=1&layerSet%5B3%5D%5Bin%5D=1&layerSet%5B12%5D%5Bvisible%5D=1&layerSet%5B12%5D%5Bin%5D=1';
floodzoomouthref='http://www.hazardmaps.gov/atlas.php?ex%5Bminx%5D='+longitude+'&ex%5Bmaxx%5D='+longitude+'&ex%5Bminy%5D='+latitude+'&ex%5Bmaxy%5D='+latitude+'&command=zoomTo8&currentView=1&zoomLevel=9&mapImageSrc=images%2Farcims%2Fmmi_image_PEISIN21801176389.png&selState=--&selCounty=0&selCongress=--&txtZipCode=&radioCmd=zoomInPoint&selView=1&viewType=normal&layerSet%5B46%5D%5Bvisible%5D=1&layerSet%5B46%5D%5Bin%5D=1&layerSet%5B81%5D%5Bvisible%5D=1&layerSet%5B81%5D%5Bin%5D=1&layerSet%5B8%5D%5Bvisible%5D=1&layerSet%5B8%5D%5Bin%5D=1&layerSet%5B5%5D%5Bvisible%5D=1&layerSet%5B5%5D%5Bin%5D=1&layerSet%5B6%5D%5Bvisible%5D=1&layerSet%5B6%5D%5Bin%5D=1&layerSet%5B7%5D%5Bvisible%5D=1&layerSet%5B7%5D%5Bin%5D=1&layerSet%5B1%5D%5Bvisible%5D=1&layerSet%5B1%5D%5Bin%5D=1&layerSet%5B2%5D%5Bvisible%5D=1&layerSet%5B2%5D%5Bin%5D=1&layerSet%5B3%5D%5Bvisible%5D=1&layerSet%5B3%5D%5Bin%5D=1&layerSet%5B12%5D%5Bvisible%5D=1&layerSet%5B12%5D%5Bin%5D=1';
hr='http://n1.cs.fiu.edu/cgi-bin/d.cgi?tigermaps=&gnis0=&searchstring='+searchstringplus+'&lat='+latitude+'&long='+longitude+'&bigmap=1';
href='<a href='+hr+' target=_top>';
var N='north';
var E='east';
var S='south';
var W='west';
var NW='north-west';
var NE='north-east';
var SW='south-west';
var SE='south-east';
var distcnbr=0;
srvc=(typeof(srvc)=='undefined'?'':srvc);
tfaction=(typeof(tfaction)=='undefined'?'':tfaction);
var onlycount=(mlike(tfaction,'^count')||mlike(tfaction,'^gallery')) ;
if (tfaction=='') tfaction=getparam('tfaction');
basetfaction=(mlike(tfaction,'rambbroker')?tfaction.replace(/.*rambbroker/,'rambbroker'):'');
if (srvc=='') srvc=getparam('srvc');
function mkicon(s) {
return '<font face=Courier>'+s+'</font>';
}
function distc(meters,direction,label) {
  var olabel=(label=='undefined'?'':label);
  var red=(olabel.indexOf('color=red')>0);
  olabel=olabel.replace(/\<[^>]*\>/g,'');
  var olabelnet=olabel.replace(/.*:/,'').replace(/.nbsp;*/g,' ').replace(/^ */,'');
  var olabel_=olabel.replace(/.nbsp;*/g,' ').replace(/^  */,'').replace(/[^$a-zA-Z0-9,.\/:-]/g,'+');
  var olabelnet_=olabelnet.replace(/[^a-zA-Z0-9,.\/:-]/g,'+');
  var objectref=(olabel==''?'':' (<a href=.>'+olabelnet+'</a>)');
  var objectcat=(typeof(aicon)=='undefined'?'':aicon);
  if (typeof(ocat)!='undefined') if (ocat!='') objectcat=ocat;
  objectcat=(objectcat==''?'object':objectcat);
var objectcref='the '+objectcat+objectref;
var flyurl='http://terrafly.fiu.edu/launch.asp?Lat='+alatitude+'&Long='+alongitude;
if (typeof(appletform)!='undefined') flyurl=appletform.replace(/aplatitude/g,alatitude).replace(/aplongitude/g,alongitude).replace(/applace/g,(olabel_==''?'+':olabel_).replace(/.*:./,'').replace(/[^a-zA-Z0-9.\/$-]/g,'%20'));

var flyicon='&phi;';
flyicon=mkicon('f');
var panurl=gniscgi+'TopPlaces=5&Lat='+alatitude+'&Long='+alongitude+'&vid='+vid+'&tfaction='+tfaction+'&place_name='+olabelnet_+'#TerraPan';
var searchurl='http://recommend.org/omnisearch.htm#sitetype=omni&zipcode='+zipcode+'&cityname='+citynameplus+'&statecode='+statecode+'&vid='+vid+'&searchstring='+olabelnet_;
var panicon='&pi;';
panicon=mkicon('p');
allfieldsicon=mkicon('a');
folioicon='parcels';
blockicon='block';
bgicon='vicinity';
var moreicon='&mu;';
moreicon=mkicon('l');
var searchicon=mkicon('i');
var mapicon='&epsilon;';
mapicon=mkicon('g');
birdicon=mkicon('b');
directionsicon=mkicon('d');
  distcnbr++;
  if (direction.length<4)
    direction=direction.replace('N','north').replace('S','south').replace('W','west').replace('E','east').replace('thw','th-w').replace('the','th-e');
  var precision_meters=0;
  var alongitude_string=(''+alongitude)+''+'0000001s';
  //tempoff var alongitude_string=(''+alongitude).replace(/0*$/,'');
  //if  (mlike(''+alatitude,'\.107')) precision_meters=100*alongitude_string.substr(alongitude_string.length-4,4);
  //was in prod till 2007-525: if  (mlike(''+alatitude,'\.107')) precision_meters=500*alongitude_string.replace(/.*\./,'').substr(4,3);
  //if  (mlike(''+alatitude,'[.]...107')) precision_meters=500*alongitude_string.replace(/.*[.]/,'').substr(4,3);
  if  (mlike(''+alatitude,'[.]...107')) precision_meters=50*alongitude_string.replace(/.*[.]/,'').substr(3,4);
 // dw(alongitude_string.replace(/.*[.]/,'').substr(4,3));dw();
  var approximately=(precision_meters>0?' very approximately ':'');
  var ft=(Math.round(meters/0.3));
  var miles=(Math.round(meters/160.9)/10); amiles=miles;
  var km=(Math.round(meters/100)/10);
  var valarrow='<img border=0 src='+images+direction+'.gif>';
  var valdist=(meters>5000?K9(km)+'km':K9(meters)+'m');
    if (precision_meters>0) valdist=km+'&plusmn;'+(precision_meters/1000).toPrecision(2)+' km';
  //  valdist=''+alatitude+'='+alongitude+'='+precision_meters;
  var from=(place_name==''?' from the starting point':' from '+place_name)+'.';
  if (USA) {valdist=(ft>5000?K9(miles)+'mi':K(ft)+q);

    //if (precision_meters>0) valdist=miles+'&plusmn;'+Math.round(precision_meters/1600).toPrecision(2)+' miles';
    if (precision_meters>0) valdist=K9(miles)+'&plusmn;'+(Math.round(precision_meters/16).toPrecision(2))/100+' miles';
}
  var val=valarrow+valdist;  if (ft==0) val=valdist;

  if (ft==0) {val='<img src='+images+'startpoint.gif>';valarrow=val};
  if (typeof(alatitude)!='undefined') {if (alatitude!=0) {
var tp='http://books-maps.com/gnisterrapan521.html#set?lat='+alatitude+'&lon='+alongitude+'&res=';
var img1=' <img src=http://tsi.cs.fiu.edu/qHaMz'+alongitude+'qALz'+alatitude+'>';
var img='<iframe src='+tp+'1 width=700 scrolling=no framespacing=0 marginwidth=0 marginheight=0 height=500 border=0></iframe> <iframe src='+tp+'8 width=700 scrolling=no framespacing=0 marginwidth=0 marginheight=0 height=500 border=0></iframe>';
img='<iframe src='+tp+'1 width=670 scrolling=no framespacing=0 marginwidth=0 marginheight=0 height=500 border=0></iframe>';
var panminitext='<b>Pan</b> aerial imagery at '+objectcref;
if (!isIE55) pantext=panminitext+img1; 
else pantext='<b>Pan</b> aerial imagery at '+objectcref+' (or graphically adjust location)'+img;
pantext='<b>Pan</b> aerial imagery at '+objectcref+' (or graphically adjust location)'+img1;
var flytext='open TerraFly<b>flight</b> windows at '+objectcref;
var searchtext='<b>Internet omni-search</b>: the Web, dictionaries, encyclopaedias, online databases for '+objectcref;
var mapurl='http://maps.google.com/maps?q='+citynameplus+'&ll='+alatitude+'%2C'+alongitude;
var mapsource='Google';
var mapminitext='<b>GoogleMap</b> at '+objectcref;
var maptext=mapminitext+'<iframe src='+mapurl+' width='+w8+' scrolling=no framespacing=0 marginwidth=0 marginheight=0 height=660 border=0></iframe>';
var birdurl='http://www.bing.com/maps/?v=2&cp='+alatitude+'~'+alongitude+'&lvl=17&style=b';
var birdsource='Bing';
var birdminitext='<b>Bing-Birdsview</b> at '+objectcref;
var birdtext=birdminitext+'<iframe src='+birdurl+' width="90%" scrolling=no framespacing=0 marginwidth=0 marginheight=0 height=660 border=0></iframe>';
var allfieldsminitext='<b>All fields</b> of '+atitle;
var moretext='<b>List</b> all '+atitle+' with details and distances to '+objectcref+'.  <b>Easy Geo-Query</b>';
var aerial='<img src=http://tsi.cs.fiu.edu/qB1Fz'+alongitude+'qALz'+alatitude+'>';
var foliotext='county records';
var blocktext='demographics of this block and nearby';
var bgtext='demographics of this neighborhood and nearby';
var allfieldsurl=arquery_aurl(p1);
var allfieldstext=allfieldsminitext;
var amoreurlt=n1c+'/arquery'+tester+'.cgi?category='+p1+'&x1='+alongitude+'&y1='+alatitude+'&tfaction='+tfaction+'&vid='+vid+'&place_name='+olabel.replace(/[^a-zA-Z0-9]/g,'+');
var foliourl=arquery_aurlm(kountrycode=='US_FL'?'flproperties-10':'firstamerican_points');
var blockurl=arquery_aurlm('pblock');
var bgurl=arquery_aurlm('pbg');
var detailref=(isArquery==1)?'<img src='+images+'details.gif width=32 height=32><font color=blue><b>'+alabel+'</b></font>':'the '+objectcat+' '+objectref;
poph(gniscgi+'Lat='+alatitude+'&Long='+alongitude+'&vid='+vid+'&tfaction='+tfaction+'&place_name='+olabel_,'<b><i>'+val+'</i></b>',distcnbr+'. This place is '+approximately+ft+' feet (by air) ='+meters+' meters, ='+miles+' miles, =<b>'+km+' kilometers</b> '+direction+from+'<p>Click on '+valarrow+' to go to recenter report on this point or<p>click on '+detailref+' for more <b>details</b> about this '+objectcat+' or<p>mouse-over other buttons for more options');
 flyiconhelp='';
searchiconhelp=p+searchicon+' -- '+searchtext+'.'; 
paniconhelp=p+panicon+' -- '+panminitext+'.'; mapiconhelp=p+mapicon+' -- '+mapminitext+'.';moreiconhelp=p+moreicon+' -- '+moretext+'.';
allfieldshelp=p+allfieldsicon+' -- '+allfieldsminitext+'.';
paniconminihelp=p+panicon+' -- <b>pan</b> aerial imagery overlaid with maps (or graphically adjust location).';
if (azipcode.length>5) azipcode=azipcode.substr(0,5);
aaddress=aaddress.replace(/#.*/,'');
var directionsadr=miniaddress+' to '+aaddress+','+azipcode;
var directionsaddressplus=directionsadr.replace(/ /g,'+');
var directionurl='http://maps.google.com/maps?q='+directionsaddressplus;
var directions=' <b><i>Driving</i> distance</b>: <br><iframe width='+w8+' height=500 src='+directionurl+'></iframe>'; 
if (USA) { flyiconhelp='<p>'+flyicon+' -- '+flytext+'.';}
if (!onlycount&&!printable) {
dw('<small>');
if (felipa) {

if (felipa_pulldown_on) {
dw('</small>')
submenu='';
if (USA) {
}
submenub(mapurl,mapicon,maptext);
submenub(birdurl,birdicon,birdtext);
submenub(amoreurlt,moreicon,moretext); 
submenub(searchurl,searchicon,searchtext); 
submenub(allfieldsurl,allfieldsicon,allfieldstext); 
if (USA) {pointbuttong('censusmap','population.gif','demographics');}
if (ft>300) if (address!=''&&aaddress!=''&&azipcode!='') {pointbutton(directionurl,'car.gif',directions);}
if (USA) {

if (meters>150) {
line_speed=40;
line_seconds=25;
line_px=line_speed*line_seconds;
line_resolution=(meters/line_px);
if (line_resolution<0.3) line_resolution=0.3;

pointbutton('http://maps.cs.fiu.edu/pilot/pilot.htm?autopilot=straightline&startlat='+latitude+'&startlong='+longitude+'&endlat='+alatitude+'&endlong='+alongitude+'&speed='+line_speed+'&res='+line_resolution,'airport.gif','TerraFlight from the starting point to this point','http://maps.cs.fiu.edu/pilot/pilot.htm?autopilot=straightline&startlat='+latitude+'&startlong='+longitude+'&endlat='+alatitude+'&endlong='+alongitude+'&speed='+line_speed+'&res='+line_resolution);
}
pointbutton('http://maps.cs.fiu.edu/pilot/pilot.htm?autopilot=spiral&startlat='+alatitude+'&startlong='+alongitude+'&radius=500&res=1.2','heliport.gif','TerraFlight spiraling around this point','http://maps.cs.fiu.edu/pilot/pilot.htm?autopilot=spiral&startlat='+alatitude+'&startlong='+alongitude+'&radius=500&res=1.2');


}
if (!istabulate) felipa_pulldown();
}
else {
if (USA) {dw(); popht('terrafly',flyurl,flyicon,flytext);}
dw();pophb(mapurl,mapicon,maptext);
dw();pophb(birdurl,birdicon,birdtext);
dw(); pophb(amoreurlt,moreicon,moretext); 
dw(); pophb(searchurl,searchicon,searchtext); 
dw(); pophb(panurl,panicon,pantext); 
dw(); pophb(allfieldsurl,allfieldsicon,allfieldstext,iframe_arquery(allfieldsurl)); 
if (ft>300) if (address!=''&&aaddress!=''&&azipcode!='') {dw();pophb(directionurl,directionsicon,directions);}  }
}
if (isArquery&&typeof(p1)!='undefined') {
dw();pophb(mapurl,mapicon,popframe(mapurl));
dw();pophb(birdurl,birdicon,popframe(birdurl));
submenu_section();
if (preal) submenu_arquery('ramb','client&nbsp;view');
if (p1=='ramb'||p1=='callreal') {submenu_arquery('allreal','Pro&nbsp;view','status=A');}
var br='<br>'
var indent=br+'&nbsp;';
if (p1=='emergencycalls') {

submenu_arquery('ptrim','Rain','','precipitation last 24h');
submenu_arquery('rtgauges','Water gage','','flow and level at USGS water gages');
}
if (preal||p1=='emergencycalls')  submenuOrBr(foliourl,folioicon,foliotext,iframe_arquery(foliourl));
if (p1=='pbg'||p1=='ptract'||preal||mlike(p1,'flproperties')||p1=='nfolio') {submenuOrBr(blockurl,blockicon,'demographics at the BLOCK level',iframe_arquery(blockurl))};
if (p1=='pblock'||p1=='ptract'||p1=='pzipcode'||p1=='pincorp'||mlike(p1,'flproperties')) {submenuOrBr(bgurl,bgicon,'demographics at the NEIGHBORHOOD (Census Block Group) level',iframe_arquery(bgurl))};
if (p1=='bcndx') {submenu_arquery('cndx','units','','condo units offered nearby');}
submenu_arquery('iypages_demographics','Business','','Yellow Pages');
if (statecode=="FL") submenu_arquery('whitepages','Residents','','White Pages');
if (p1=='cndx') {submenu_arquery('bcndx','buildings','','featured condominum buildings nearby');}
if (preal||mlike(p1,'flproperties')&&(flcounty==dadenbr||flcounty==browardnbr||flcounty==palmbeachnbr)) {
submenuOrBr(pointdata_aurl().replace(/tfaction=/,'&printable=1&tfaction=aerial'),'aerial','printable aerial photographs & property lines',aerial);
var folionbr=folio.replace(/-/g,'');var basefolio=folionbr;
var taxurl='http://gisims2.co.miami-dade.fl.us/MyHome/propmap.asp?app=propmap&bytool=FOLIO&cmd=FINDFOLIO&tool=SELECT&searchtool=FOLIO&mapURL=&selX=&selY=&scale=155&ownerl=&ownerf=&stnum=&stdir=&stname=&sttype=&stunit=&stzip=&reffolio=&startnum=0&sOrthophoto=YES&folio='+prepend0(folionbr,13);
if (acountynbr==browardnbr) taxurl='http://www.bcpa.net/RecInfo.asp?URL_Folio='+folionbr;
if (acountynbr==palmbeachnbr) taxurl='http://www.co.palm-beach.fl.us/papa/aspx/web/detail_info.aspx?p_entity='+prepend0(folionbr,17);
var taxpopurl=taxurl;
if (acountynbr==dadenbr) taxpopurl='http://gisims2.co.miami-dade.fl.us/myhome/proptext_print.asp?folio='+ prepend0(folionbr,13);
basefolio=sub("....$","0000",basefolio);
pointbutton(taxurl,'bmaps.gif','Current County Property Appraiser record for this property',taxurl);
if ((preal||mlike(p1,"flproperties"))&&flcounty==dadenbr) submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?category=deeds_props&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabview&arcriteria=1&Folio_Number="+folionbr,"Deeds","Property documents recorded with County Clerk");
if ((preal||mlike(p1,"flproperties"))&&flcounty==dadenbr) submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?category=deedsfull&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabview&arcriteria=1&First_Party="+aowner.replace(/[,(&].*/,'').replace(/ /g,'+'),"Mortgage","Mortgages and other Property documents recorded with County Clerk");
if (preal||mlike(p1,'flproperties')&&(flcounty==dadenbr||flcounty==browardnbr||flcounty==palmbeachnbr)&&(vid=='ramb'||vid=='mreal')) {
submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?category=allreal&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&fulldisplay=1&tfaction=longdisplay&arcriteria=1&folio_number="+folio+"&folio_number%3C="+folio,"History","Current and older listings for this property"); 
submenu_section('Comparables');
if (acountynbr==dadenbr&&(vid=='mreal')) submenuOrBr("http://n1.cs.fiu.edu/cgi-bin/condorep"+tester+".cgi?Lat="+alatitude+"&Long="+alongitude+"&vid="+vid+"&folio="+basefolio,"per-tax","Run a value comparison report for the subdivision (sale price per sq. foot of adjusted area) and show owners (analysis of records of the County Appraiser office)"); 
if (preal) {
report_name="place_name=Comparables+adjustment+to+county+valuation+of+$"+county_value+"+via+MLS+CS+analysis+of+ratio+of+Recent+Sales+to+County+Valuation&";
submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?"+report_name+"category=allreal&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabvieweval_County_Valuation"+county_value+"&arcriteria=1&status=CS&closing_date%3E=2010-06-01&property_type="+listing_type,"per-MLS-CS-assessed","Run a value comparison report (adjustment to the county-appraized so-called just-value) based on recent  closed sales"); 
report_name="place_name=Comparables+adjustment+to+county+valuation+of+$"+county_value+"+via+Coutnty+Records+analysis+of+ratio+of+Recent+Sales+to+County+Valuation&";
submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?"+report_name+"category=deeds_props&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabvieweval_County_Valuation"+county_value+"&arcriteria=1&Recording_Date%3E=20090801&Computed_Sale_Price%3E=20000&TOTLAREA%3E="+area/2+"&TOTLAREA%3C="+area*2,"per-Deeds+Tax","Run a value comparison report (adjustment to the county-appraized so-called just-value) based on recent recorded sales"); 
report_name="place_name=Comparables+valuation+of+"+area+"sq.ft.+via+MLS+CS+analysis&";
submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?"+report_name+"category=allreal&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabviewevalsqft"+area+"&arcriteria=1&status=CS&closing_date%3E=2009-08-01&property_type="+listing_type,"per-MLS-CS-sq.ft","Run a value comparison report (sale price per sq.ft of living area) based on recent  closed sales"); 
report_name="place_name=Comparables+valuation+of+"+area+"sq.ft.+via+County+Records+analysis&";
submenuOrBr("http://"+server +"/cgi-bin/arquery"+tester+".cgi?"+report_name+"category=deeds_props&y1="+alatitude+"&x1="+alongitude+"&vid="+vid+"&tfaction=tabviewevalsqft"+area+"&arcriteria=1&Recording_Date%3E=20090801&Computed_Sale_Price%3E=20000&TOTLAREA%3E="+area/2+"&TOTLAREA%3C="+area*2,"per-Deeds-sqft","Run a value comparison report (sale price per sq.ft. of living area) based on recent recorded sales"); 
}}
submenu_section();
}
if (creal) {
submenu_arquery('gnis2009','Places','','Public places nearby');
submenu_section('People');submenuOrBr(blockurl,blockicon,blocktext,iframe_arquery(blockurl));submenuOrBr(bgurl,bgicon,bgtext,iframe_arquery(bgurl));
submenu_section();
};
if (creal) {submenu_section('Schools'); submenu_arquery('public_schools','public','','public schools'); submenu_arquery('private_schools','private','','private schools');submenu_section() }
}
if (felipa_pulldown_on&&istabulate&&!printable) felipa_pulldown();
if (!printable) pointbuttona(arquery_keyurl(p1),'details16x16.gif','');
   if (isArquery&&!printable) pointbutton(pointdata_aurl().replace(/.tfaction=[^&]*/g,''),'more1grey.gif','PointData: Summary from all the datasets and maps at this location');
}
var redmsg=(red)?('<p><font color=red>Red color ('+olabelnet+ ')</font>'+' means you have clicked approximately on the '+objectcat+'.'):'';
var arqueryhelp=(isArquery?'<hr><b>Refine this Query:</b> Mouse over any blue word in any column on right or any symbol (&ge;, &le;) to see instructions on how you can refine this query. Once you click on any such word or symbol you will see more options of defining search criteria for that field.':'');
   var arrowmsg=(ft==0?valarrow+' symbolizes that the current page is '+approximately+'centered on this '+objectcat+'.':'Arrow '+valarrow+' shows direction ('+direction+') and distance to the '+objectcat+''+objectref+'<p>Click on the arrow '+valarrow+' to go to recenter report on this '+objectcat+''+objectref+'.');
var pulldown_help=felipa_pulldown_on?'<hr>Pull down <img src='+images+'pulldown.gif> for  a menu of actions on this '+ocat+':':'';
   //if (distcnbr==1&&!isArquery&&!printable)  popq('',arrowmsg+'<p>Click '+detailref+' for detailed information about the '+objectcat+'.'+redmsg+(felipa?pulldown_help+flyiconhelp+mapiconhelp+moreiconhelp+searchiconhelp+paniconminihelp+allfieldshelp:''));
   if (distcnbr==1&&!isArquery&&!printable)  popq('',arrowmsg+'<p>Click '+detailref+' for detailed information about the '+objectcat+'.'+redmsg+pulldown_help);
   //if (distcnbr==1&&isArquery&&!printable)  popq('','<b>Details:</b> Click '+detailref+' for detailed information about the '+objectcat+'.<hr><b>Location data:</b><p>'+arrowmsg+(felipa?flyiconhelp+mapiconhelp+moreiconhelp+searchiconhelp+paniconminihelp+allfieldshelp:'')+arqueryhelp);
   if (distcnbr==1&&isArquery&&!printable)  popq('','<b>Details:</b> Click '+detailref+' for detailed information about the '+objectcat+'.<hr><b>Location data:</b><p>'+arrowmsg+pulldown_help+arqueryhelp);
    }
    else {
      if (distcnbr==1) if (!printable) popq(val,'This place is '+approximately+ft+' feet ='+meters+' meters, ='+miles+' miles, =<b>'+km+' kilometers</b> '+direction+from);
      else popbi(val,distcnbr+'. This place is '+approximately+ft+' feet ='+meters+' meters, ='+miles+' miles, =<b>'+km+' kilometers</b> '+direction+from);
    }
  }
}


wh='iht=359&iwd=422';
wh0='iht=359&iwd=422';



function micro(mapurl) {
  return '';
}

function nano(mapurl) {
  return '<iframe src="'+mapurl+'" border=0 width=1 height=1></iframe>';
}

function tigerref(wealth,label,legend) {dw();
  //poph_static(hr,label,'Click for detailed map album or <b>HOLD MOUSE</b> for a small '+label+' map<br><img src='+wealth+load+'>'+(legend=='undefined'?'':legend),777);
  pophb(hr,label,'Click for detailed map album or <b>HOLD MOUSE</b> for a small '+label+' map<br><img src='+wealth+load+'>'+(legend=='undefined'?'':legend),777);
  dw('&nbsp;');
}
function tigershow(wealth,label,legend) {dw();
hr='http://n1.cs.fiu.edu/cgi-bin/d.cgi?tigermaps=&gnis0=&searchstring='+searchstringplus+'&lat='+latitude+'&long='+longitude+'&bigmap=1';
  dw('<table><tr><td>');
  pophb(hr,'<img src='+wealth+'>','Click for a larger demographic map');
dw('</td></tr><tr><td>');
  dw((legend=='undefined'?'':legend)+'</td></tr></table>')
  dw('&nbsp;');
}
function tigersshow(){
return;
if (typeof(wealth!='undefined')) {dw('<table  border=0><tr><td>Median Family Income in 2000:');
dw('</td></tr><tr><td>');
    tigershow(wealth,'Wealth','<img src='+images+'tigerlegend.gif>');
dw('</td></tr><tr><td>');
dw('</td></tr><tr><td>Population density in 2000:');
dw('</td></tr><tr><td>');
    tigershow(density,'Density','<img src='+images+'tigerlegend.popdensity.gif>');
dw('</td></tr></table>');
}
}

function weather(){
dw('<p><b>Weather:</b><br>');
 //   dw('<table align=right><tr><td>');
    weathericon='http://oper.dblive.com/zml/products?ext=jpg&h=116&w=144&lang=us&act_p=image&user=terrafly&pass=trfg$us&client=terrafly&retrieve=yes&object=clickweather&package=239&act=forecast&tf=1&lat='+latitude+'&lon='+longitude;
    weatherlink='http://www.clickweather.com/zml/clickweather?user=terrafly&long_point='+longitude+'&lat_point='+latitude+'&act=forecast';
    weatherpop='http://www.clickweather.com/zml/pforecast?lat='+latitude+'&lon='+longitude;
  pophb(weatherlink, '<img src="'+weathericon+'" alt=""  border=0>','Click for weather forecast');
  if (typeof(zipcode)!='undefined') if (zipcode!='') {
dw();
var ws='http://www.wunderground.com/cgi-bin/satblast/satBlast?lat='+latitude+'&lon='+longitude+'&width=640&height=450&zoom=2&SatType=VIS&Map.x=328&Map.y=193';
pophb(ws,'<img src="http://banners.wunderground.com/banner/ban/wxBanner?bannertype=sunandmoon150_both&zip='+zipcode+'" border=0 alt="" height=50 width=150>','Click for Weather Satellite');
dw();
var ww='http://www.wunderground.com/cgi-bin/findweather/getForecast?query='+zipcode;
pophb(ww,'<img src="http://banners.wunderground.com/banner/ban/wxBanner?bannertype=miniStates&zip='+zipcode+'" border=0 alt="" height=100 width=150>',statename+ ' flag with curent weather. Click for forecast from WeatherUnderground');
dw('<p>');
var yw='http://weather.yahoo.com/search/weather2?p='+zipcode;
pophb(yw,'Yahoo','Click for weather forecast');dw();
var ww='http://www.weather.com/weather/local/'+zipcode+'?lswe='+zipcode+'&lwsa=WeatherLocalUndeclared'
pophb(ww,'Weather.com','Click for weather forecast');dw();
var ww='http://www.srh.noaa.gov/zipcity.php?inputstring='+zipcode;
pophb(ww,'NOAA',popframe(ww,670,670));dw();
dw('<br>')

  }

}
function weatherbutton(){
if (zipcode>0) {
var sticker='<img src="http://banners.wunderground.com/banner/ban/wxBanner?bannertype=smalltemptr&zip='+zipcode+'" border=0 alt="" height=28 width=53 align=top class="bttn">';
var weatherlink='http://www.wunderground.com/cgi-bin/findweather/getForecast?query='+zipcode;
var weatherpop=popframe('http://www.srh.noaa.gov/zipcity.php?inputstring='+zipcode,670,670);
pophb(weatherlink,sticker,weatherpop);

}
}

function mapbar() {
  predemog();
  dw('<TABLE bgcolor="#EFEFDE" width="'+tabwidth+'" border=0 cellspacing=0><TR><td>');
  tiger='http://tiger.census.gov/cgi-bin/mapper/map.gif?lat='+latitude+'&lon='+longitude+'&mlat='+latitude+'&mlon='+longitude+'&msym=cynpin&mlabel=&murl=&conf=mapnew.con&'+wh+'&';
  tiger0='http://tiger.census.gov/cgi-bin/mapper/map.gif?lat='+latitude+'&lon='+longitude+'&mlat='+latitude+'&mlon='+longitude+'&msym=cynpin&mlabel=&murl=&conf=mapnew.con&'+wh0+'&';
  wealth=tiger0+'ht=0.120&wid=0.120&on=CITIES&on=majroads&on=miscell&on=places&on=interstate&on=statehwy&on=states&on=ushwy&on=water&tlevel=censusb&tvar=income&tmeth=i';
  density=tiger+'ht=0.480&wid=0.480&on=CITIES&on=majroads&on=miscell&on=places&on=interstate&on=statehwy&on=states&on=ushwy&on=water&tlevel=tracts&tvar=density&tmeth=q';
  zoomin=tiger+'wid=0.015&ht=0.015&on=CITIES&on=majroads&on=miscell&on=places&on=streets&on=interstate&on=statehwy&on=states&on=ushwy&on=water&tlevel=-&tvar=-&tmeth=i';
  statemap=tiger+'ht=8.640&wid=8.640&on=CITIES&on=miscell&on=places&on=interstate&on=states&on=ushwy&on=water&tlevel=-&tvar=-&tmeth=i';
  regional=tiger+'ht=2.160&wid=2.160&on=CITIES&on=counties&on=miscell&on=interstate&on=statehwy&on=states&on=ushwy&on=water&tlevel=-&tvar=-&tmeth=i';
if (!mlike(vid,'condex')&&!ispopup) {
  dw('Physical Maps: ');
for (maplevel=1;maplevel<7;maplevel++) {
dw();pophb('http://www.expedia.com/pub/agent.dll?qscr=mrdt&ID=3XNsF.&CenP='+latitude+','+longitude+'&Lang=WLD0409&Alti='+maplevel+'00&Size=1200,800&Offs=0,0&MapS=0&Pins=|21bb|',maplevel,'Expedia Physical Map at Altitude='+maplevel+'00');
};

dw(' Map Servers: ');
pophb('http://www.mapquest.com/maps/map.adp?latlongtype=decimal&zoom=5&latitude='+latitude+'&longitude='+longitude,'MapQuest','MapQuest map'); 
dw();pophb('http://maps.google.com/maps?q='+citynameplus+'&ll='+latitude+'%2C'+longitude,'Google','Google map');
dw();pophb('http://local.live.com/default.aspx?v=2&cp='+latitude+'~'+longitude+'&style=h&lvl=17','Windows Local','Windows Live Local (former Microsoft Virtual Earth)');
  if (USA) {
dw();pophb(gniscgi+'Lat='+latitude+'&Long='+longitude+'&tfaction=dispense&place_name='+statename+'&areatype=state#State+Maps',statecode+' Maps','Printable PDF maps of '+statename);
}
}
  if (USA) {
if (1==2) {
dw('<br>');
    dw(' US Census Maps: '); 
    tigerref(zoomin,'ZoomIn','');
    tigerref(wealth,'Wealth','<img src='+images+'tigerlegend.gif>');
    tigerref(density,'Density','<img src='+images+'tigerlegend.popdensity.gif>');
    tigerref(regional,'Region','');
    tigerref(statemap,'State','');
    dw('<br>Environmental Maps: ');
    //dw(' FEMA: ');     pophb(floodzoomouthref,micro(statemap)+'Flood Zones, Hazards ','Click this link to explore FEMA Flood Zones and Hazards Map.',300);dw();
    dw(' EPA: ');
    waste='http://oaspub.epa.gov/enviro/ef_home3.html?p_zipcode='+zipcode+'&p_type=zip&x=25&y=4'
    pophb(waste,'Waste','map of toxic releases into air and water discharge in Zipcode '+zipcode);dw();
    waterair='http://134.67.99.77/aspscripts2/myWindow.asp?xl='+(longitude-.03)+'&yb='+(latitude-.03)+'&xr='+(longitude-0+.03)+'&yt='+(latitude-0+.03);pophb(waterair,'Water&Air','interactive map and EPA reports from air and water monitoring stations (if the EPA server is up:-))');dw();
    toxic='http://oaspub.epa.gov/wme/i3_ef_link.query_links?db_type=ENVIROFACTS&ul_lr='+(longitude-.03)+','+(latitude-.03)+','+(longitude-0+.03)+','+(latitude-0+.03);pophb(toxic,'Polluters?','list and details of facilities regulated by EPA');dw();
}
    if (1==2) {
dw('<br>TerraFly Reports: ');
    poph(demog,'Demographics','<table><tr><td>demographics of all areas containing the current location.</td></tr></table>');dw();
    if (real_on==1) poph(real,'Homes 4Sale','<table><tr><td>homes listed for sale near the current location.<br>'+popframe(real,800,1000)+'</td><td>'+'</td></tr></table>',800);dw();
    if (typeof(zipcode)!='undefined') { lifequality='http://n150.cs.fiu.edu/geodata/bstp.iq2?Query=GetAreaDetails&format=html&aid=Z'+zipcode;poph(lifequality,'Life Quality','<table><tr><td>see Quality of Life Report for zip code '+zipcode+'<br>'+popframe(lifequality,450,600)+'</td><td>'+'</td></tr></table>',800);dw(); }
    poph(hotels,'Hotels','<table><tr><td>report on hotels near this location; click on hotel name to check availability/prices and reserve.<br>'+popframe(hotels,800,1000)+'</td><td>'+'</td></tr></table>',800);dw();
    poph(schoolref,'Schools','<table><tr><td>a report on nearby schools.<br>'+popframe(schoolref)+'</td><td>'+'</td></tr></table>',800);dw();
    //pophb(weatherlink, 'Weather','Weather forecast'+popframe(weatherpop));dw();
}
  }

if (!mlike(vid,'condex')&&!ispopup) {
  dw('<br>Fees: ')
  aerialpop='http://dispense.cs.fiu.edu/tf001.asp?long='+longitude+'&lat='+latitude+'&width=1500&height=1500';
  if (tfpopupvip==1) {
    poph(aerial,'Aerials','Click for photo-prints and downloadables of aerial photos, TerraAtlas, topo-maps, etc. You will be able to adjust size.',800);
    dw();
  }
  else {
    poph(aerial,redden('Aerials'),'Click for photo-prints and downloadables of aerial photos  etc. You will be able to adjust size.',800);dw();
    poph(aerial0+'width=3000&height=2400&tab=prints&preclick=','Prints','Click for photo-prints of aerial photos, topo-maps, etc. Changeable recommended size is 20x16 inch',800);dw();
    poph(aerial0+'width=2000&height=2600&area=incorp&tab=atlas&preclick=5','TerraAtlas','Click for downloadable pdf Atlas of imagery with street overlays.',800);dw();
    poph(aerial+'&preclick=','Topo-maps','Click for photo-prints and downloadables of  topo-maps, etc. ',800);dw();
    poph(aerial+'&tab=poster&preclick=','Posters','Click for Art-photo posters of satellite views of nearby locations',800);dw();
    poph(aerial0+'width=800&height=600','Mini-aerials','Downloadables of 800x600 aerial photos  etc. You will be able to adjust size.',800);dw();
    poph(aerial0+'width=1500&height=900&tab=print&preclick=','Photo-cards','Postcard-sized glossy photo-prints of aerials etc.',800);dw();
    poph(aerial0+'area=zip&tab=report&preclick=2','Reports','Premium (fees) reports about this area, e.g. 8000-field demographic report comparing all block groups within this zipcode',800);dw();
    poph(gnisdispcgi+'Lat='+latitude+'&Long='+longitude+'&tfaction=dispense','Choose size','Choose the size of downloadables and prints. You may also adjust location/address.',800);dw();
  }
}
  dw('</td></TR></TABLE>')
}

temppopwidth=350;

function environmaps(){

    dw('<p><b>Maps</b>: ');
    //dw(' FEMA: ');pophb(floodzoomouthref,micro(statemap)+'Flood Zones, Hazards ','Click this link to explore FEMA Flood Zones and Hazards Map.',300);dw();
    dw(' EPA: ');
    waste='http://oaspub.epa.gov/enviro/ef_home3.html?p_zipcode='+zipcode+'&p_type=zip&x=25&y=4'
    pophb(waste,'Waste','map of toxic releases into air and water discharge in Zipcode '+zipcode);dw();
    waterair='http://134.67.99.109/wme/myWindow.asp?myWindow.asp?RequestTimeout=300&xl='+(longitude-.06)+'&yb='+(latitude-.06)+'&xr='+(longitude-0+.06)+'&yt='+(latitude-0+.06);pophb(waterair,'Water&Air','interactive map and EPA reports from air and water monitoring stations (if the EPA server is up:-))');dw();
    toxic='http://oaspub.epa.gov/wme/i3_ef_link.query_links?db_type=ENVIROFACTS&ul_lr='+(longitude-.03)+','+(latitude-.03)+','+(longitude-0+.03)+','+(latitude-0+.03);pophb(toxic,'Polluters?','list and details of facilities regulated by EPA');dw();
}
function predemog() {
  zipres=(typeof(zipres)=='undefined')?16:zipres;
  aerialres=(typeof(aerialres)=='undefined')?8:aerialres;
  zipmap=('qTFZP'+zipres+'z'+longitude+'qALz'+latitude);
  bgmap=('qTFBG'+aerialres+'z'+longitude+'qALz'+latitude);
  bgmapq=(bgmap+'Mzp'+zipmap).replace(/q/g,'q17');
  if (typeof(place_name)=='undefined') place_name=''
  demog=gniscgi+'Lat='+latitude+'&Long='+longitude+'&areatype=bg&place_name='+(place_name==''?'This Neighborhood':'Neighborhood+of+'+place_name.replace(/ /g,'+'))+'&vid='+vid+'#Demographics';
}

function midmaps() {
  predemog();
  mapbar();
 // if (!mlike(vid,'condex')) mapbar();
  //dw('<table width="100%"> <tr> <td align=left width=376>');
  dw('<table align="center"> <tr> <td align=left width=376>');
  if (showminimaps==1) dw('<img src='+itfdata+'qTFST4z'+longitude+'qALz'+latitude+' alt="TerraFly aerial map, 4 meters/pixels"><br>Aerial 1-mile wide<hr>');
  dw('</td><td align="right">')
  if (showminimaps==1) dw('<img src='+itfdata+zipmap+' alt="TerraFly Zipcode Map, '+zipres+' meters/pixel"><br>Zipcode '+zipcode+' (map width = '+zipres/4+' miles)<hr>');
  dw('</td></tr></table>');
  dw('<table width="'+tabwidth+'"> <tr>');
  if (showminimaps==1) {
  }
  dw('<td valign=top align=right>');
  dw('</td></tr></table>');
}
function demogmaps() {
  var dzipmap=('qTFZP'+zipres+'z'+longitude+'qALz'+latitude);
  var dbgmap=('qTFBG'+aerialres+'z'+longitude+'qALz'+latitude);
  //predemog();
  //mapbar();
 // if (!mlike(vid,'condex')) mapbar();
  //dw('<table width="'+tabwidth+'"> <tr> <td align=left width=376>');
  if (showminimaps) {dw('<img src='+itfdata+'qTFST4Bz'+longitude+'qALz'+latitude+' alt="TerraFly aerial map, 4 meters/pixels"><br>Aerial 1-mile wide with population count per block<hr>');
 dw('<img src='+itfdata+dbgmap+' alt="TerraFly map of U.S. Census 2000 Block Groups, '+aerialres+' meters/pixel"><br>Neighborhoods (US Census 2000 Block Groups) with aggregate annual income<b>/<\/b>population count (map width = '+aerialres/4+' miles)<hr>');
  dw('<img src='+itfdata+dzipmap+' alt="TerraFly Zipcode Map, '+zipres+' meters/pixel"><br>Zipcode '+zipcode+' (map width = '+zipres/4+' miles)<hr>');
}
}

function red() {
  dw('<font color=red>');
}

function hspace(){dw(' &nbsp;&nbsp; ')}
function tfpophelp(noresolution) {
hspace();
  flyhelp='http://terrafly.com/how_to_fly.html';
  dataqualityhelp=vn4c+'/gnis.cgi?ispopup=1&lat='+latitude+'&long='+longitude+'&vid='+vid+'&tfaction=dataqualityhelp';
  moregif='<img src='+images+'closeup.gif border=0 width=11 height=11>';
  flyhelppop='<b>To fly</b> (or to change direction), click on the image near an edge. To zoom, click on the Zoomin-Zoomout bar above the image. Click '+moregif+'for more help.';
hspace();
  popbi(redden('Data quality.'),popframe(dataqualityhelp));
  poph(dataqualityhelp,moregif,popframe(dataqualityhelp));
hspace();
hspace();
  popbi(redden('Downloading.'),'<b>To download</b> or order imagery or data or to <b>get prints</b>: <p>Method 1: in Terra<b>Flight</b> open the Download tab, press <b>MARK</b> (in the bar above the imagery window), drag the mouse over the imagery to create a red rectangle, then press <b><img src='+images+'dispense.gif></b>.  <i>To download a very large image: zoom-out, <b>MARK</b> a rectangle, press <b><img src='+images+'dispense.gif></b>, and you will get a menu of all resolutions and imagery available for the area you marked.</i><p>Method 2: in this PointData page in the table of regions below click on any <em><b>sq.miles</b></em> to get an appropriate region');
  poph(aerial,moregif,'Click for a menu of aerial products for this point');
}
function tfpophelpshort() {
  var valarrow='<img border=0 src='+images+'north-east.gif>';movehelp='<p>To <b>move</b>/recenter this page, click on the aerial <b>map</b> or enter an <b>address</b> or coordinates or click on any arrow '+valarrow+'.';
var  flyhelp='http://terrafly.com/how_to_fly.html';
var   helpgif='<img src='+images+'bluequestion.gif border=0 width=16 height=16>';
var          moregif='<img src='+images+'closeup.gif border=0 width=11 height=11>';
var  flyhelppop='<b>To fly</b> (or to change direction), click on the image near an edge. To zoom, click on the Zoomin-Zoomout bar above the image. Click '+moregif+'for more help.';
var pointdatahelp='In Terra<b>Flight</b>, for <b>information about a point</b> in the image, doubleclick on that point.<p><b>This PointData</b> page contains information about the object you clicked on, objects nearby, data about the area, and various maps.  <p>To see medium level details about any data item, place and <b>HOLD MOUSE</b> over any icon, link, or tab.  For more details click on the item.';
  //poph(aerial,helpgif,'Click for a menu of aerial products for this point');
  popq('',pointdatahelp+movehelp,600);
  //poph(aerial,downloadbutton,popframe(dataqualityhelp));
  //poph(dataqualityhelp,moregif,popframe(dataqualityhelp));
  //poph(aerial,downloadbutton,'Click for a menu of aerial products for this point.<p>'+downloadhelp);
}
function downloadbutton() {
var  dataqualityhelp=vn4c+'/gnis.cgi?ispopup=1&lat='+latitude+'&long='+longitude+'&vid='+vid+'&tfaction=dataqualityhelp';
var   downloadbutton='<img src='+images+'download.gif border=0 width=75 height=20>';
var downloadhelp='<b>To download</b> or order imagery or data or to <b>get prints</b>: <p>Method 1: in Terra<b>Flight</b> open the Download tab, press <b>MARK</b> (in the bar above the imagery window), drag the mouse over the imagery to create a red rectangle, then press <b><img src='+images+'dispense.gif></b>.  <i>To download a very large image: zoom-out, <b>MARK</b> a rectangle, press <b><img src='+images+'dispense.gif></b>, and you will get a menu of all resolutions and imagery available for the area you marked.</i><p>Method 2: in this PointData page in the table of regions below click on any <em><b>sq.miles</b></em> to get an appropriate region';
  poph(aerial,downloadbutton,'Click for a menu of aerial products for this point.<p>'+downloadhelp+popframe(dataqualityhelp));
}
function timebutton(timezone,hours,timezonenumber) {
var tzd=(typeof(hours)=='undefined'?'':hours);
var tz=(typeof(timezone)=='undefined'?'America/New_York':timezone);
var zones='4 Africa/Accra 7 Africa/Addis_Ababa 14 Africa/Algiers 700 Africa/Asmara 29 Africa/Bamako 694 Africa/Bangui 30 Africa/Banjul 40 Africa/Bissau 40 Africa/Blantyre 926 Africa/Brazzaville 52 Africa/Bujumbura 53 Africa/Cairo 60 Africa/Casablanca 60 Africa/Ceuta 67 Africa/Conakry 74 Africa/Dakar 71 Africa/Dar_es_Salaam 697 Africa/Djibouti 697 Africa/Douala 697 Africa/El_Aaiun 85 Africa/Freetown 86 Africa/Gaborone 96 Africa/Harare 111 Africa/Johannesburg 115 Africa/Kampala 118 Africa/Khartoum 119 Africa/Kigali 121 Africa/Kinshasa 125 Africa/Lagos 129 Africa/Libreville 135 Africa/Lome 138 Africa/Luanda 138 Africa/Lubumbashi 140 Africa/Lusaka 699 Africa/Malabo 146 Africa/Maputo 147 Africa/Maseru 149 Africa/Mbabane 160 Africa/Mogadishu 161 Africa/Monrovia 170 Africa/Nairobi 174 Africa/Ndjamena 180 Africa/Niamey 183 Africa/Nouakchott 186 Africa/Ouagadougou 186 Africa/Porto-Novo 186 Africa/Sao_Tome 252 Africa/Tripoli 253 Africa/Tunis 266 Africa/Windhoek 266 America/Adak 18 America/Anchorage 18 America/Anguilla 18 America/Antigua 18 America/Araguaina 51 America/Argentina/Buenos_Aires 51 America/Argentina/Catamarca 51 America/Argentina/Cordoba 51 America/Argentina/Jujuy 51 America/Argentina/La_Rioja 51 America/Argentina/Mendoza 51 America/Argentina/Rio_Gallegos 51 America/Argentina/Salta 226 America/Argentina/San_Juan 226 America/Argentina/San_Luis 226 America/Argentina/Tucuman 226 America/Argentina/Ushuaia 226 America/Aruba 21 America/Asuncion 21 America/Atikokan 21 America/Bahia 21 America/Bahia_Banderas 21 America/Barbados 21 America/Belem 21 America/Belize 1922 America/Blanc-Sablon 1922 America/Boa_Vista 41 America/Bogota 42 America/Boise 42 America/Cambridge_Bay 42 America/Campo_Grande 42 America/Cancun 58 America/Caracas 58 America/Cayenne 58 America/Cayman 64 America/Chicago 64 America/Chihuahua 64 America/Costa_Rica 64 America/Cuiaba 64 America/Curacao 64 America/Danmarkshavn 64 America/Dawson 64 America/Dawson_Creek 75 America/Denver 77 America/Detroit 77 America/Dominica 80 America/Edmonton 80 America/Eirunepe 80 America/El_Salvador 80 America/Fortaleza 80 America/Glace_Bay 80 America/Godthab 80 America/Goose_Bay 80 America/Grand_Turk 80 America/Grenada 80 America/Guadeloupe 94 America/Guatemala 93 America/Guayaquil 93 America/Guyana 286 America/Halifax 99 America/Havana 99 America/Hermosillo 105 America/Indiana/Indianapolis 105 America/Indiana/Knox 105 America/Indiana/Marengo 352 America/Indiana/Petersburg 352 America/Indiana/Tell_City 352 America/Indiana/Vevay 352 America/Indiana/Vincennes 352 America/Indiana/Winamac 352 America/Inuvik 352 America/Iqaluit 352 America/Jamaica 352 America/Juneau 413 America/Kentucky/Louisville 413 America/Kentucky/Monticello 124 America/La_Paz 131 America/Lima 137 America/Los_Angeles 137 America/Maceio 143 America/Managua 144 America/Manaus 144 America/Marigot 144 America/Martinique 144 America/Matamoros 148 America/Mazatlan 148 America/Menominee 148 America/Merida 148 America/Metlakatla 155 America/Mexico_City 155 America/Miquelon 155 America/Moncton 155 America/Monterrey 163 America/Montevideo 165 America/Montreal 165 America/Montserrat 173 America/Nassau 179 America/New_York 179 America/Nipigon 179 America/Nome 179 America/Noronha 179 America/North_Dakota/Beulah 179 America/North_Dakota/Center 179 America/North_Dakota/New_Salem 179 America/Ojinaga 192 America/Panama 192 America/Pangnirtung 194 America/Paramaribo 197 America/Phoenix 709 America/Port-au-Prince 588 America/Port_of_Spain 588 America/Porto_Velho 588 America/Puerto_Rico 588 America/Rainy_River 588 America/Rankin_Inlet 209 America/Recife 210 America/Regina 210 America/Resolute 210 America/Rio_Branco 210 America/Santa_Isabel 210 America/Santarem 232 America/Santiago 230 America/Santo_Domingo 230 America/Sao_Paulo 230 America/Scoresbysund 230 America/Shiprock 230 America/Sitka 230 America/St_Barthelemy 230 America/St_Johns 230 America/St_Kitts 230 America/St_Lucia 230 America/St_Thomas 230 America/St_Vincent 230 America/Swift_
zones+=' Antarctica/DumontDUrville 678 Antarctica/Macquarie 678 Antarctica/Mawson 678 Antarctica/McMurdo 678 Antarctica/Palmer 678 Antarctica/Rothera 678 Antarctica/South_Pole 678 Antarctica/Syowa 678 Antarctica/Vostok 678 Arctic/Longyearbyen 6 Asia/Aden 382 Asia/Almaty 11 Asia/Amman 17 Asia/Anadyr 17 Asia/Aqtau 916 Asia/Aqtobe 387 Asia/Ashgabat 27 Asia/Baghdad 27 Asia/Bahrain 369 Asia/Baku 28 Asia/Bangkok 34 Asia/Beirut 384 Asia/Bishkek 384 Asia/Brunei 384 Asia/Choibalsan 384 Asia/Chongqing 389 Asia/Colombo 487 Asia/Damascus 73 Asia/Dhaka 768 Asia/Dili 776 Asia/Dubai 385 Asia/Dushanbe 385 Asia/Gaza 385 Asia/Harbin 218 Asia/Ho_Chi_Minh 102 Asia/Hong_Kong 102 Asia/Hovd 102 Asia/Irkutsk 108 Asia/Jakarta 759 Asia/Jayapura 110 Asia/Jerusalem 113 Asia/Kabul 113 Asia/Kamchatka 757 Asia/Karachi 757 Asia/Kashgar 117 Asia/Kathmandu 54 Asia/Kolkata 372 Asia/Krasnoyarsk 122 Asia/Kuala_Lumpur 122 Asia/Kuching 123 Asia/Kuwait 123 Asia/Macau 123 Asia/Magadan 123 Asia/Makassar 145 Asia/Manila 169 Asia/Muscat 680 Asia/Nicosia 680 Asia/Novokuznetsk 375 Asia/Novosibirsk 374 Asia/Omsk 374 Asia/Oral 199 Asia/Phnom_Penh 199 Asia/Pontianak 205 Asia/Pyongyang 205 Asia/Qatar 205 Asia/Qyzylorda 205 Asia/Rangoon 214 Asia/Riyadh 214 Asia/Sakhalin 214 Asia/Samarkand 235 Asia/Seoul 237 Asia/Shanghai 236 Asia/Singapore 241 Asia/Taipei 244 Asia/Tashkent 371 Asia/Tbilisi 246 Asia/Tehran 690 Asia/Thimphu 248 Asia/Tokyo 720 Asia/Ulaanbaatar 720 Asia/Urumqi 260 Asia/Vientiane 261 Asia/Vladivostok 261 Asia/Yakutsk 358 Asia/Yekaterinburg 370 Asia/Yerevan 271 Atlantic/Azores 271 Atlantic/Bermuda 271 Atlantic/Canary 271 Atlantic/Cape_Verde 271 Atlantic/Faroe 271 Atlantic/Madeira 211 Atlantic/Reykjavik 211 Atlantic/South_Georgia 211 Atlantic/St_Helena 211 Atlantic/Stanley 5 Australia/Adelaide 47 Australia/Brisbane 47 Australia/Broken_Hill 47 Australia/Currie 72 Australia/Darwin 72 Australia/Eucla 396 Australia/Hobart 396 Australia/Lindeman 396 Australia/Lord_Howe 152 Australia/Melbourne 196 Australia/Perth 240 Australia/Sydney 16 Europe/Amsterdam 686 Europe/Andorra 26 Europe/Athens 35 Europe/Belgrade 37 Europe/Berlin 735 Europe/Bratislava 48 Europe/Brussels 49 Europe/Bucharest 50 Europe/Budapest 177 Europe/Chisinau 69 Europe/Copenhagen 78 Europe/Dublin 89 Europe/Gibraltar 89 Europe/Guernsey 101 Europe/Helsinki 101 Europe/Isle_of_Man 107 Europe/Istanbul 107 Europe/Jersey 107 Europe/Kaliningrad 107 Europe/Kiev 133 Europe/Lisbon 736 Europe/Ljubljana 136 Europe/London 534 Europe/Luxembourg 141 Europe/Madrid 141 Europe/Malta 141 Europe/Mariehamn 285 Europe/Minsk 674 Europe/Monaco 166 Europe/Moscow 187 Europe/Oslo 195 Europe/Paris 744 Europe/Podgorica 204 Europe/Prague 602 Europe/Riga 215 Europe/Rome 355 Europe/Samara 732 Europe/San_Marino 691 Europe/Sarajevo 691 Europe/Simferopol 673 Europe/Skopje 238 Europe/Sofia 239 Europe/Stockholm 242 Europe/Tallinn 242 Europe/Tirane 242 Europe/Uzhgorod 714 Europe/Vaduz 710 Europe/Vatican 259 Europe/Vienna 660 Europe/Vilnius 660 Europe/Volgograd 262 Europe/Warsaw 281 Europe/Zagreb 281 Europe/Zaporozhye 281 Europe/Zurich 20 Indian/Antananarivo 20 Indian/Chagos 20 Indian/Christmas 20 Indian/Cocos 20 Indian/Comoro 20 Indian/Kerguelen 20 Indian/Mahe 20 Indian/Maldives 20 Indian/Mauritius 20 Indian/Mayotte 20 Indian/Reunion 282 Pacific/Apia 22 Pacific/Auckland 63 Pacific/Chatham 63 Pacific/Chuuk 63 Pacific/Easter 63 Pacific/Efate 63 Pacific/Enderbury 63 Pacific/Fakaofo 63 Pacific/Fiji 272 Pacific/Funafuti 272 Pacific/Galapagos 272 Pacific/Gambier 272 Pacific/Guadalcanal 91 Pacific/Guam 103 Pacific/Honolulu 103 Pacific/Johnston 274 Pacific/Kiritimati 274 Pacific/Kosrae 274 Pacific/Kwajalein 717 Pacific/Majuro 717 Pacific/Marquesas 717 Pacific/Midway 717 Pacific/Nauru 717 Pacific/Niue 717 Pacific/Norfolk 717 Pacific/Noumea 717 Pacific/Pago_Pago 717 Pacific/Palau 717 Pacific/Pitcairn 717 Pacific/Pohnpei 193 Pacific/Port_Moresby 279 Pacific/Rarotonga 279 Pacific/Saipan 279 Pacific/Tahiti 279 Pacific/Tarawa 279 Pacific/Tongatapu 279 Pacific/Wa
var tzn=(typeof(timezonenumber)=='undefined'?zones.replace(tz,'==').replace(/ ==.*/,'').replace(/.* /,''):timezonenumber);
if (!mlike(tzn,'^[0-9][0-9]*$')) tzn=156;
var mini='<iframe  src="http://free.timeanddate.com/clock/i2l4eimt/n'+tzn+'/tct/pcf2e5c5/avb/ftb/th1" frameborder="0" width="58" height="18" allowTransparency="true" scrolling=no></iframe>';

var text='<iframe src="http://free.timeanddate.com/clock/i2l4pg33/n'+tzn+'/fn17/fs22/fc090/tct/pct/ahl/avt/ftb/bas2/bat0/bacfff/pd2/tt0/tw1/ta1/tb4" frameborder="0" width="328" height="54" allowTransparency="true"></iframe>';

var analog='<iframe align=top src="http://free.timeanddate.com/clock/i2l4eimt/n'+tzn+'/szw500/szh500/hocfff/hbw0/hfc000/cf100/hgr0/fav0/fiv0/mqc0f0/mqs2/mql4/mqw4/mqd86/mhc0f0/mhs2/mhl4/mhw4/mhd86/mmc0f0/mml2/mmd88/hhc00f/hhs3/hhl50/hhw11/hmc00f/hms3/hml80/hmw11/hsc00f/hsl90/hsw6" frameborder="0" width="502" height="502"></iframe>';
  //dw(tzn+tz);
  popbi(unquote(mini),unquote(text+analog)+'<br>'+tzd+' '+tz.replace(/_/g,' ').replace(/.*\//,''));
  //popbi('?',unquote(text+analog)+'<br>'+tz);
}
function show_calendar(){
var countries="37 Argentina 29 Australia 36 Austria 31 Belgium 53 Bolivia 33 Brazil 27 Canada 43 Chile 41 China 46 Colombia 58 Costa Rica 28 Croatia 51 Cuba 3 Czech Republic 2 Denmark 52 Dominican Republic 49 Ecuador 55 El Salvador 61 Equatorial Guinea 24 Finland 5 France 8 Germany 11 Greece 22 Gregorian calendar 50 Guatemala 54 Honduras 42 Hong Kong 12 Hungary 35 India 65 Indonesia 32 Ireland 34 Israel 13 Italy 26 Japan 44 Jordan 23 Julian calendar 17 Luxembourg 69 Malaysia 40 Mexico 30 New Zealand 57 Nicaragua 18 Norway 64 Pakistan 60 Panama 56 Paraguay 47 Peru 67 Philippines 14 Poland 15 Portugal 19 Romania 20 Russia 38 Serbia 63 Singapore 39 Slovakia 45 Slovenia 62 South Africa 70 South Korea 16 Spain 21 Sweden 10 Switzerland 71 Taiwan 68 Thailand 25 The Netherlands 4 Turkey 66 United Arab Emirates 9 United Kingdom 1 United States 59 Uruguay 48 Venezuela"
var country=(typeof(countryname)=='undefined'?'United States':countryname);
var code=countries.replace(country,'==').replace(/ ==.*/,'').replace(/.* /,'');
if (mlike(code,'[^0-9]')) code=1;
var month="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".substr(thismonth*4-4,3);
var calendar='http://www.timeanddate.com/calendar/print.html?year='+thisyear+'&country='+code+'&hol=20505&df=1';
if (typeof(day)!='undefined') pophb(calendar,'<small align=top><font color=black>'+month+' '+day+'</font></small>',popframe(calendar));
}
function unquote(s){return s.replace(/"/g,'')}
function tfpophelpobsolete() {
  dw('<table width="'+tabwidth+'"><tr><td align=left width="25%">');
  flyhelp='http://terrafly.com/how_to_fly.html';
  dataqualityhelp=vn4c+'/gnis.cgi?lat='+latitude+'&long='+longitude+'&vid='+vid+'&tfaction=dataqualityhelp';
  moregif='<img src='+images+'closeup.gif border=0 width=11 height=11>';
  flyhelppop='<b>To fly</b> (or to change direction), click on the image near an edge. To zoom, click on the Zoomin-Zoomout bar above the image. Click '+moregif+'for more help.';
  popbi(redden('HELP on flying'),flyhelppop);
  poph(flyhelp,moregif,flyhelppop);
  dw('</td><td align=center width="25%">');
  popbi(redden('HELP on data quality'),popframe(dataqualityhelp));
  poph(dataqualityhelp,moregif,popframe(dataqualityhelp));
  dw('</td><td align=center width="25%">');
  popbi(redden('HELP on Point Data'),'For <b>information about a point</b> in the image, click on the point.<p> This PointData page contains information about the object you clicked on, objects nearby, data about the area, and various maps.  To see medium level details about any data item, place and <b>HOLD MOUSE</b> over any icon, link, or tab.  For more details click on the item.');
  dw('</td><td align=right width="25%">');
  popbi(redden('HELP on Downloading'),'<b>To download</b> or order imagery or data or to <b>get prints</b>: <p>Method 1: press <b><img src='+images+'mark.gif></b> (in the bar above the imagery window), drag the mouse over the imagery to create a red rectangle, then press <b><img src='+images+'dispense.gif></b>.  <i>To download a very large image: zoom-out, <b><img src='+images+'mark.gif></b> a rectangle, press <b><img src='+images+'dispense.gif></b>, and you will get a menu of all resolutions and imagery available for the area you marked.</i><p>Method 2: click in this page on any <font color=red>red sq.miles</font> to get an appropriate region');
  poph(aerial,moregif,'Click for a menu of aerial products for this point');
  dw('</td></tr></table>');
}

atest=0;
dispenser=(typeof(dispenser)=='undefined')?'':dispenser
b=' ';

function aconcat(d,x1,x2,x3,x4,x5) {
  return ((typeof(x1)=='undefined')?'':x1)+d+((typeof(x2)=='undefined')?'':x2)+d+((typeof(x3)=='undefined')?'':x3)+d+((typeof(x4)=='undefined')?'':x4)+d+((typeof(x5)=='undefined')?'':x5);
}

function astart() {
set_category();
apopup0='';
alabel0='';
all_set=0;
extraother='';
isArquery=(typeof(isArquery)=='undefined')?0:isArquery;
felipa_pulldown_on=1;
if (!isArquery&&p1!='census') dw('<table width="'+tabwidth+'" border=0><tr><td>');
  amoreurl='';
  aurl='';
  photoshown='';
  photoshow='';
  if (!isArquery||atitle=='') atitle=p1;
  strippref='';
  aicon='';
isdemog=0;
extras='';
ocat=''; //object category in singular, if other than aicon
  amoreurln=vn4c+'/arquery'+tester+'.cgi?category='+p1+'&x1='+longitude+'&y1='+latitude+'&tfaction='+tfaction+'&vid='+vid+'&place_name='+place_name.replace(/[^a-zA-Z0-9]/g,'+');
  if (p1=="havanastreets") {atitle='Havana Streets'; }
  if (p1=="obfs") {atitle='Observation Biological Field Stations'; aicon='obfs';ocat='station'}
  if (p1=="rtstream") {atitle='River Gauges'; aicon='rtstream';ocat='gauge'}
  if (p1=="rtgauges") {atitle='Stream Gauges'; aicon='rtstream';ocat='gauge'}
  if (p1=="hist_rtgaugaes") {atitle='History of Stream Gauges'; aicon='rtstream';ocat='gauge';
extrasparam='arcriteria=1&TIME%3E';
extras=extraref('all','')+extraref('recent',thisyear+'-'+yestermonth+'-'+yesterday);}
  if (p1=="deeds_props"||p1=="deedsfull") {atitle='Deeds and County-recorded Documents'; aicon='bmaps';ocat='deed';

extrasparam='arcriteria=1&Document_Type_Description=DEED&Recording_Date%3E';
yesteryear=thisyear-1;
extras=extraref('all','')+extraref(thisyear,''+thisyear+'0101')+extraref(thismonth+'/'+thisyear,''+thisyear+thismonth+'01')+extraref(yesteryear+'-'+thisyear,''+yesteryear+'0101');
}
  if (p1=="ownership") {atitle='Property Records'; aicon='bmaps';ocat='property'}
  if (p1=="firstamerican_points") {atitle='Property Records (Nationwide)'; aicon='bmaps';ocat='property';
extrasparam='arcriteria=1&OWNER';
extras=extraref('any','')+extraref('City','city')+extraref('County','county')+extraref('no-owner','_null');
extrasparam='arcriteria=1&OWNER!';
extras=extras+extraref('owner','_null');
extrasparam='arcriteria=1&STD_ADDR';
extras=extras+extraref('no-address','_null');
extrasparam='arcriteria=1&STD_ADDR!';
extras=extras+extraref('address','_null');

}
  if (mlike(p1,"^flproperties")) {
atitle='Parcels - Ownership Records'; aicon='bmaps';ocat='property';
amoreurln=arquery_url('flproperties-10');
extrasparam='arcriteria=1&'+(p1=='flproperties'?'HEX_VAL1':'EXMPT01')+'%3E';

extras=extraref('all','')+extraref('homesteaded','25000');
}
  if (p1=="nfolio") {atitle='County property records'; aicon='bmaps';ocat='property'}
  if (p1=="folio") {atitle='Property records'; aicon='bmaps';}
  else if (p1=="hotels") {atitle='Hotels';strippref='';aicon='hoteltr'; ocat='hotel';
extrasparam='stars%3E';
extraother='&stars%3C=0.5';
var him='<img alt=rating src='+images+'hotel'; var hg='.gif> ';
extras=extraref('all','')+extraref(him+5+hg+'5 stars','5')+extraref(him+4+hg+'4+','4')+extraref(him+3.5+hg+'3.5+','3.5')+extraref(him+3+hg+'3+','3')+extraref(him+2+hg+'2+','2')+extraref(him+1+hg+'1+','1')+extrarefmany(him+'tr'+hg+'other','');
}
  else if (p1.search('nno_')>0) {atitle='Annotations';aicon='other_solid'; ocat='annotated location'}
  else if (p1=="street") {atitle='Streets nearby (house number is approximate)';aicon='';ocat='street';
amoreurln=arquery_url('austreets');}
  else if (p1=="dining") {atitle='Food';aicon='restaurant';}
  else if (p1=="auintersections") {atitle='Intersections';}
  else if (p1=="austreets") {atitle='Street Segments'}
  else if (mlike(p1,'Street_Segment')&&!mlike(p1,'Open')) {atitle='Segments of '+p1.replace(/.*_/,'').replace(/MajHwys/,'Major Highways').replace(/SecHwys/,'Secondary Highways')+' with NavTeq Data'}
  else if (p1=="restaurant"||p1=="nv_restrnts") {atitle='Restaurants';aicon='restaurant';
extrasparam='anyfield';
extras=extraref('all','')+extraref('Italian','italian')+extraref('Chinese','chinese')+extraref('Japanese','japanese')+extraref('Thai','thai')+extraref('Mexican','mexican')+extraref('other American North&South','american+food')+extraref('Middle Eastern','middle eastern')+extraref('vegetarian','vegetarian')+extraref('fast food','fast+food')+extraref('sandwiches','sandwich');
}
 else if (mlike(p1,'nv_')) {
if (p1=='nv_autosvc') atitle='Auto Service';
if (p1=='nv_business') atitle='Larger Corporations';
if (p1=='nv_commsvc') atitle='Community Service';
if (p1=='nv_eduinsts') atitle='Education';;
if (p1=='nv_entertn') atitle='Entertainment';
if (p1=='nv_fininsts') atitle='Banks';
if (p1=='nv_hamlet') atitle='Hamplets';;
if (p1=='nv_hospital') atitle='Hospitals';
if (p1=='nv_namedplc') atitle='Places';;
if (p1=='nv_parking') atitle='Parking';
if (p1=='nv_parkrec') atitle='Parks and Recreation';
if (p1=='nv_restrnts') atitle='Restaurants';;
if (p1=='nv_shopping') atitle='Shopping';
if (p1=='nv_transhubs') atitle='Transportation';
if (p1=='nv_travdest') atitle='Travel Destinations';



}
  else if (preal) {atitle='MLS Real Estate Professional';aicon='realestate';
ocat='property';
extrasparam='arcriteria=1&status=A&list_price%3C=2000000&property_type';
extras=extraref('All','')+extraref('RE1/Houses','RE1')+extraref('RE2/Condos','RE2')+extraref('Rental','RNT')+extraref('Commercial','COM')+extraref('Business','BUS')+extraref('Res. land','RLD')+extraref('Commercial land','CLD')+extraref('Res. income','RIN')+'<br>';
extrasparam='arcriteria=1&list_price%3C=2000000&status';
extras=extras+extraref('Any status','').replace(/,/,'')+extraref('Active','A');
extrasparam='arcriteria=1&list_price%3E=30000&closing_date%3E=2010-01-01&status';
extras=extras+extraref('Closed','CS');
extrasparam='arcriteria=1&status=A&list_price%3C=2000000&number_of_beds';
extras=extras+extraref('1 bedroom','1')+extraref('2','2')+extraref('3','3');
extrasparam='arcriteria=1&status=A&list_price%3C=2000000&number_of_beds%3E';
extras=extras+extraref('1+','1')+extraref('2+','2')+extraref('3+','3')+extraref('4+','4')+extraref('5+','5');
extrasparam='arcriteria=1&status=A&list_price%3C=5000000&price_vs_market%3E=0.2&price_vs_market%3C=1.7&type_of_property';
extras=extras+extraref(newgif+'Ocean','Ocean');
extras=extras+extraref(newgif+'Foreclosure','foreclosure');
extras=extras+extraref(newgif+'Short sale','Short_Sale');
extrasparam='arcriteria=1&status=A&list_price%3C=5000000&price_vs_market%3E=0.15&price_vs_market%3C';
extras=extras+extraref(newgif+'<b title=Probably-undervalued>Undervalued?</b>','0.95')+extraref(newgif+'<b title=Probably-very-undervalued>Steals?</b>','0.85');
extrasparam='arcriteria=1&status=A&list_price%3C=5000000&Short_Sale';
extrasparam='arcriteria=1&status=A&list_price%3C=5000000&REO';
userid=tfuser();
if (userid!='') {extrasparam='arcriteria=1&status=A&list_agent_public_id';
extras=extras+extraref(newgif+'My Listings',userid)}
}
  else if (p1=="wikix") {atitle='Wikipedia'}
  else if (p1=="whitepages") {atitle='White Pages'}
  else if (p1=="nypages") {atitle='Business Directory';aicon='business';

extrasparam='arcriteria=1&siccode';
extras=extraref('all','')+extraref('food','food')+extraref('faith','religious');
extrasparam='arcriteria=1&sales%3E';
extras+=extraref('lucrative','500000');
extrasparam='arcriteria=1&numofemp%3E';
extras+=extraref('large','10');



}
else if (p1=="emergencycalls") {atitle="Emergency Calls Test System";
extrasparam='arcriteria=1&Call_type';
extras=extraref('all','')
extras=extras+extraref('SMS','SMS');
extras=extras+extraref('MMS','MMS');
extras=extras+extraref('Voice','Voice');
extras=extras+extraref('Cell','Cell');
extras=extras+extraref('Land','Land');
extrasparam='arcriteria=1&Test_type';
extras=extras+extraref('Actual-Human','Human');
extras=extras+extraref('Simulated','Simulated');
}
  else if (p1=="crime_dade") {atitle='Crimes and Incidents Reported by Miami-Dade County and Municipal Police Departments'}
  else if (p1=="physicians") {atitle='Physicians';aicon='medical';
extrasparam='arcriteria=1&PPSC';
extras=extraref('all','')
extrasparam='arcriteria=1&PHYSICIAN_CREDENTIALS|';
extras=extras+extraref('MD','MD');
extras=extras+extraref('Dentist','DDS+DDM');
extrasparam='arcriteria=1&PPSC|';
extras=extras+extraref('General','01');
extras=extras+extraref('Family','08');
extras=extras+extraref('Internal','11');
extras=extras+extraref('Orthopedic','20');
extras=extras+extraref('Optometry','41');


}
  else if (mlike(p1,"^iypages")) {
if (p1=="iypages") atitle='Business Directory 2009';
if (p1=="iypages_demographics") atitle='Business Directory 2009 with Radius Demographics from US Census 2000';
if (p1=="iypages_dmalls") atitle='Malls with Radius Demographics from US Census 2000';
aicon='business';
if (p1!='iypages_dmalls') {
extrasparam='arcriteria=1&sic';
extras=extraref('all','')
extrasparam='arcriteria=1&sic|';
extras=extras+extraref('physicians','doctor+doctors+physician+physicians');
extras=extras+extraref('dentists','dentist+dentists+dental');
extras=extras+extraref('restaurants','restaurants+restaurant+eating');
extras=extras+extraref('malls','malls');
extras=extras+extraref('grocery','grocery+groceries')+extraref('stores','store+stores');extraref('faith','religious+synagogues+churches');
extrasparam='arcriteria=1&anyfield|';
extras=extras+extraref('condo','condominium+condominiums');
extrasparam='arcriteria=1&sales%3E';
extras+=extraref('lucrative','500000');
extrasparam='arcriteria=1&numofemp%3E';
extras+=extraref('large','10');
}


}
  else if (mlike(p1,'_UNION')) {atitle='Unified Dataset of Major Points'; }
  else if (p1=="canada_ypages") {atitle='Yellow Pages';aicon='business';}
  else if (p1=="ypages") {atitle='Yellow Pages';aicon='business';
extrasparam='anyfield';
extras=extraref('all','')+extraref('stores','shopping')+extraref('food','food+and+dining')+extraref('government',':government')+extraref('gas','gas+stations')+extraref('physicians','doctors')+extraref('dentists','clinics:dentistry')+extraref('hair','salons')+extraref('galleries',':galleries')
}
    else if (p1=="bcndx") {atitle='Featured Condominium Buildings'; aicon='re2';
ocat='building';
extrasparam='arcriteria=1&preconstruction'; extras=extraref('all','')+extraref('preconstruction','true')+extraref('occupied','false');}
    else if (p1=="cndx") {atitle='Condos on Market'; aicon='re2';
ocat='condo';
extrasparam='arcriteria=1&sale_price%3C=2000000&number_of_beds';
extras=extraref('all','')+extraref('1 bedroom','1')+extraref('2','2')+extraref('3','3');
extrasparam='arcriteria=1&sale_price%3C=2000000&number_of_beds%3E';
extras=extras+extraref('1+','1')+extraref('2+','2')+extraref('3+','3')+extraref('4+','4')+extraref('5+','5');

}
  else if (p1=="real") { atitle='Homes offered'; aicon='realestate';
extrasparam='arcriteria=1&property_type_code'; extras=extraref('all','')+extraref('houses',1)+extraref('condos',2);
ocat='property';

    if (vid=="ramb") atitle='MLS Residential Listings (multi-source)';
  }
  else if (p1=="ramb"||p1=="fproperties"||p1=="callreal") { atitle='Real estate offered in MLS'; aicon='realestate';
if (mlike(tfaction,'rambbroker;')){var identity=tfaction.replace(/.*rambbroker;/,'').replace(/^[^;]*;/,'').replace(/[;+]/g,' '); atitle=identity}
    if (p1=="fproperties") atitle='Featured Real Estate';
ocat='property';

extrasparam='arcriteria=1&price%3C=2000000&bedroom';
extras=extraref('all','')+extraref('1 bedroom','1')+extraref('2','2')+extraref('3','3');
extrasparam='arcriteria=1&price%3C=2000000&bedroom%3E';
extras=extras+extraref('1+','1')+extraref('2+','2')+extraref('3+','3')+extraref('4+','4')+extraref('5+','5');

if (p1=="callreal") {
extrasparam='arcriteria=1&list_price%3C=2000000&property_type';
extras=extraref('All','')+extraref('Houses','RE1')+extraref('Condos','RE2')+extraref('Rental','RNT');
extrasparam='arcriteria=1&list_price%3C=2000000&number_of_beds';
extras=extras+extraref('1 bedroom','1')+extraref('2','2')+extraref('3','3');
extrasparam='arcriteria=1&list_price%3C=2000000&number_of_beds%3E';
extras=extras+extraref('1+','1')+extraref('2+','2')+extraref('3+','3')+extraref('4+','4')+extraref('5+','5');
extrasparam='arcriteria=1&list_price%3C=5000000&Short_Sale';
extras=extras+extraref(newgif+'Short Sale','Y');
extrasparam='arcriteria=1&status=A&list_price%3C=5000000&REO';
extras=extras+extraref(newgif+'Foreclosed','Y');


}
  }
  else if (p1=="fires") {atitle='Fires'; aicon='fire'; ocat='fire location'}
  else if (p1=="nraws") {atitle='Weather Stations';aicon='weather';ocat='station'}
  else if (p1=="raws") {atitle='Weather Stations';aicon='weather';ocat='station'}
  else if (p1=="town") {atitle='Towns and Incorporated Areas';aicon='city';}
  else if (p1=="ikonos") {atitle='Ikonos Satellite Images';aicon='';ocat='image'; extrasparam='arcriteria=1&mcca_full%3C'; extras=extraref('all','')+extraref('clear','10');}
  else if (p1=="geoeye") {atitle='GeoEye Satellite Images';aicon='';ocat='image'; extrasparam='arcriteria=1&mcca_full%3C'; extras=extraref('all','')+extraref('clear','10');}
  else if (p1=="medical_dade") {atitle='Medical Examiner Records';aicon='other';}
  else if (p1=="wtown3") {atitle='Towns';aicon='city';}
  else if (p1=="wcity") {
    atitle='Hub Cities';
    aicon='hubcity';ocat='city';
    aurl='http://books-maps.com/'+kountrycode;
  }
  else if (p1=='gnis'||p1=='newgnis'||p1=='gnis2009') {ocat='place';
    atitle='Places';
extrasparam='placetype';
extraother='&placetype!=museum';
if (USA&&p1=='gnis') extras=extraref('all','')+extraref('communities','community')+extraref('parks','park')+extraref('public buildings','building')+extraref('locales','locale')+extraref('worship','faith')+extraref('heliports','heliport')+extraref('hospitals','hospital')+extraref('streams','stream')+extraref('lakes','lake')+extraref('bridges','bridge')+extrarefmany('museums','anyfield=museum')+extraref('towers','tower')+extraref('islands','island')+extrarefmany('','');
if (USA&&(p1=='gnis2009'||p1=='newgnis')) extras=extraref('all','')+extraref('communities','populated')+extraref('parks','park')+extraref('public buildings','building')+extraref('locales','locale')+extraref('worship','church')+extrarefmany('heliports','anyfield=heliport')+extraref('hospitals','hospital')+extraref('streams','stream')+extraref('lakes','lake')+extraref('bridges','bridge')+extrarefmany('museums','anyfield=museum')+extraref('towers','tower')+extraref('islands','island')+extrarefmany('','');
    aicon='other';
  }
  else if (p1=="geoimages") {atitle='High-res Photo Library'; aicon='';

extrasparam='arcriteria=1&visualvalue%3E'; extras=extraref('all','')+extraref('nice',4)+extraref('best',5);
}
  else if (p1=="airport") {atitle='Airports (ICAO code, Name, Elevation)'; aicon='airport';

extrasparam='arcriteria=1&name'; extras=extraref('all','')+extraref('international','INTL');
}
  //else if (p1=="school") {atitle='Schools'; aicon='school';amoreurl=schoolref}
  else if (p1=="ngagns") {atitle=(USA?'Offshore':'Places'); aicon='otherblue'; 
ocat='place';
extrasparam='arcriteria=1&FC'; extras=extraref('all','')+extraref('community','P')+extraref('water','H')+extraref('height','T')+extraref('undersea','U');}
  else if (p1=="public_schools") {atitle='Public Schools'; aicon='school';

extrasparam='arcriteria=1&sch_level_code'; extras=extraref('all','')+extrav('Primary')+extrav('Middle')+extrav('High');
}
  else if (mlike(p1,"gns")) {atitle='Places/NGA'; aicon='otherblue'; 
ocat='place';
extrasparam='arcriteria=1&FT'; extras=extraref('all','')+extraref('community','P')+extraref('water','H')+extraref('height','T')+extraref('undersea','U');

extrasparam='arcriteria=1&FD'; extras=extras+extrarefv('administrative') +extrarefv('airport') +extrarefv('area') +extrarefv('bay') +extrarefv('bridge') +extrarefv('building') +extrarefv('camp') +extrarefv('canal') +extrarefv('church') +extrarefv('dam') +extrarefv('forest') +extrarefv('hill') +extrarefv('hospital') +extrarefv('hotel') +extrarefv('island') +extrarefv('junction') +extrarefv('lake') +extrarefv('locality') +extrarefv('mall') +extrarefv('mine') +extrarefv('mountain') +extrarefv('park') +extrarefv('reservoir') +extrarefv('school') +extrarefv('shrine') +extrarefv('spring') +extrarefv('station') +extrarefv('stream') +extrarefv('swamp') +extrarefv('trail') +extrarefv('valley')

}
  else if (p1=="public_schools") {atitle='Public Schools'; aicon='school';

extrasparam='arcriteria=1&sch_level_code'; extras=extraref('all','')+extrav('Primary')+extrav('Middle')+extrav('High');
}
  else if (p1=="private_schools") {atitle='Private Schools'; aicon='school';
extrasparam='arcriteria=1&orient'; extras=extraref('all','')+extrav('Baptist')+extrav('Catholic')+extrav('Evangelical')+extrav('Jewish')+extrav('Lutheran')+extrav('Nonsectarian');
}
  else if (p1=="school") {atitle='Schools'; aicon='school'
extrasparam='arcriteria=1&type'; extras=extraref('all','')+extraref('public','Public')+extraref('private','Private');
extrasparam='arcriteria=1&institution_name'; extras+=extraref('high','high');
extrasparam='arcriteria=1&total_students%3E'; extras+=extraref('big','1000');


}
  //else if (p1=="college") {atitle='Colleges'; aicon='school'}
  else if (p1=="college") {atitle='Colleges'; aicon='college';
extrasparam='arcriteria=1&type_of_college'; extras=extraref('all','')+extraref('public','Public')+extraref('private','Private');
extrasparam='arcriteria=1&anyfield'; extras+=extraref('4-year','4-year');

}
  else if (p1=="photos") {atitle='Architecture Photography'; aicon='';ocat='building'}
else if (p1=="ptrim") {atitle='Rainfall Yesterday</b> (NASA Goddard TRMM, mean over .25x.25 degree cell)';
ocat='cell';
extrasparam='arcriteria=1&daily%3E'; extras=extraref('all','')+extraref('wet','0.01')+extraref('soaked','15');
}
  else if (p1=="posters") {atitle='Posters';
ocat='image';
extrasparam='city%3E'; extras=extraref('all','')+extraref('urban','a');
}
  else if (p1=="blocks") {atitle='Census Blocks'; ocat='Census block'}
  else if (p1=="dos") {atitle='Department of State Markers'; ocat='marker'}
else  if (p1=='pblock'||p1=='pbg'||p1=='ptract'||p1=='pzipcode'||p1=='pmetro'||p1=='pcongress'||p1=='pincorp'||p1=='pcounty'||p1=='psubcounty') {



extrasparam='arcriteria=1&sf1P013001%3E';
extras=extraref('all','');
extras+=extraref('adult',60);
extrasparam='arcriteria=1&sf1P013001%3C';
extras+=extraref('young',30);
if (p1!='pblock') {
extrasparam='arcriteria=1&sf1P017001%3E';
extras+=extraref('kids',3);
extrasparam='arcriteria=1&sf3H024001%3E';
extras+=extraref('spacious',4);
extrasparam='arcriteria=1&sf3P053001%3E';
extras+=extraref('wealthy',60000);
}
atype=p1.substr(1,30);
longertype=atype;
if (atype=='metro') longertype='Metropolitan Area';
if (atype=='congress') longertype='Congressional District';
if (atype=='zipcode') {longertype='Zip Code'}
longertypes=longertype+'s';
if (atype=='tract') longertype='Greater Neighborhood (Census Tract)';
if (atype=='tract') longertypes='Greater Neighborhoods (Census Tracts)';
if (atype=='bg') longertype='Neighborhood (Census Block Group)';
if (atype=='bg') longertypes='Neighborhoods (Census Block Groups)';
if (atype=='county') longertype='County';
if (atype=='county') longertypes='Counties';
if (atype=='incorp') {longertype='Town'; longertypes='Towns and Incorporated Areas'}
if (atype=='block') longertype='Census Block';
if (atype=='block') longertypes='Blocks (per U.S. Census)';
ocat=longertype;
atitle=longertypes;
isdemog=1;
}
  else if (p1=="census") {
    predemog();
    //atitle='Areas containing the current object </b>(click <i>'+redden('sq. mileage')+'</i> for aerials, prints, atlases; click <i>population</i> for demographics</i>)';
    atitle='Areas containing the current object </b>(click "<b>GO</b>" to download aerials, atlases and reports or to order prints)';
if (!showPremium) atitle='Areas';
    aicon='';
  }
  if (amoreurl=='') {
    if (strippref=='') amoreurl=amoreurln;
    else amoreurl=n157e+'wde-fmt/Executor?SName='+strippref+'STAT&F=SHTML&META=off&numfind=100&y1='+latitude+'&x1='+longitude;
  }
  if (aurl=='') aurl=amoreurl;
  //if (aurl=='') aurl=arquery_keyurl(p1);
  distcnbr=0;
  if (beston==0) dw('<a name="'+p1+'"></a>');
  if (isArquery) dw('<h2 class=titlepageGQ><b>'+atitle+'</b></h2>'+((extras==''||ispopup)?'':'<p><center>'+extras.replace(/^, /,'')+'</center><p>'));
  else dw('<p><b>'+(aicon!=''?'<img src='+images+aicon+'.gif border=0> ':'')+atitle+((extras==''||ispopup)?'':' ('+extras.replace(/^, /,'')+')')+':</b> ');
  if (p1=="census") startdemographics();
}

function extrav(label){return extraref(label,label)}

function extrarefv(label,typevalue){
if (label=='all') all_set=1;
var t=(typeof(typevalue)=='undefined'?label:typevalue)
extraother=extraother+'&'+extrasparam.replace(/%.*/,'')+'!='+t; 
return ', <a href='+amoreurln+(t==''?'':'&extraref=1&'+extrasparam+'='+t)+'>'+label+'</a>'}
function extraref(label,typevalue){
if (label=='all') all_set=1;
extraother=extraother+'&'+extrasparam.replace(/%.*/,'')+'!='+typevalue; 
return ', <a href='+amoreurln+(typevalue==''?'':'&extraref=1&'+extrasparam+'='+typevalue)+'>'+label+'</a>'}

function extrarefor(label,typevalue){
extraother=extraother+('|'+typevalue).replace(/\|/g,'&'+extrasparam+'!=');
return ', <a href='+amoreurln+'&extraref=1'+('|'+typevalue).replace(/\|/g,'&'+extrasparam+'|=')+'>'+label+'</a>'}


function extrarefmany(label,expression){return ', <a href='+amoreurln+'&extraref=1&'+(expression==''?extraother:expression)+'>'+(label==''?'other':label)+'</a>'}

function arec0(plat,plong,pdist,pcomp,poff,pname) {
  //dw(aurl);

  photo='';
  zip_code=zipcode;
  aaddress='';
  azipcode=zipcode;
  alatitude=plat;
  alongitude=plong;
  distance=pdist;
  adistance=distance;
  compass_direction=pcomp;
  offset=poff;
  aname='';
  if (typeof(pname)!='undefined') aname=pname;
  alabel=aname;
  asublabel='';
set_category();
  aurl=arquery_keyurl(p1);
}
function set_category(){
p1=(typeof(p1)=='undefined'?0:p1);
preal=(mlike(p1,'allreal')&&(p1!='callreal')); //preal = professional realtor interface
creal=(mlike(p1,'allreal')||p1=='ramb'||p1=='emergencycalls'); //creal = professional or consumer realtor interface
}

var aowner='';
function arec(fullrecord) {
var f=new Array();
var f=('	'+fullrecord).split('	');
aowner=f[1*fieldnbrof("flp_OWNER")+1*fieldnbrof("OWNER")];
var f1=f[1];
var f2=f[2];
var f3=f[3];
var f4=f[4];
var f5=f[5];
var f6=f[6];
var f7=f[7];
var f8=f[8];
var f9=f[9];
var f10=f[10];
var f11=f[11];
var f12=f[12];
var f13=f[13];
var f14=f[14];
var f15=f[15];
var f16=f[16];
var f17=f[17];
var f18=f[18];
var f19=f[19];
var f20=f[20];
var f21=f[21];
var f22=f[22];
var f23=f[23];
var f24=f[24];
var f25=f[25];
var f26=f[26];
var f27=f[27];
var f28=f[28];
var f29=f[29];

  var _staticLayer = false;
set_category();
  apoptext='';
  //if (alabel=='') alabel=f1;
  if (alabel=='') alabel=f1;
  extralabel='';
  apopurl=arquery_keyurl(p1);
  //aurl=amoreurl;
  photo='';
  aall=aconcat(' ',f1,f2,f3,f4,f5);
  apoptext=aall;
  apoptext=popframe(apopurl);
  acounter=(typeof(acounter)=='undefined')?0:acounter;
  acounter++; 
isArquery=(typeof(isArquery)=='undefined')?0:isArquery;
  if (acounter==1&&isArquery!=1) astart();

  if (atest) dw('aall='+aall);
  if (p1=="wikix") aurl=f2;
  if (p1=="wtown3") {apoptext=f1+', '+f3; aurl=gniscgi+'Lat='+alatitude+'&Long='+alongitude+'&tfaction='+tfaction+'&place_name='+alabel.replace(/ /g,'+');


}
if (p1=="physicians") asublabel=f2+' '+f5;
  if (p1=="ikonos") {
var jpgurl='http://archive.spaceimaging.com/'+f[13]+'/'+f[14];
aurl='/cgi-bin/tfdispense.cgi?lat='+alatitude+'&long='+alongitude+'&tab=ikonos&label=Ikonos+Scene';
apoptext='Ikonos Scene on '+aname+'. Click to price/dispense. Resampled preview:<br><img src='+jpgurl+'>';
scenedate=f1.replace(/ *on /,'');
cloudpct=f3;
alabel=aname;

asublabel=cloudpct+'% cloudy';
}
  if (p1=="geoeye") {
var jpgurl=f[28];
aurl='/cgi-bin/tfdispense.cgi?lat='+alatitude+'&long='+alongitude+'&tab=ikonos&label=Satellite+Scenes';
scenedate=f1.replace(/ *on /,'');
aname=hyphenate_date(scenedate);
cloudpct=f3;
alabel=aname;

asublabel=cloudpct+'% cloudy';
community=f[29];
apoptext=f[21]+' Satellite Scene on '+aname+'. Click to price/dispense. Resampled preview:<br><img src='+jpgurl+'>';
}
if (p1=="wikix") {photo=f5.replace(/http[^ ]*png/g,'')}
  if (p1=="bcndx") { aname=f4; alabel=aname; photo=f[28]; apoptext=atitle+': '+alabel;
aurl='http://miamiherald.uscondex.com/buildingview.asp?TrackFrom=TerraFly&PropertyId='+f1;
}
  if (p1=="obfs") { aname=f7; alabel=aname; apoptext=atitle+': '+alabel;}
  if (p1=="street") { aname=f1; alabel=aname; apoptext="Approximate nearest address in street block. Click for demograpic street block data";aurl=vn4c+'/arquery.cgi?category=pblock&y1='+alatitude+'&x1='+alongitude}
  if (p1=="atlasgnis") { aname=f1; alabel=aname; apoptext="Web site";aurl=f5}
  if (p1=="rtstream") { aname=f6; alabel=aname; apoptext="Click for real time reading";aurl=f[14]}
  if (p1=="rtgauges") { aname=f6; alabel=aname; 
aurl=f[16];
asublabel=measuredisplay(f[11],'ft','The water stage at '+aname+' is'); apopurl=aurl;
apoptext='Click for real time reading from  '+aname+popframe(aurl);

};
  if (p1=="rtgauges") { aname=f6; alabel=aname; 
aurl=f[16];
asublabel=measuredisplay(f[11],'ft','The water stage at '+aname+' is'); apopurl=aurl;
apoptext='Click for real time reading from  '+aname+popframe(aurl);

};
  if (p1=="hist_rtgaugaes") { aname=f6; alabel=aname; 
aurl='http://waterdata.usgs.gov/nwis/uv?'+f5;
asublabel=measuredisplay(f[11],'ft','The water stage at '+aname+' is'); 
apopurl=aurl;
apoptext='Click for real time reading from  '+aname+popframe(aurl);

};
  if (p1=="college") {collegeid=f1;college_address=f2;college_city=f3;college_state=f4; college_zip_code=f5; aname=f6; college_type=f7; aaddress=college_address; azipcode=college_zip_code;
aurl=f8.replace(/.*=/,'http://nces.ed.gov/globallocator/col_info_popup.asp?ID=') ; }
  if (p1=='gnis'||p1=='newgnis'||p1=='gnis2009'){aname=f1;type=f2}
  if (p1=="photos"){aname=f1; photo=f2;apoptext=aname }
  if (p1=="hotels"){aname=f1; hotel_chain=f2; reserve=f3; info=f4; stars=f5; street_address=f6; city=f7; state=f8; country=f9; 

zip_code=f[10]; phone=f[11]; photo=f[12]; pid=f[13]; hotel_facilities=f[16]; policy=f[17]; daily_rate_min=f[18]; daily_rate_max=f[19]; currency=f[20]; supplier=f[21];  
aaddress=street_address; azipcode=zip_code;


}
  if (p1=='real') {
aurl=f[22];
    property_type=f1;
    price=f2; area=f3;
    bedroom=unblank(f4); bathroom=unblank(f5); photo=f6;
    property_features=f7; community_features=f8;
    year_built=f9; 
street_address=f[10]; unit=f[11];
aaddress=street_address;

    community=f[12]; county=f[13]; city=f[14]; state=f[15];
    zip_code=f[16]; property_id=f[17]; contact=f[18];
azipcode=zip_code;
    phone=f[19]; fax=f[20]; email=f[21]; info=f[22];
    supplier=f[23]; listing_type=f[26]; lot_size=f[27];
    description=f[28]; property_view=f[29]; virtual_tour=f[30];
    property_type_code=f[31]; placetype=f[32]; object_id=f[33];
    if (zipcode==32804) {
      aurl=info;
      amoreurl='http://www.realtor.com/FindHome/HomeListings.asp?frm=byzip&st=&typ=1&typ=2&typ=3&typ=4&typ=5&typ=6&poe=realtor&mnbed=0&mnbath=0&mnprice=0&mxprice=99999999&js=off&pgnum=1&lnksrc=&fid=so&mnsqft=&mls=xmls&optInCheckbox=yes&zp=32804';
    }
  }
if (p1=='cndx') {
photo=f[33]; area=f[23];year_built=f[26];
lot_size='';
virtual_tour='';
street_address=f7;
aaddress=street_address;
unit=f6;
property_type='';
property_features='';
community_features='';
supplier='';
listing_type='';
price=f[40]; bedroom=unblank(f[21]); bathroom=unblank(f[22]);community=f4;
if (price=='') price=f[17]+'/month'}

  if (p1=='ramb'||p1=='fproperties') {
photo=f1
    property_type=f1;
    price=f2; area=f3;
    bedroom=unblank(f4); bathroom=(unblank(f5)/1)+(unblank(f6)/2); photo=f7;
    property_features=''; community_features='';
    year_built=f9; street_address=f[10]; unit=f11;
aaddress=street_address;
azipcode=f16;
    community=f12; county=''; city=f14; state='';
lot_size=f23; virtual_tour='';listing_type=f1;
supplier='';
}
  if (p1=='blocks') aurl=gniscgi+'Lat='+alatitude+'&Long='+alongitude+'&aid='+f1+'&vid='+vid+'&areatype=block&place_name=Census+Block+'+f1+'+'+alabel.replace(/ /g,'+');
if (isdemog) {
longername=f1;
if (p1=="pblock"||p1=="pbg"||p1=="ptract") longername=longertype+' '+f2 +' centered at '+f1;
if (p1=='pzipcode') longername='Zipcode '+f2.substr(1,30);
aurl=gniscgi+'Lat='+alatitude+'&Long='+alongitude+'&aid='+f2+'&vid='+vid+'&areatype='+atype+'&place_name=+'+longername.replace(/ /g,'+');
aname=f1;
if (atype=='tract'||atype=='block'||atype=='bg') aname='@'+f1;
alabel=aname; asublabel=K(f5)+' people'+(p1!='pblock'?' $'+K(f12):'')+' '+measuredisplay(K(f3),'sq.mi.','The area of '+aname+' is');
apoptext='Click for detailed reports on '+longername+ '; US Census 2000: population '+K(f5)+ (p1!='pblock'?', Median Household Income: $'+K(f12):'');
}
  if (p1=="fires") {
    instrument=f1; date=f2; time=f3;
    temperature1=f4; temperature2=f5; temperature3=f6; ecosystem=f7; landcover=f8; flag=f9; mask=f10; conf=f11;
  }
  if (p1=="wcity") {
    acitycode=f1; aname=f2; astatecode=f3; acountrycode=f4; astate=f5; acountry=f6;  alabel=aname;
asublabel=astatecode;
    akountrycode=((acountrycode=='US')?'US_'+astatecode:acountrycode); aurl='http://books-maps.com/'+akountrycode;
    apoptext=aname+' ('+acitycode+'), '+astate+' '+(acountrycode=='US'?'':acountry);
  }
  if (p1=="raws"){aname=f1;  }
  if (p1=="nraws"){aname=f1;  }
  if (p1=="airport"){aname=f2; elevation=f3; acode=f1; aurl='http://www.fallingrain.com/icao/'+acode+'.html';  alabel=acode+' '+aname; asublabel=elevationdisplay(elevation);  apoptext='ICAO code: '+acode+ ', Name: '+ aname+', Elevation: '+elevation +' feet '+convert_units(elevation,'ft') }
  if (atitle=="Annotations"){aname=f1; alabel=f1; apoptext='Annotation of this point made by a member of this user group'}
  if (p1=="school"){aname=f2; aaddress=f3; ownership=f6; level=f7; sccode=f9; 
}
  if (p1=="dining"){aname=f2; type=f3; aaddress=f4; city=f5; azipcode=f7; phone=f8; }
  if (mlike(p1,'nv_')) {aname=f4; 
if (!mlike(aname,'[a-zA-Z]')) aname=f5;
alabel=aname

}
  if (p1=="restaurant"||p1=="nv_restrnts"){aname=f4; type=f19; aaddress=f7+' '+f8; city=''; zip_code=zipcode; phone=f12;
asublabel=type.replace(/^OTHER$/,'').replace(/ FOOD/,'')+' '+aaddress+' '+phone;
azipcode=zip_code;
alabel=aname;
apoptext=type+' Restaurant '+aname+' at '+aaddress;
 }
  if (p1=="canada_ypages"){aname=f2;  type=''; aaddress=f3; city=f4; azipcode=f6; phone=f7; }
  if (p1=="nypages"){aname=f2;  type=f23; aaddress=f25; city=f10; azipcode=f3; phone=f8; }
  if (mlike(p1,"^iypages")){aname=f2;  type=f26; aaddress=f4; city=f4; azipcode=f6; phone=f7; }
  if (p1=="ypages"){aname=f2; type=f3; aaddress=f4; city=f5; azipcode=f7; phone=f8}

  if (p1=='nraws') {
    //_staticLayer=true;
    alabel=aname.replace('zz_','').replace(statecode+'_','').replace(/_/g,' ');
    //aurl='http://raws.boi.noaa.gov/obs/'+aname+'.txt';
    //aurl=f3.replace(/boi/,'wrh');
    aurl=f3;
    apoptext='Click for detailed report from automatic weather station '+aname+popframe(aurl);
  }
  if (p1=="geoimages") {alabel=f1;apoptext=f1;photo=f3}
  if (p1=='fires') {
    alabel=date;
    apoptext=aall;
  }
  if (p1=='real'||p1=='ramb'||p1=='fproperties'||p1=='cndx') {
    if (numericG(price)) priceK=K(price);
    else priceK=price;
    sqft=area+'sq.ft.'; if (area==''||area=='0') sqft='';
    built='built in '+year_built; if (year_built=='') built='';
    lot='on '+lot_size+' sq.ft. lot'; if (lot_size=='') lot='';
    tour='<a href='+virtual_tour+'>Virtual Tour</a>'; if (virtual_tour=='') tour='';
if (bathroom<'1') bathroom='';
    apoptext='$'+ priceK +displayif(b,bedroom,' bedroom')+ displayif(b,bathroom,' bathroom')+displayif(b,sqft)+b+street_address+b+unit+b+property_type+b+built+displayif(' in ', community)+b+property_features+b+community_features+b+displayif('/',supplier);

    if (zipcode==32804) apoptext='Click for full details about this home for sale at Realtor.com';
    alabel='$'+priceK+b+bedroom+'/'+bathroom;
asublabel=sqft+b+street_address;
  }

if (p1=='posters') {photo=f10;aurl='http://vn4.cs.fiu.edu/cgi-bin/tfdispense.cgi?long='+alongitude+'&lat='+alatitude+'&width=10000&height=10000&tab=poster&preclick='

}

  if (p1=='callreal'||preal||p1=='re2'||p1=='re2_RAMB'||p1=="re1"||p1=="re1_RAMB") {
photo=f1;
acounty=f[46];
if (acounty=='DADE') acountynbr=dadenbr;
if (acounty=='BROWARD') acountynbr=browardnbr;
flcounty=acountynbr;
folio=f[61];
price=f[76];
area=f[121];
virtual_tour='';
lot_size='';
bedroom=1*unblank(f2);
fbathroom=unblank(f3);
hbathroom=unblank(f4);
year_built='';
street_address=f[38];
aaddress=street_address;
unit='';
community=f[42];
property_type='property';
  if (p1=="re2"||p1=="re2_RAMB") property_type='condo';
  if (p1=="re1"||p1=="re1_RAMB") {
street_address=f[36];
aaddress=street_address;
fbathroom=unblank(f5);
hbathroom=unblank(f7);
property_type='house';
}
bathroom=fbathroom/1+(hbathroom/2);
property_features='';
community_features='';
listing_type=f[109];
county_value=f[536];
remarks=f[112];
supplier='';
    priceK=K(price);
    sqft=area+'sq.ft.'; if (area=='') sqft='';
    built='built in '+year_built; if (year_built=='') built='';
    lot='on '+lot_size+' sq.ft. lot'; if (lot_size=='') lot='';
    tour='<a href='+virtual_tour+'>Virtual Tour</a>'; if (virtual_tour=='') tour='';
    //apoptext='Click to display: $'+ priceK +b+ bedroom +' bedroom '+ bathroom +' bathroom '+b+sqft+b+street_address+b+unit+b+property_type+b+built+b+'in '+ community+b+property_features+b+community_features+b+listing_type+'/'+supplier;
    apoptext='Click to display: <b>$'+ priceK +displayif(b,bedroom,' bedroom')+ displayif(b,bathroom,' bathroom')+b+sqft+b+street_address+b+unit+b+property_type+b+built+b+displayif('in ',community)+'</b>'+b+property_features+b+community_features+b+listing_type+b+remarks+displayif('/',supplier);

    if (zipcode==32804) apoptext='Click for full details about this home for sale at Realtor.com';
    if (bedroom*1>=1) alabel='$'+priceK+b+bedroom+'/'+bathroom;
    else alabel='$'+priceK+b+street_address;
  }

  smartkeyword='service';
  if (p1=='canada_ypages'||mlike(p1,'^iypages')||p1=='nypages'||p1=='ypages'||p1=='dining'||p1=='restaurants') {
    apoptext=aname+', '+type+' at '+aaddress+'. Click for more details';
    alabel=aname; asublabel=aaddress+' '+phone;
    //if (0<type.search('Dining')) {alabel=aname;smartkeyword='restaurants'}
    if (p1=='dining'||p1=='restaurants') {
smartkeyword='restaurants'}

    asearchstring=aname.replace(/ /g,'+').replace(/.*: */,'');
    //aurl='http://service.bfast.com/bfast/click?siteid=35724832&bfpage=banner1_new&bfmid=27359743&czac='+zip_code+'&t=0&s=0&p=1&v=2&q='+asearchstring;
    aurl='http://google.com/maps?near='+azipcode+'&q='+asearchstring;
if (p1=='nypages') {alink=f13;
if (mlike(alink,'http')) aurl=alink;
b=' ';
asublabel+=acom(f9);
asublabel+=acom(f7,'fax: '); //b+(f7>' '?'fax '+f7:'');
asublabel+=acom(f5)+acom(f16)+acom(f21)+acom(K(f22),' sales: $');
asublabel+=acom(f20,'',' employees')+acom(f23,'SIC: ');
apoptext=alabel+b+asublabel+b+alink;
}
if (mlike(p1,'^iypages')) {alink=f16;
if (mlike(alink,'http')) aurl=alink;
else if (mlike(alink,'www|[.]com')) aurl='http://'+alink;
b=' ';
asublabel+=acom(f9);
asublabel+=acom(f8,'fax: '); //b+(f7>' '?'fax '+f7:'');
asublabel+=acom(f17)+acom(f18)+acom(f22)+acom(K(f25),' sales: $');
asublabel+=acom(f24,'',' employees')+acom(f26.replace(/^[0-9-]*/,''),'SIC: ');
apoptext=alabel+b+asublabel+b+alink;
}
amoreurl=amoreurln.replace(/dining/,"restaurants");
  }
  if (p1=='school') {
    asearchstring=aname.replace(/ /g,'+');
    apoptext='Click for data and ratings of this school, '+aname+ ' '+ownership+' '+level+' at '+aaddress;
    alabel=aname;
    aurl='http://n150.cs.fiu.edu/geodata/schl.iq2?Query=GetSchoolDetails&format=html&obj_code='+sccode;
  }
  if (p1=='college') {
    asearchstring=aname.replace(/ /g,'+');
    apoptext=aname+ ' ('+college_type+') at '+college_address+' '+college_city+' '+college_state+' '+college_zip_code;
    alabel=aname;
  }
if (p1=='ptrim') {
alabel=aname+'mm';
var sl="/";
var begin_date=thisyear+sl+thismonth+sl+'01';
var bdate=thisyear+thismonth+'0100';
var end_date=thisyear+sl+thismonth+sl+day;
var edate=thisyear+thismonth+day+'23';
aurl='http://disc2.nascom.nasa.gov/daac-bin/Giovanni/tovas/Giovanni_cgi.pl?west='+(alongitude-3)+'&north='+(alatitude-(-3))+'&east='+(alongitude-(-3))+'&south='+(alatitude-3)+'&data=Accumulated+Rainfall&cbar=cdyn&plot_type=Area+Plot&byr='+thisyear+'&bmo='+beginmonth+'&bdy=1&b_hour=00Z&eyr='+thisyear+'&emo='+thismonth+'&edy='+day+'&e_hour=23Z&begin_date='+begin_date+'&end_date='+end_date+'&prod_id=3B42RT&params=0%7C3B42RT&action=Generate+Plot&global_cfg=tovas.global.cfg.pl&instance_id=realtime';
aimg='http://disc2.nascom.nasa.gov/daac-bin/Giovanni/tovas/monthly_analysis_gds.pl?south='+(alatitude-1)+'&north='+(alatitude-(-1))+'&west='+(alongitude-1)+'&east='+(alongitude-(-1))+'&action=Generate+Plot&cbar=cdyn&cmin=-9999&cmax=-9999&bdate='+bdate+'&edate='+edate+'&global_cfg=tovas.global.cfg.pl&instance_id=realtime&prod_id=3B42RT&unit=NO_CHANGE&params=0|3B42RT&param=0&pid=3B42RT&plot_type=Area+Plot';
apoptext='a NASA plot of month-to-date rainfall in the region <img src='+aimg+'>';
asublabel=measuredisplay(K(aname/25.4),'inch');
}
  if (p1=='hotels') {
    strippref='H_';
    range='';
    if (1*daily_rate_min>0) {
      range=' $'+K(daily_rate_min);
      if (1*daily_rate_max>5+1*daily_rate_min) range=range+'-'+K(daily_rate_max);
      range=range+b;
    }
    aurl=reserve;
    if (aurl.indexOf('/')<2) aurl='http://hotels-shopper.com'+ aurl;
    stariconlong='';
    if (stars>=2) stariconlong='<img border=0 src='+images+(stars+'.0i').substr(0,3)+'.stars.gif alt='+stars+'+stars>';
    starsshort=Math.round(stars-.5); if (stars==3.5) starsshort=3.5;
    stariconshort='';
    if (starsshort>=1) stariconshort='<img border=0 src='+images+'hotel'+starsshort+'.gif alt='+stars+'stars>';
    else stariconshort='<img border=0 src='+images+'hoteltr.gif alt=unrated>';

    if (typeof(policy)!='ubdefined') if (policy.Length>1) policy=' <i>Policy:</i> '+policy;
    alabel=stariconshort+aname; asublabel=range ;
    apoptext='Click to reserve via '+supplier+' hotel '+ aname+ stariconlong+ range+ ' at '+ street_address+b+ city+b+zip_code+'. '+ hotel_facilities +  policy ;

asublabel='';
apoptext='more info/reserve';
aurl='http://www.booking.com/searchresults.html?aid=302651&lang=en&selected_currency=USD&latitude='+alatitude+'&longitude='+alongitude+'&radius=10&checkin_monthday='+tomorrow+'&checkin_year_month='+yearmonth+'&checkout_monthday='+tomomorrow+'&checkout_year_month='+yearmonth+'&do_availability_check=1&rows=100&label=vn4&order=distance';
  }
if (mlike(p1,'flproperties')) {
aname=f[74]+' - '+f[88]; folio=f2; acountynbr=f1; flcounty=f1;
recordkeycriterion='PARCELNO='+folio;
aurl=arquery_keyurl(p1);
apopurl=iframeable_url(aurl);
asublabel='';
if (mlike(aname,'REFERENCE ONLY')) aname=f[88];
if (p1=='flproperties') aname=f[39];
else asublabel=f[99];
alabel=aname;
apoptext='county valuation: $'+K(f11)+popframe(apopurl);
}


if (p1=='ownership') {adr=f12; aname=adr; alabel=adr}
  if (p1=='folio'||p1=='nfolio') {
    _staticLayer=false;
    area=f1; perimeter=f2; prop_=f3; prop_id=f4; 
    ttrrss=f5; folion=f6; pid=f7; subunit=f8; hnmax=f9;
    condoflg=f10; mod_date=f11; h_num=f12; h_num2=f13; 
    pre_dir=f14; st_aname=f15; st_type=f16; st_type2=f17;
    suf_dir=f18; azipcode=f19;
owner='';
  
    housenbr=h_num; if (housenbr==0 || housenbr=='') housenbr=hnmax;
    folionbr=folion;
    adr= housenbr +b+ h_num2 +b+ pre_dir +b+ st_aname +b+ st_type +b+ st_type2 +b+ suf_dir ;
    adr=adr.replace(/^ */,'').replace(/   */,' ').replace(/ *$/,'');
    area=parseInt(area);
  if (p1=='nfolio') {
folionbr=f3;
owner=f2;
adr=f4;
aaddress=f4;
azipcode=f6;
}
    if (adr.search('[a-zA-Z]')<0) {adr='lot'; aaddress=''}
    if (owner=='REF ONLY') owner='Condominium';
    if (owner=='REFERENCE ONLY') owner='Condominium';
    if (area>0) area='Property lot net area: '+area+' sq.ft. ';
    else area='';
    perimeter=parseInt(perimeter);
    if (perimeter>0) perimeter='Property lot perimeter: '+perimeter+' ft. ';
    else perimeter='';
    comment=aall;
    alabel=owner+' '+adr;
 //tempoff2006.09.13   
if (owner=='Condominium') extralabel=' (<a target=_blank href="http://n1.cs.fiu.edu/cgi-bin/condorep'+tester+'.cgi?Lat='+alatitude+'&Long='+alongitude+'&vid='+vid+'&folio='+folionbr+'" title="Compare condo units">Units</a>)';
    //if (vid=='ramb') {
      aurl='http://gisims2.co.miami-dade.fl.us/MyHome/propmap.asp?app=propmap&bytool=FOLIO&cmd=FINDFOLIO&tool=SELECT&searchtool=FOLIO&mapURL=&selX=&selY=&scale=155&ownerl=&ownerf=&stnum=&stdir=&stname=&sttype=&stunit=&stzip=&reffolio=&startnum=0&sOrthophoto=YES&folio='+folionbr;
      //apoptext=area+perimeter+(isIE55?'Please <b>HOLD Mouse</b>  or Click to  browse property record (please wait, we are redirecting to the County and it may take their system up to one minute to get the property data) ':' property record and aerial photo');
      apoptext=owner+' '+adr+' '+(isIE55?'Please <b>HOLD Mouse</b>  or Click to  browse property record (please wait, we are redirecting to the County and it may take their system up to one minute to get the property data) ':' property record and aerial photo');
    //}
    //else {
      //aurl='http://n150.cs.fiu.edu/geodata/folios.iq2?Query=GetFolioDetails&format=html&folio_code='+folionbr;
      //apoptext=area+perimeter+(isIE55?'Please <b>HOLD Mouse</b>  or Click to  browse property record ':' property record');
    //}
    apopurl='http://gisims2.co.miami-dade.fl.us/myhome/proptext_print.asp?folio='+folionbr;
  }
  if (mlike(p1,'_UNION')) { aurl=arquery_keyurl(f5.replace(/[.]asc/,''))}

  if (p1=='gnis'||p1=='newgnis'||p1=='gnis2009') {
    strippref='GNIS_';
    icon='';
    type=type.replace(/Populated Place/g,'city');
    type=type.replace(/ppl/g,'city');
    type=type.replace(/Park/g,'park');
    type=type.replace(/Church/g,'church');
    type=type.replace(/faith/g,'church');
    type=type.replace(/community/g,'city');
    type=type.replace(/Hospital/g,'hospital');
    type=type.replace(/Airport/g,'airport');
    if (type=='airport')
      if (aname.indexOf('irport')<0) type='';
    if (aname.indexOf('eliport')>=0) type='heliport';
    type=type.replace(/Beach/g,'beach');
    type=type.replace(/School/g,'school');
    //if (mkike(aname,'heliport')) type='heliport';
    
    if (type=='airport' || type=='heliport' || type=='church' || type=='park' || type=='school' || type=='hospital' || type=='beach' || type=='city') icon='<img  src='+images+type+'.gif border=0>&nbsp;';
    else if (type!='') icon='<img src='+images+'other.gif border=0>&nbsp;';
    type=type.replace(/city/g,'community');
if (type!='') ocat=type;
    
    type_=type.replace(/ /g,'+');
    aname_=aname.replace(/[^a-zA-Z0-9-]/g,"+");
    asearchstring=aname.replace(/ /g,'+');
    params='zipcode='+azipcode+'&cityname='+citynameplus+'&country='+kountrycode+'&latitude='+latitude+'&longitude='+longitude+'&vid='+vid;
    //aurl=vn4c+'/d.cgi?stp=travel&'+params+'&omnisearch='+asearchstring;
    aurl='http://terrafly.com/omnisearch.html#?'+params+'&searchstring='+asearchstring;
    alabel=icon+aname;
    apoptext='search the Web, '+cityname+' Directories, Encyclopaedias, etc., for '+  type +b+'<b>'+ aname+'</b>' +b;
  }
  if (p1=="newgnis"||p1=="gnis2009"){elevation=1*f5;  elevation_ft=K(Math.round(elevation/0.3048)); asublabel=elevationdisplay(elevation_ft); apoptext+='<br>Elevation at ground: '+elevation_ft +' feet = '+elevation+' meters.<br>'+f3+'<br>'+f4+popframe('http://google.com/search?q=%22'+asearchstring+'%22+'+zipcode) }

  distance=parseInt((typeof(distance)=='undefined')?'10000':distance+' ');
  if (acounter==1 && distance<radius) alabel='<font color=red>'+ alabel+ '</font>'
  photopop='';photos='';photospop='';
if (typeof(photo)=='undefined') photo='';
  if (photo.search(/https*:/)>=0) {
    photo=photo.replace(/[<>"]/g,' ').replace(/src=/g,' ');
    photo=photo.replace(/ [^h ][^ ]*/g,' ').replace(/^ */,'').replace(/  *$/,'').replace(/, *http.*/,'');
    //photo=photo.replace('"* .*','');
    //photo=photo.replace('.*http:','http:');
    photos=photo.replace(/  */g,'> <img align=top border=0 src=');
    photopop='<table><tr><td><img border=0 src='+photos+' alt=unavailable></td></tr></table>';
  }

  if (acounter==1&&(isArquery!=1)) {
    dw('<blockquote>');
    blockopen=1;
  }

  if (p1=='real') {
    strippref='REA_';
    strippref='';
      photopop=photopop.replace(/small/,'large');
    if (typeof(virtual_tour)!='undefined') if (virtual_tour.indexOf('http')>=0) {
      iconurl=virtual_tour;
      iconpop='Click for <b>virtual tour</b> '+photopop;
      poph(iconurl,'<img border=0 src='+images+'vr.gif>',iconpop);
    }
  }

  if (p1=="census") {
    if (areatype0!=lastareatype) demogrecord(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19);
  }
  else {

if (isArquery==1) {
if (onlycount) dw(' '+(1+distcnbr)+':&nbsp;');
else dw('<table border="0" valign=top align=left width="90%" cellspacing=0 cellpadding=0 rules="none" rule="none"><tr><td border=0 valign=top>');}
else dw('<table border="0"  cellspacing=0 cellpadding=0 rules="none" rule="none"><tr><td border=0 valign=top>');
    //var apopupurl=aurl.replace(/category=/,'popup=1&category=');
    apopurl=aurl;
    //apopup=apoptext+popframe(apopupurl);
    if (atest) dw('aall='+aall +'acounter='+acounter+' apopup='+apopup);
    //if (apopurl!='') apopup=apoptext+popframe(apopurl);
    apopup='';
    apopup=apoptext+ photopop ;
    if (acounter==1 && distance<radius) dw('<font color=red>');
    if (compass_direction.search(/^[a-zA-Z]/)>=0 &&beston==0) {
if (!onlycount) dw('');
else dw(' &nbsp;  ');
if (isArquery&&!onlycount) dw((1+distcnbr)+': ');;
      distc(distance,compass_direction,atitle+': '+alabel);
      dw('&nbsp;');
    }
   //if (isArquery==1) {if (aurl==amoreurl) alabel=''; else alabel='<img src="/images/details.gif" alt="" width=32 height=32>';
   if (!isArquery) dw('</td><td align=left>');
   if (isArquery==1&&!onlycount) {
dw('</td><td valign="top" align="right" rules="none" rule="none">');
magnifier='<img src='+images+'magnifier14x13.gif>';
if (aurl=='') aurl=amoreurl;
if (p1!='real'&&p1!='re1'&&p1!='re2'&&p1!='ramb'&&p1!='callreal'&&p1!='fproperties'&&!preal&&p1!='cndx') {if (aurl==amoreurl||printable) alabel=''; else alabel='<img src="'+images+'details.gif" alt="" width=32 height=32>';}
else alabel=' <b>'+alabel+magnifier+'</b>';
};
    if (_staticLayer)
      poph_static (aurl,alabel,apopup);
    else
      {if (beston) poph(aurl,alabel,apopup,popwidth); else pophb(aurl,alabel,apopup,popwidth);}
if (asublabel!=''&&!isArquery) dw(' '+asublabel);
 dw(extralabel);
if (isArquery==1&&!onlycount) dw('</td></tr></table>');
if (!isArquery) dw('</td></tr></table>');
    if (acounter==1 && distance<radius) dw('</font>');
    if ((!isArquery)&&photoshown==''&&photopop!=''&&(p1!='ramb'||p1!='callreal'||mlike(photo,'^http[^ ]*_101')))  {
      photoshown=1;
photopop0=photopop;
photo0=photo;
apoptext0=apoptext;
aurl0=aurl;
alabel0=alabel;
apopup0=apopup;
    }
  }
}

function alast() {
recordkeycriterion='';
  if (p1=="census") enddemographics();
  else {
    if (acounter>0&&amoreurl!=''&&!all_set) {dw(' &nbsp;&nbsp; ');poph(amoreurl,'<img align=top src='+images+'more1.gif border=0>','more nearby '+atitle+' records');}
    if (blockopen==1) {
      dw('</blockquote>');
      blockopen=0;
    }
    if ((!isArquery)&&photoshown&&photopop0!='') {
      dw('</td><td align=right>');
dw('<table align=right><tr><td>');
     pophb(aurl0,'<img border=0 onerror="rplcErrImg(this);" src='+photo0+' >',apoptext0);
    // if (isIE) pophb(aurl0,'<img border=0 onerror="rplcErrImg(this);" src='+photo0+' >',apoptext0);
    // else pophb(aurl0,'<img border=0  src='+photo0+' >',apoptext0);
dw('</td></tr><tr><td>');
      pophb(aurl0,alabel0,apopup0);
dw('</td></tr></table>')
    }
if (!isArquery&&p1!='census') dw('</td></tr></table>');
  }
}

function startdemographics(f1,f2,f3,f4,f5,f6,f7) {
  var td1='<td align=center >';
  var td1='<td align=center bgcolor="#D4E3F1">';
  var td1='<td align=center bgcolor="#F2E5C5">';
  var td='</td>'+td1;
  //dw('<table border=1 width="100%" cellspacing="0" cellpadding="0" align=center><tr><td>');
  //dw('<p><table><tr>'+td1+'nested areas'+td+'population'+td+'sq. miles'+td+'homes'+td+'water</td></tr>');
  dw('<table border=0 width="'+tabwidth+'" cellspacing="0" cellpadding="0" align=center><tr>'+td1+'Nested Areas'+td+'Population'+td+'Sq. Miles'+td+'Homes'+td+'Water'+(showPremium?td+'Premium':'')+'</td></tr>');
}

function demogrecord(id,aname,population,housingunits,sqmeters,watersqmeters,areatype,distance,compass_direction,offset,bbox,llong,rlong,llat,ulat,widthm,heightm,ilat,ilong) {
  lastareatype=areatype;areaw=widthm;areah=heightm;
  var td='</td><td align=right>';
  var sqm=1609*1609;
  var demogurl='http://n150.cs.fiu.edu/geodata/sf1.iq2?Query=GetAreaDetails&Format=html&aid='+id;
  var demogname=aname.replace(' CCD',' division').replace(' CDP',' place').replace(/  *$/,'');
  demognamecompound=aname.replace(/  *$/,'')+'; '+demognamecompound;
  var longername=demogname+', '+kountryname;
  if (areatype=='state') longername=kountryname;
  if (areatype=="bg"||areatype=='tract') {
    longername=longername+' '+zipcode;
    longername=longername.replace('Block Group','Neighborhood (Census Block Group)');
    longername=longername.replace('Census Tract','Greater Neighborhood (Census Tract)');
  }
  if (areatype=='zip') longername=kountryname+' '+demogname.replace(/^.* /,'');
  var aerial00=vn4c+'/tfdispense.cgi?long='+ilong+'&lat='+ilat+'&';
  var areaurl=aerial00+'&area='+areatype+'&label='+demogname.replace(/ /g,'+');
  var downloadable=(sqmeters/sqm<400000);
  var smaller=(areatype=='bg')?'':' and smaller areas within '+demogname;
  var aerialstext='click for menu of dowloadable imagery, data, TerraAtlases, and prints covering the entire area of '+demogname;
  if (dispenser==''||downloadable) {
    dw('<tr><td>');
    areacgi=gnisdispcgi+'Lat='+ilat+'&Long='+ilong+'&tfaction=dispense&vid='+vid+'&areatype='+areatype+'&aid='+id+'&place_name='+longername.replace(/[^a-zA-Z0-9.()-]/g,'+')+'&awidth='+widthm+'&aheight='+heightm;
    areademog=areacgi+'#Demographics';

    if (areatype0==areatype) dw('<b>');
    //if (dispenser==''||!downloadable) {
      poph(areacgi,demogname,'click for more data on '+demogname);
    //}
    //else poph(areaurl,redden(demogname),aerialstext);
    dw(td)
    poph(areademog,K(population),'Click for a complete housing/demographic report from 2000 US Census, comparing nested areas: '+demognamecompound);

    dw(td);
    if (downloadable) poph(areaurl,redden(K(sqmeters/sqm)),aerialstext);
    else dw(K(sqmeters/sqm));
    dw(td);
    poph(demogurl,K(housingunits),'Click for a detailed demographic report on '+demogname+' as one long printable document');
    dw(td);

    waterpercent=percent(1*watersqmeters/(1+1*sqmeters));
    poph(areaurl+'&tab=report&preclick=',waterpercent,waterpercent+ ' ('+K(watersqmeters/1609/1609)+' sq. miles) of the area of '+demogname+' is water. <p>Click for a menu of premium (fees) reports (demographic, life quality, etc.) on '+demogname+smaller);
    if (showPremium) {dw(td);    poph(areaurl,'<img src="'+images+'green_go_button.gif">',aerialstext);}
    dw('</td></tr>');
  }
}

function enddemographics() {
  dw('</table>');
  //dw('</td></tr></table>');
}

function redden(s) {
  //return '<font color=red>'+s+'</font>';
  return '<b>'+s+'</b>';
}

posterstring=' AMS 4010 ATL 4000 AUS 4003 AVX 6001 BNA 4705 BOS 4100 BUD 4110 BWI 4101 CHI 4201 CLE 4208 CLT 4211 CMH 4209 CVG 4206 DEN 4303 DFW 4300 DTT 4302 FLR 4950 FRA 4311 HKG 4405 HNL 4400 HOU 4402 IAG 4708 IND 4404 IND 4408 IST 4409 JAX 4411 JRS 4410 LAS 4506 LAX 4502 LON 4949 LON 4951 MAD 4610 MEM 4603 MIA 4504 MKC 4421 MOW 4620 MSP 4606 MSY 4704 MUC 4650 MWC 4508 NYC 4703 OFP 4817 ORL 4710 PDX 4740 PHL 4721 PHL 4725 PHL 4726 PHL 4727 PHX 4722 PIT 4720 PIT 4728 PRG 4760 ROM 4953 SAN 4801 SAN 4808 SAT 4810 SEA 4805 SFO 4802 SFO 4803 SFO 4804 STL 4806 STL 4807 STO 4818 SYD 4815 SYD 4816 TPA 4821 TYO 4820 VCE 4954 WAS 4900 YMQ 4618 YTO 4830 YVR 4955 ZSP 4800'
function cityposter() {
  var indx=posterstring.indexOf((typeof(citycode)!='undefined'?citycode:999999));
  if (indx>0) {
    var posternbr=posterstring.substr(indx+4,4);
    dw('<center><a href=http://terrafly.cs.fiu.edu/aerial_posters/template.asp?item='+posternbr+' target=_blank><img border=0 src=http://www.spaceshots.com/images/full/sspn'+posternbr+'.jpg alt="'+cityname+' poster"></a></center>');
  }
}

function xhref(urlsuffix,text,title) {
  demogboxurlpref='http://ts.cs.fiu.edu/qsf'+(sf3=='sf3'?3:1)+'z';
  //dw('<a href="'+demogboxurlpref+urlsuffix+'" title="'+title+'" target=_blank>'+text+'</a>');
  pophb(demogboxurlpref+urlsuffix,text,title);
}

function xhrefd(demographictab,text) {
  dw('<li>');
  amp='qAz';
  taba='tab='+demographictab+amp;
  xhref(taba+demogboxurlsufmini,text,'report for this zone only');dw('&nbsp;&nbsp;&nbsp;');
  xhref(taba+demogboxurlsuf,'+','compare this and major encompassing zones');
  dw('&nbsp;&nbsp;&nbsp;');
  xhref(taba+demogboxurlsufbig,'++','compare this zone, adjacent zones, and all encompassing zones');
  dw('&nbsp;&nbsp;&nbsp;');
  //pophb('http://recommend.org/omnisearch.htm#sitetype=omni&zipcode='+zipcode+'&cityname='+citynameplus+'&statecode='+statecode+'&vid='+vid+'&searchstring='+text.replace(/[^a-zA-Z0-9]/g,'+'),'<img src="http://recommend.org/images/srch_button.gif" border=0>','search the Web and reference sources for <i>'+text+'</i> locally and generally');
  pophb('http://recommend.org/omnisearch.htm#sitetype=omni&zipcode='+zipcode+'&cityname='+citynameplus+'&statecode='+statecode+'&vid='+vid+'&searchstring='+text.replace(/[^a-zA-Z0-9]/g,'+'),'s','search the Web and reference sources for <i>'+text+'</i> locally and generally');
  dw('</li>');
}
function unblank(s) {return s.replace(/ /g,'')}
function pad2(nbr) {return (nbr<10?'0':'')+nbr}

function fparam(namevalue,attributes){var nv=namevalue.replace(/[&]/g,'');name=nv.replace(/=.*/,""); var value=nv.replace(/.*=/,""); var attr=(typeof(attributes)=='undefined'?' title="'+name.replace(/_/g,' ')+'" size='+value.length:attributes); return '<input name="'+name+'" value="'+value+'" '+attr+'>'}
function hparam(namevalue){return fparam(namevalue,' type=hidden ')}
function hparams(namevalues){var params=new Array();params=namevalues.split('&');var out='';for (i=0;i<params.length;i++) out+=hparam(params[i]); 
return out;
}
function hminisg(){
var hmini='<table cellspacing=0 cellpadding=0 border=1 >'+'<tr><td bgcolor="#D4E3F1" align="center" >Check hotel rates for: <form action="http://www.booking.com/searchresults.html" name=nnn method=GET target=_blank>'
hmini+=hparams('aid=302651&lang=en&selected_currency=USD&latitude='+latitude+'&longitude='+longitude+'&radius=100&do_availability_check=1&class_interval=6&rows=100&label=vn4&order=distance&si=ho');
hmini+=fparam('checkin_year_month='+yearmonth);
hmini+=fparam('checkin_monthday='+tomorrow);
hmini+=fparam('checkout_year_month='+yearmonth)+fparam('checkout_monthday='+tomomorrow);

hmini+='<input type=image src="'+images+'green_go_button.gif" class="bttn" alt="" border=0 name=submit target=_blank></form> </td></tr></table>';
poptxt='<small>Find availability and rates in hotels near the current location.</small>';
popbi(hmini,poptxt);}
function hminisg_wct(){
var hmini='<table cellspacing=0 cellpadding=0 border=1 >'+'<tr><td bgcolor="#D4E3F1" align="center" >Check hotel rates for: <form action="http://vn4.cs.fiu.edu/cgi-bin/d.cgi" name=nnn method=GET target=_blank> <input name=citycode value="'+citycode+'" type=hidden>';
hmini+='<input name=latitude value="'+latitude+'" type=hidden>';
hmini+='<input name=longitude value="'+longitude+'" type=hidden>';
hmini+='<input name=category value="'+category+'" type=hidden> <input name=country value="'+kountrycode+'" type=hidden> <input name=cityname value="'+citynameplus+'" type=hidden> <input name=clang value="EN" type=hidden> <select name=Month size=1>'
hmini+=selectmonths()+'</select><select name=Day size=1>';
hmini+=selectstrngs('1,1st;2,2nd;3,3rd')+selectnbrs(20,'th',4)+selectstrngs('21,21st;22,22nd;23,23rd')+selectnbrs(30,'th',24)+selectstrngs('31,31st')+'</select><select name=Nights>';
hmini+=selectstrngs('1,1 night')+selectnbrs(40,' nights',2);
hmini+='</select>'
hmini+='<select name=adults size=1>';
hmini+=selectstrngs('1,1 adult;2,2 adults;3,3 adults;4,4 adults')+'</select>';
hmini+='<select name=children size=1>'+selectnbrs(4,' children',0)+'</select>';
hmini+='<input type=image src="'+images+'green_go_button.gif" class="bttn" alt="" border=0 name=submit target=_blank></form> </td></tr></table>';
poptxt='<small>Find availability and rates in hotels near the current location</small>';
popbi(hmini,poptxt);}
function acom(value, prefix, suffix){//add with comma and blank
return (mlike(value,'[^$K0 ]')?', '+(typeof(prefix)=='undefined'?'':prefix)+value+(typeof(suffix)=='undefined'?'':suffix):'');
}
function submenuOrBr(url,icon,text,bigpopup){
var bigpop=(typeof(bigpopup)=='undefined'?'':'<br>'+bigpopup);
if (istabulate) submenub(url,(submenu_section_title==''?'':submenu_section_title+': ')+'<b>'+icon+'</b>',text)
else {dw('<small><br>');if (submenu_section_title!='')dw('&nbsp;&nbsp;');pophb(url,icon,text+bigpop,popwidth);dw('</small>')}}


function iframe_arquery(url) {
return (typeof(url)!='undefined'?'<iframe scrolling=no width='+popwidth+' height=600 src='+iframeable_url(url)+'>':''); }
function iframeable_url(url){return url.replace(/1.cgi/,'.cgi').replace(/tester=1./,'').replace(/[?]/,'?printable=1&ispopup=9&'); }
function pointbuttong(tfaction,icon_gif,text){
var url='http://vn4.cs.fiu.edu/cgi-bin/gnis.cgi?Lat='+alatitude+'&Long='+alongitude+'&tfaction='+tfaction;
pointbutton(url,icon_gif,(typeof(text)=='undefined')?'':text,url+'&ispopup=9')}
function pointbuttona(url,icon_gif,text){ pointbutton(url,icon_gif,text,iframeable_url(url))}
function pointbutton(url,icon_gif,text,iframe_url){
var icon=(mlike(icon_gif,'[.]')?'<img src="'+images+'/'+icon_gif+'" border=0 alt="">':icon_gif);
var bigpop=text+(typeof(iframe_url)!='undefined'?'<iframe width='+popwidth+' height=600 scrolling=no src='+iframe_url+'>':'');
if (isArquery) {dw(' ');pophb(url,icon,bigpop)}
else submenub(url,'<img src='+images+icon_gif+'>',text)

}


function submenu_section(title) {
var tit=(typeof(title)=='undefined'?'':title);
submenu_section_title=tit;
if (!istabulate&&tit!='') dw('<br>'+tit+': ')}
function submenu_arquery(category,label,arcriteria,poptext,levelOfIframe,levelOfReport) {
var display=(typeof(label)=='undefined'?category:label);
var criteria=(typeof(arcriteria)=='undefined'?'':'&arcriteria=1&'+arcriteria);
var text=(typeof(poptext)=='undefined'?'browse/query '+display:poptext);
var url=vn4c+'/arquery.cgi?'+gotbroker+'&category='+category+'&y1='+alatitude+'&x1='+alongitude+'&vid='+vid+'&srvc='+srvc+'&'+criteria;
url=url.replace('?&','?');
submenuOrBr(url,display,text,iframe_arquery(url));
}
function hyphenate_date(d){
if (mlike(d,"[^0-9]")) return d
return d.substr(0,4)+'-'+d.substr(4,2)+'-'+d.substr(6,2)}
function prepend0(s,nbrdigits) {return ('a00000000000'+s).substr(12+s.length-nbrdigits,nbrdigits)}

