﻿Ext.ux.AboutWindow=function(){return new Ext.Window({renderTo:document.body,id:'aboutWindow',title:'About',bodyStyle:'padding: 12px 0 0 0;',constrainHeader:true,resizable:false,layout:'fit',width:750,height:500,modal:true,baseCls:'ext-wincompare',footer:true,buttonAlign:'center',buttons:[{text:'Go to Map',handler:function(btn,e){Ext.getCmp('aboutWindow').close();}}],items:new Ext.TabPanel({plain:true,activeTab:0,border:false,items:[{title:'About',autoScroll:true,autoLoad:{url:'about.html'}},{title:'How do I...',autoScroll:true,autoLoad:{url:'tutorial.html'}},{title:'Credits',autoScroll:true,autoLoad:{url:'credits.html'}},{title:'Data Sources',autoScroll:true,autoLoad:{url:'datasources.html'}}]})});}﻿
OpenLayers.Layer.AgsCache=OpenLayers.Class(OpenLayers.Layer.Grid,{reproject:false,isBaseLayer:true,tileOrigin:null,initialize:function(name,url,options){var newArguments=new Array();newArguments.push(name,url,{},options);OpenLayers.Layer.Grid.prototype.initialize.apply(this,newArguments);},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);},clone:function(obj){if(obj==null){obj=new OpenLayers.Layer.AGS(this.name,this.url,this.options);}
obj=OpenLayers.Layer.Grid.prototype.clone.apply(this,[obj]);return obj;},getURL:function(bounds){var res=this.map.getResolution();var x=(Math.floor(0.5+(bounds.left-this.tileOrigin.lon)/(res*this.tileSize.w))).toString(16);while(x.length<8){x="0"+x;}
x="C"+x;var y=(Math.floor(0.5+(this.tileOrigin.lat-bounds.top)/(res*this.tileSize.h))).toString(16);while(y.length<8){y="0"+y;}
y="R"+y;var z=this.map.getZoom();if(z<10){z="L0"+z;}else{z="L"+z;}
return this.url+"/"+this.layername+"/"+z+"/"+y+"/"+x+"."+this.type;},addTile:function(bounds,position){var url=this.getURL(bounds);return new OpenLayers.Tile.Image(this,position,bounds,url,this.tileSize);},setMap:function(map){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom);}},CLASS_NAME:"OpenLayers.Layer.AgsCache"});OpenLayers.Control.ArgParserLiIndex=OpenLayers.Class(OpenLayers.Control.ArgParser,{initialize:function(options){OpenLayers.Control.ArgParser.prototype.initialize.apply(this,arguments);},setMap:function(map){var args=OpenLayers.Util.getParameters();var village=null;var schoolDistrict=null;if(args.code){village=args.code;var highlightLayer=map.getLayersByName('highlightLayer')[0];CUR.WebServiceAccess.prototype.getVillage(village,CUR.MapPage.villageResponseNoZoom,CUR.MapPage.responseError);}
if(args.schooldistrict){schoolDistrict=args.schooldistrict;var highlightLayer=map.getLayersByName('highlightLayer')[0];CUR.WebServiceAccess.prototype.getSchoolDistrict(args.schooldistrict,CUR.MapPage.schoolDistrictResponseNoZoom,CUR.MapPage.responseError);}
if(village!==null||schoolDistrict!==null){setTimeout(function(){CUR.MapPage.updateHighlightImage(true,village,schoolDistrict)},3);}
if(args.x&&args.y){var center=new OpenLayers.LonLat(parseFloat(args.x),parseFloat(args.y));var zoom;if(args.zoom){zoom=parseInt(args.zoom);}
map.setCenter(center,zoom);}
if(args.tab){Ext.getCmp('tabsWest').setActiveTab(args.tab);if(args.panel){var tab=Ext.getCmp(args.tab);tab.activePanel=args.panel;}}
if(args.satellite){var satellite=(args.satellite==='true')?true:false;Ext.getCmp('btnSatellite').toggle(satellite);map.getLayersByName('aerialLayer')[0].setVisibility(satellite);}
if(args.landuse){var landuse=(args.landuse==='true')?true:false;map.getLayersByName('lotLayer')[0].setVisibility(landuse);}
if(args.regionalview){CUR.MapPage.showRegionalWindow(args.regionalview);}
if(args.nosplash!=='true'){CUR.MapPage.showAboutWindow();}},CLASS_NAME:"OpenLayers.Control.ArgParserLiIndex"});﻿OpenLayers.Control.Click=OpenLayers.Class(OpenLayers.Control,{markerLayer:null,fips:'',markerLonLat:'',iconSize:null,iconOffset:null,icon:null,popup:null,tabPanel:null,defaultHandlerOptions:{'single':true,'double':false,'pixelTolerance':0,'stopSingle':false,'stopDouble':false},initialize:function(options){this.handlerOptions=OpenLayers.Util.extend({},this.defaultHandlerOptions);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Click(this,{'click':this.trigger},this.handlerOptions);},setMap:function(map){this.map=map;if(this.handler){this.handler.setMap(map);}
this.markerLayer=this.map.getLayersByName("markerLayer")[0];},trigger:function(e){var mainLayer=this.map.getLayersByName("mainLayer")[0];var url=CUR.Urls.longIslandIndexQuery+'?SERVICE=WMS&VERSION=1.1.1'+'&REQUEST=GetFeatureInfo'+'&EXCEPTIONS=application/vnd.ogc.se_xml'+'&BBOX='+this.map.getExtent().toBBOX()+'&X='+e.xy.x+'&Y='+e.xy.y+'&TOLERANCEUNITS=feet'+'&TOLERANCE=2'+'&INFO_FORMAT=text/xml'+'&QUERY_LAYERS=0,1'+'&WIDTH='+this.map.size.w+'&HEIGHT='+this.map.size.h+'&SRS=EPSG:2263';OpenLayers.loadURL('GetFeatureProxy.ashx?'+url,null,this,this.setVillageInfo);this.createMarker(e);},createMarker:function(e){this.markerLayer.clearMarkers();if(this.iconSize===null){this.iconSize=new OpenLayers.Size(23,32);}
if(this.iconOffset===null){this.iconOffset=new OpenLayers.Pixel(-13,-29);}
if(this.popup!==null){this.popup.hide(this.popup.isVisible);}
this.icon=new OpenLayers.Icon('images/iimm2-red.png',this.iconSize,this.iconOffset);var lonlat=this.map.getLonLatFromViewPortPx(e.xy);this.markerLonLat=lonlat;var marker=new OpenLayers.Marker(lonlat,this.icon);marker.events.fallThrough=true;marker.events.register('mousedown',this,this.markerClicked);marker.events.register('mouseup',this,this.markerMouseUp);this.markerLayer.addMarker(marker);marker.icon.imageDiv.style.cursor="pointer";},markerClicked:function(e){if(OpenLayers.Event.isLeftClick(e)){this.createPopup();}
OpenLayers.Event.stop(e);},markerMouseUp:function(e){if(!OpenLayers.Event.isLeftClick(e)){if(this.popup!==null){this.popup.hide(this.popup.isVisible);}
this.markerLayer.clearMarkers();}},createPopup:function(){if(this.popup==null){this.popup=new OpenLayers.Popup.FramedTab('marker-info',this.markerLonLat,null,null,this.icon,true,null,'minimized',this.fips);this.popup.autoSize=false;this.map.addPopup(this.popup);}
if(this.tabPanel===null){this.tabPanel=CUR.tabsPopup({renderTo:this.popup.groupDiv.id,map:this.map});}
this.popup.lonlat=this.markerLonLat;this.popup.fips=this.fips;this.popup.updatePosition();this.popup.show();this.popup.setContent(this.tabPanel);this.popup.isVisible=true;},setVillageInfo:function(response){var features;features=response.responseXML.getElementsByTagName('FIELDS');var ddlVillages=document.getElementById('ddlVillages');if(features.length>0){var fips=this.getVillageFromXml(features);if(fips!==null){CUR.WebServiceAccess.prototype.getVillage(fips,CUR.MapPage.villageResponseNoZoom,CUR.MapPage.responseError);for(var i=0;i<ddlVillages.length;i++){if(ddlVillages[i].value==fips){ddlVillages[i].selected=true;break;}}
this.fips=fips;if(this.popup!==null){if(this.popup.isVisible){this.createPopup();}}
else{this.createPopup();}}else{CUR.MapPage.clearVillageSelection();this.fips='';}
var districtCode=null;if(Ext.getCmp('tabsWest').getActiveTab().id=='tabEducation'){districtCode=this.getDistrictFromXml(features);if(districtCode!==null){CUR.WebServiceAccess.prototype.getSchoolDistrict(districtCode,CUR.MapPage.schoolDistrictResponseNoZoom,CUR.MapPage.responseError);var ddlSchoolDistricts=Ext.get('ddlSchoolDistricts').dom;for(var i=0,len=ddlSchoolDistricts.length;i<len;i++){if(ddlSchoolDistricts[i].value===districtCode){ddlSchoolDistricts[i].selected=true;break;}}}else{CUR.MapPage.clearSchoolDistrictSelection();}}
CUR.MapPage.updateHighlightImage(true,fips,districtCode);}
else
{CUR.MapPage.clearVillageSelection();this.fips='';if(Ext.getCmp('tabsWest').getActiveTab().id=='tabEducation'){CUR.MapPage.clearSchoolDistrictSelection();}}},getVillageFromXml:function(features){for(var i=0,len=features.length;i<len;i++){if(features[i].getAttribute("PLACE")!==null){return features[i].getAttribute("PLACE");}}
return null;},getDistrictFromXml:function(features){for(var i=0,len=features.length;i<len;i++){if(features[i].getAttribute("BEDSCODE8")!==null){return features[i].getAttribute("BEDSCODE8");}}
return null;},lotResponse:function(response){alert("____"+response.responseText);},CLASS_NAME:"OpenLayers.Control.Click"});﻿var CUR=window.CUR||{};CUR.LandUseCompare=function(village,compareType,aboutText){this.village=village;this.compareType=compareType;this.aboutText=aboutText;};CUR.LandUseCompare.prototype={getTitle:function(){var title='Land Use Comparison - ';if(this.compareType=='lots'){title+='# of parcels by type';}else if(this.compareType=='area'){title+='area of parcels by type';}
return title;},getContent:function(){var content;content='<table><tr><td style="vertical-align: top;"><h4 style="color:#444;margin: 0.5em 0 0.5em 0;">'+this.village.Label+'</h4><img src="'+CUR.LandUse.prototype.getChartUrl(this.village,this.compareType)+'" /></td>';content+='<td style="vertical-align: top;">'
for(var i=0;i<this.village.IntersectingTowns.length;i++){content+='<h4 style="color:#444;margin: 0.5em 0 0.5em 0;">'+this.village.IntersectingTowns[i].Label+'</h4>';content+='<img src="'+CUR.LandUse.prototype.getChartUrl(this.village.IntersectingTowns[i],this.compareType)+'" /><br />';}
content+='</td>'
content+='<td style="vertical-align: top;"><h4 style="color:#444;margin: 0.5em 0 0.5em 0;">'+'Long Island'+'</h4><img src="'+CUR.LandUse.prototype.getLiLandUseChartUrl(this.compareType)+'" /></td>';content+='</tr></table>';content+='<div class="datasource" style="margin-top:10px;">'+this.aboutText+'</div>';return content;}};CUR.PopulationCompare=function(village,category,uiLayer,label,aboutText){this.village=village;this.category=category;this.uiLayer=uiLayer;this.label=label;this.longIsland=null;this.aboutText=aboutText;};CUR.PopulationCompare.prototype={getChartSettingsByUiLayer:function(uiLayer){var values=this.longIsland.BarChartMax;for(var i=0,len=values.length;i<len;i++){if(values[i].UiLayer===uiLayer){return values[i];}}
return null;},getTitle:function(){var title=this.category+' Comparison - '+this.label;return title;},getContent:function(longIsland){this.longIsland=longIsland;var chartSettings=this.getChartSettingsByUiLayer(this.uiLayer);var content;content='<table style="margin-left: auto;margin-right: auto;"><tr><td style="vertical-align: top;">'+new CUR.PopulationChart(this.village,this.category,chartSettings.DataField,chartSettings.MaxVillage,chartSettings.YAxisLabel).render();+'</td>';content+='<td style="vertical-align: top;">'
for(var i=0;i<this.village.IntersectingTowns.length;i++){content+=new CUR.PopulationChart(this.village.IntersectingTowns[i],this.category,chartSettings.DataField,chartSettings.MaxTown,chartSettings.YAxisLabel).render()+'<br />';}
content+='</td>'
content+='<td style="vertical-align: top;">'+new CUR.PopulationChart(this.longIsland,this.category,chartSettings.DataField,chartSettings.MaxLongIsland,chartSettings.YAxisLabel).render()+'</td>';content+='</tr></table>';content+='<div class="datasource" style="margin-top:10px;">'+this.aboutText+'</div>';return content;}};CUR.PopulationChart=function(feature,category,compareType,maxValue,yAxisLabel){this.feature=feature;this.category=category;this.compareType=compareType;this.chartHeight=null;this.maxValue=maxValue;this.yAxisLabel=yAxisLabel;};CUR.PopulationChart.prototype={getChartHeight:function(){if(this.chartHeight==null){this.chartHeight=parseInt(Ext.util.CSS.getRule('.q-graph',false).style.height,10);}
return this.chartHeight;},calculatePixelHeight:function(value){var height=((value/this.maxValue)*this.getChartHeight());if(height<1&&height>0){height=1;}
return height;},render:function(){var content;content='<div>';content+='<h4 style="color:#444;margin: 0 0 0 4.5em;">'+this.feature.Label+'</h4>';content+='<ul class="q-graph">';content+='<li>';content+='<ul>';if(this.category==='Population'){if(this.feature.Population.Population1990!==null&&this.feature.Population.Population1990[this.compareType]!==null){content+='<li class="first bar" style="height:'+this.calculatePixelHeight(this.feature.Population.Population1990[this.compareType])+'px;"><a title="'+this.feature.Population.Population1990[this.compareType].addCommas()+'"></a><span class="label">1990</span></li>';}else{}
if(this.feature.Population.Population2000!==null&&this.feature.Population.Population2000[this.compareType]!==null){content+='<li class="second bar" style="height:'+this.calculatePixelHeight(this.feature.Population.Population2000[this.compareType])+'px;"><a title="'+this.feature.Population.Population2000[this.compareType].addCommas()+'"></a><span class="label">2000</span></li>';}else{}
if(this.feature.Population.Population2008!==null&&this.feature.Population.Population2008[this.compareType]!==null){content+='<li class="third bar" style="height:'+this.calculatePixelHeight(this.feature.Population.Population2008[this.compareType])+'px;"><a title="'+this.feature.Population.Population2008[this.compareType].addCommas()+'"></a><span class="label">2008</span></li>';}else{}}else if(this.category==='Housing'){if(this.feature.Housing.Housing1990!==null&&this.feature.Housing.Housing1990[this.compareType]!==null){content+='<li class="first bar" style="height:'+this.calculatePixelHeight(this.feature.Housing.Housing1990[this.compareType])+'px;"><a title="'+this.feature.Housing.Housing1990[this.compareType].addCommas()+'"></a><span class="label">1990</span></li>';}else{}
if(this.feature.Housing.Housing2000!==null&&this.feature.Housing.Housing2000[this.compareType]!==null){content+='<li class="second bar" style="height:'+this.calculatePixelHeight(this.feature.Housing.Housing2000[this.compareType])+'px;"><a title="'+this.feature.Housing.Housing2000[this.compareType].addCommas()+'"></a><span class="label">2000</span></li>';}else{}
if(this.feature.Housing.Housing2008!==null&&this.feature.Housing.Housing2008[this.compareType]!==null){content+='<li class="third bar" style="height:'+this.calculatePixelHeight(this.feature.Housing.Housing2008[this.compareType])+'px;"><a title="'+this.feature.Housing.Housing2008[this.compareType].addCommas()+'"></a><span class="label">2008</span></li>';}else{}}
content+='</ul>';content+='</li>';content+='<li class="ticks">';content+='<div class="tick" style="height:'+((this.getChartHeight()/2)-1)+'px;"><p style="text-align:right;" >'+this.maxValue.addCommas()+'<br /><span class="y-axis-label">'+this.yAxisLabel+'</span></p></div>';content+='<div class="tick" style="height:'+((this.getChartHeight()/2)-1)+'px;"><p style="text-align:right;" >'+(this.maxValue/2).addCommas()+'</p></div>';content+='</li>';content+='</ul>';content+='</div>';return content;},getValue:function(dataItem,year){if(dataItem!==null){content+='<li class="first bar" style="height:'+this.calculatePixelHeight(dataItem)+'px;"><a title="'+dataItem.addCommas()+'"></a><span class="label">'+year+'</span></li>';}else{return'<li class="first bar" style="height:0px;"></li>';}}};﻿Ext.ux.CompareWindow=function(){var _win;var _button;var _longIsland;var _compareStrategy;this.showWin=function(compareStrategy,button){_compareStrategy=compareStrategy;_button=button;if(typeof(_win)=='undefined'){this.buildCompareWindow();this.getLongIsland();}else{this.setTitle();this.updateLandUseCharts();_win.show(_button);}}
this.getCompareStrategy=function(){return _compareStrategy;}
this.buildCompareWindow=function(){var defaultCfg={renderTo:document.body,id:'winCompare',title:'Land Use Comparison',collapsible:true,resizable:false,width:800,autoHeight:true,baseCls:'ext-wincompare',closeAction:'hide',items:[this.PieChartPanel()]}
_win=new Ext.Window(defaultCfg);}
this.getLongIsland=function(){CUR.WebServiceAccess.prototype.getLongIsland(this.parseLongIsland,function(){alert('error');},this);}
this.parseLongIsland=function(response){_longIsland=Ext.decode(response.responseText);this.setTitle();this.updateLandUseCharts();_win.show(_button);}
this.closeWindow=function(){_win.close();}
this.windowIsClosed=function(){return _win.hidden;}
this.setTitle=function(){_win.setTitle(_compareStrategy.getTitle());}
this.PieChartPanel=function(){return new Ext.Panel({id:'pieChartPanel',style:'padding:4px 8px 4px 8px;',autoHeight:true});}
this.updateLandUseCharts=function(){var panel=_win.getComponent('pieChartPanel');panel.body.update(_compareStrategy.getContent(_longIsland));panel.doLayout();_win.syncSize();}}
﻿
Ext.override(Ext.Panel,{doAutoLoad:function(){var u=this.body.getUpdater();if(this.renderer){u.setRenderer(this.renderer);}
u.update(typeof this.autoLoad=='object'?this.autoLoad:{url:this.autoLoad});}});Ext.override(Ext.menu.Menu,{autoWidth:function(){var el=this.el,ul=this.ul;if(!el){return;}
var w=this.width;if(w){el.setWidth(w);}else if(Ext.isIE&&!Ext.isIE8){el.setWidth(this.minWidth);var t=el.dom.offsetWidth;el.setWidth(ul.getWidth()+el.getFrameWidth("lr"));}}});Ext.layout.BorderLayout.Region.prototype.slideOut=function(){if(this.isSlid||this.el.hasActiveFx()){return;}
this.isSlid=true;var ts=this.panel.tools;if(ts&&ts.toggle){ts.toggle.hide();}
this.el.show();if(this.position=='east'||this.position=='west'){this.panel.setSize(undefined,this.collapsedEl.getHeight());}else{this.panel.setSize(this.collapsedEl.getWidth(),undefined);}
this.restoreLT=[this.el.dom.style.left,this.el.dom.style.top];this.el.alignTo(this.collapsedEl,this.getCollapseAnchor());this.el.setStyle("z-index",10001);if(this.animFloat!==false){this.beforeSlide();this.el.slideIn(this.getSlideAnchor(),{callback:function(){this.afterSlide();this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this);},scope:this,block:true});}else{this.initAutoHide();Ext.getDoc().on("click",this.slideInIf,this);}};﻿
var CUR=window.CUR||{};CUR.Feature=function(){this.id;this.name;this.extent;this.landUse;this.population;this.landUse;this.towns=[];};CUR.Feature.prototype={createVillage:function(fips){this.id=fips;CUR.WebServiceAccess.prototype.getVillage(fips,this.buildVillageFromXml,this.responseError);},buildVillageFromXML:function(xmlDoc){if(xmlDoc.documentElement.getElementsByTagName('code').length>0){var village=new CUR.Feature();village.id=xmlDoc.documentElement.getElementsByTagName('code')[0].childNodes[0].nodeValue;village.name=xmlDoc.documentElement.getElementsByTagName('name')[0].childNodes[0].nodeValue;var lowerleft=xmlDoc.documentElement.getElementsByTagName('lowerleft')[0].childNodes[0].nodeValue.split(",");var upperright=xmlDoc.documentElement.getElementsByTagName('upperright')[0].childNodes[0].nodeValue.split(",");village.extent=[lowerleft[0],lowerleft[1],upperright[0],upperright[1]];var landUse=new CUR.LandUse();landUse.lotsChart='LandUseChart.ashx?ctype=lots&ftype=village&fips='+village.id;landUse.areaChart='LandUseChart.ashx?ctype=area&ftype=village&fips='+village.id;village.landUse=landUse;var population=new CUR.Population();var statistics=xmlDoc.documentElement.getElementsByTagName('statistics')[0]
population.total=statistics.childNodes[1].childNodes[0].childNodes[0].nodeValue;population.totalChange=statistics.childNodes[2].childNodes[0].childNodes[0].nodeValue;population.density=statistics.childNodes[3].childNodes[0].childNodes[0].nodeValue;population.densityChange=statistics.childNodes[4].childNodes[0].childNodes[0].nodeValue;population.lowIncomeHH=statistics.childNodes[5].childNodes[0].childNodes[0].nodeValue;population.lowIncomeHHChange=statistics.childNodes[6].childNodes[0].childNodes[0].nodeValue;population.highIncomeHH=statistics.childNodes[7].childNodes[0].childNodes[0].nodeValue;population.highChange=statistics.childNodes[8].childNodes[0].childNodes[0].nodeValue;population.nonWhite=statistics.childNodes[9].childNodes[0].childNodes[0].nodeValue;population.nonWhiteChange=statistics.childNodes[10].childNodes[0].childNodes[0].nodeValue;population.age18To34=statistics.childNodes[11].childNodes[0].childNodes[0].nodeValue;population.age18To34Change=statistics.childNodes[12].childNodes[0].childNodes[0].nodeValue;village.population=population;var townList=xmlDoc.documentElement.getElementsByTagName('featurelist')[1];var town;for(var i=0;i<townList.childNodes.length;i++){town=new CUR.Feature();town.id=townList.childNodes[i].attributes[0].nodeValue.substr(townList.childNodes[i].attributes[0].nodeValue.length-6,6);town.name=townList.childNodes[i].childNodes[0].nodeValue;town.landUse=new CUR.LandUse();town.landUse.lotsChart=CUR.LandUse.prototype.chartUrl+'?ctype=lots&ftype=town&fips='+town.id;town.landUse.areaChart=CUR.LandUse.prototype.chartUrl+'?ctype=area&ftype=town&fips='+town.id;village.towns.push(town);}
return village;}else{return null;}}};CUR.LandUse=function(){this.lotsChart;this.areaChart;};CUR.LandUse.prototype={chartUrl:'LandUseChart.ashx',getChartUrl:function(feature,chartType){return this.chartUrl+'?ctype='+chartType+'&ftype='+feature.Type+'&fips='+feature.Code;},getLotChartUrl:function(feature){return this.chartUrl+'?ctype=lots&ftype='+feature.Type+'&fips='+feature.Code;},getAreaChartUrl:function(feature){return this.chartUrl+'?ctype=area&ftype='+feature.Type+'&fips='+feature.Code;},getLiLandUseChartUrl:function(ctype){return this.chartUrl+'?ctype='+ctype+'&ftype=longisland&fips=none';}};CUR.Population=function(){this.total;this.density;this.nonWhite;this.age18To34;this.lowIncomeHH;this.lighIncomeHH;this.totalChange;this.densityChange;this.nonWhiteChange;this.age18To34Change;this.lowIncomeHHChange;this.highIncomeHHChange;};CUR.Population.prototype={getPercentOfTotal:function(value){return Math.round((value/this.total)*100);},getPercentNonWhite:function(){return this.getPercentOfTotal(this.nonWhite);},getPercentAge18To34:function(){return this.getPercentOfTotal(this.age18To34);}};﻿
OpenLayers.Popup.FramedTab=OpenLayers.Class(OpenLayers.Popup.Framed,{autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{"tl":{'offset':new OpenLayers.Pixel(44,5),'padding':new OpenLayers.Bounds(8,40,8,9),'blocks':[{size:new OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,32,80,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-668)}]},"tr":{'offset':new OpenLayers.Pixel(-45,5),'padding':new OpenLayers.Bounds(8,40,8,9),'blocks':[{size:new OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-668)}]},"bl":{'offset':new OpenLayers.Pixel(42,-16),'padding':new OpenLayers.Bounds(8,9,8,40),'blocks':[{size:new OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},"br":{'offset':new OpenLayers.Pixel(-42,-16),'padding':new OpenLayers.Bounds(8,9,8,40),'blocks':[{size:new OpenLayers.Size('auto','auto'),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,'auto'),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size('auto',21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),minimizeDiv:null,sizeState:'minimized',isVisible:true,fips:'',content:null,initialize:function(id,lonlat,size,contentHTML,anchor,closeBox,closeBoxCallback,sizeState,fips){this.panMapIfOutOfView=false;this.imageSrc=OpenLayers.Util.getImagesLocation()+'cloud-popup-relative.png';OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className="olFramedTabCloudContent";if(sizeState==='minimized'){this.setSize(new OpenLayers.Size(300,150));}else{this.setSize(new OpenLayers.Size(450,350));}
this.sizeState=sizeState;this.fips=fips;this.addMinimizeBox(closeBoxCallback);this.closeDiv.style.zIndex=12000;},destroy:function(){if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.groupDiv.removeChild(this.minimizeDiv);}
this.minimizeDiv=null;this.content.destroy();OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments);},addMinimizeBox:function(callback){this.minimizeDiv=OpenLayers.Util.createDiv(this.id+"_minimize",null,new OpenLayers.Size(17,17));if(this.sizeState=='maximized'){this.minimizeDiv.className="olPopupMinimizeBox";}else{this.minimizeDiv.className="olPopupMaximizeBox";}
var contentDivPadding=this.getContentDivPadding();this.minimizeDiv.style.right=contentDivPadding.right+40+"px";this.minimizeDiv.style.top=contentDivPadding.top+"px";this.minimizeDiv.style.zIndex=12000;this.groupDiv.appendChild(this.minimizeDiv);var minimizePopup=callback||function(e){if(this.sizeState=='minimized'){this.sizeState='maximized';this.minimizeDiv.className="olPopupMinimizeBox";this.setSize(new OpenLayers.Size(482,360));this.content.setSize(this.size.w-20,this.size.h-54);this.content.doLayout(true);}else{this.sizeState='minimized';this.minimizeDiv.className="olPopupMaximizeBox";this.setSize(new OpenLayers.Size(332,160));this.content.setSize(this.size.w-20,this.size.h-54);this.content.doLayout(true);}
OpenLayers.Event.stop(e);};OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(minimizePopup,this));},updateRelativePosition:function(){OpenLayers.Popup.Framed.prototype.updateRelativePosition.apply(this,arguments);var contentDivPadding=this.getContentDivPadding();this.minimizeDiv.style.right=contentDivPadding.right+
this.padding.right+20+"px";this.minimizeDiv.style.top=contentDivPadding.top+
this.padding.top+"px";if(this.content!==null){this.content.setPosition(this.contentDiv.offsetLeft,this.contentDiv.offsetTop);}},hide:function(isTemporary){if(typeof isTemporary==='undefined'){isTemporary=false;}
OpenLayers.Popup.prototype.hide.apply(this,arguments);this.isVisible=isTemporary;},setContent:function(content){this.content=content;this.content.setPosition(this.contentDiv.offsetLeft,this.contentDiv.offsetTop);this.content.setSize(this.size.w-20,this.size.h-54);this.content.fips=this.fips;this.content.splonlat=this.lonlat;this.content.mapXY=this.map.getPixelFromLonLat(this.lonlat);this.content.updateLocation();},CLASS_NAME:"OpenLayers.Popup.FramedTab"});﻿
Ext.ux.LinkWindow=function(config){var thisWin;var textbox;var buildUrl=function(){var map=config.map._map;var params=[];var center=map.getCenter();var selectedVillage=CUR.MapPage.getSelectedVillage();params['zoom']=map.getZoom();params['x']=Math.round(center.lon*100)/100;params['y']=Math.round(center.lat*100)/100;if(selectedVillage!==null){params['code']=CUR.MapPage.getSelectedVillage().Code;}
var tab=Ext.getCmp('tabsWest').getActiveTab();params['tab']=tab.id;if(typeof tab!=='undefined'){params['panel']=tab.activePanel;}
if(tab.id==='tabEducation'||CUR.MapPage.getSelectedSchoolDistrict()!==null){if(CUR.MapPage.getSelectedSchoolDistrict()!==null){params['schooldistrict']=CUR.MapPage.getSelectedSchoolDistrict().Code;}}
params['satellite']=CUR.MapPage.isSatelliteVisible();params['landuse']=Ext.getCmp('chkLandUse').getValue();params['mainlayers']=layerNamesFromOlLayer(CUR.MapPage.getLayer('mainLayer'));params['labellayers']=layerNamesFromOlLayer(CUR.MapPage.getLayer('labelLayer'));var regionalView=CUR.MapPage.getActiveRegionalView();if(regionalView!==''){params['regionalview']=regionalView;}
return location.href.split('?')[0]+'?'+OpenLayers.Util.getParameterString(params);};var layerNamesFromOlLayer=function(olLayer){var wmsLayers=olLayer.params.LAYERS.split(',');var layers=[];var layer;for(var i=0,len=wmsLayers.length;i<len;i++){layer=getLayerNameByWmsId(wmsLayers[i]);if(layers.indexOf(layer)===-1&&layer){layers.push(layer);}}
return layers.join(',');};var getLayerNameByWmsId=function(wmsId){for(var i=0,len=thisWin.wmsIdEquiv.length;i<len;i++){if((+wmsId)===thisWin.wmsIdEquiv[i].Key){return thisWin.wmsIdEquiv[i].Value;}}
return null;};textbox=new Ext.form.TextField({width:config.width-12,selectOnFocus:true});var documentClick=function(e){if(!e.within(thisWin.getEl())){thisWin.hide();}};thisWin=new Ext.Window({id:'linkWindow',width:config.width,title:'Link to this map',resizable:false,baseCls:'ext-wincompare',x:config.x,y:config.y,items:[new Ext.Component({autoEl:{tag:'div',html:'Copy the link below so you can email it, IM it, or add it to your website.'}}),textbox],bodyStyle:'padding:6px 0px 14px 8px',draggable:false,closeAction:'hide',listeners:{show:{fn:function(win){textbox.getEl().on('click',function(tField,e){textbox.selectText();});textbox.focus(true);Ext.getDoc().on('mouseup',documentClick);if(win.wmsIdEquiv===null){var mask=new Ext.LoadMask(Ext.get('linkWindow'));mask.show();CUR.WebServiceAccess.prototype.getWmsIdEquiv(function(response){win.wmsIdEquiv=Ext.decode(response.responseText);textbox.setValue(buildUrl());mask.hide();},null,win);}else{textbox.setValue(buildUrl());}}},hide:{fn:function(win){Ext.getDoc().un('mouseup',documentClick);}}},wmsIdEquiv:null});return thisWin;};OpenLayers.Control.LoadingStatus=OpenLayers.Class(OpenLayers.Control,{counter:0,maximized:false,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,[options]);},addLayer:function(evt){if(evt.layer){evt.layer.events.register('loadstart',this,this.increaseCounter);evt.layer.events.register('loadend',this,this.decreaseCounter);}},setMap:function(map){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register('preaddlayer',this,this.addLayer);for(var i=0;i<this.map.layers.length;i++){var layer=this.map.layers[i];if(layer.CLASS_NAME!='OpenLayers.Layer.AgsCache'){layer.events.register('loadstart',this,this.increaseCounter);layer.events.register('loadend',this,this.decreaseCounter);}}},increaseCounter:function(){this.counter++;if(this.counter>0){if(!this.maximized){this.maximizeControl();}}},decreaseCounter:function(){if(this.counter>0){this.counter--;}
if(this.counter==0){if(this.maximized){this.minimizeControl();}}},minimizeControl:function(evt){CUR.MapPage.setToolbarBusy(false);this.maximized=false;},maximizeControl:function(evt){CUR.MapPage.setToolbarBusy(true);this.maximized=true;},destroy:function(){if(this.map){this.map.events.unregister('preaddlayer',this,this.addLayer);if(this.map.layers){for(var i=0;i<this.map.layers.length;i++){var layer=this.map.layers[i];layer.events.unregister('loadstart',this,this.increaseCounter);layer.events.unregister('loadend',this,this.decreaseCounter);}}}
OpenLayers.Control.prototype.destroy.apply(this,arguments);},CLASS_NAME:"OpenLayers.Control.LoadingStatus"});﻿
var CUR=window.CUR||{};CUR.Map=function(mapDiv,baseLayerIds,labelLayerIds,lotLayerIds,mainLayerIds,overviewIds){OpenLayers.ImgPath='images/openlayers/';OpenLayers.DOTS_PER_INCH=96;OpenLayers.Util.onImageLoadErrorColor="";this._map=null;this._mapDiv=mapDiv;this._baseLayerIds=baseLayerIds;this._lotLayerIds=lotLayerIds;this._labelLayerIds=labelLayerIds;this._mainLayerIds=mainLayerIds;this._overviewIds=overviewIds;this.buildMap();};CUR.Map.prototype={buildMap:function(){var _maxExtent=new OpenLayers.Bounds(1036584.3909905,45345.264399406,1585251.73386016,472555.92886673);var _maxResolution="auto";var _projection="EPSG:2263";var _numZoomLevels=10;var _mapOptions;_mapOptions={controls:[],projection:_projection,numZoomLevels:_numZoomLevels,units:'ft',maxExtent:new OpenLayers.Bounds(849588.888888950784,-48755.55555563008,1738477.777777840128,617911.111111036928),resolutions:new Array(868.055555555556,434.027777777778,217.013888888889,108.506944444444,54.2534722222222,27.1267361111111,13.5633680555556,6.781684027777784,3.39084201388889,1.69542100694444),restrictedExtent:new OpenLayers.Bounds(1024050,84890,1603078,447355)};this._map=new OpenLayers.Map(this._mapDiv,_mapOptions);this._map.events.register('zoomend',null,CUR.MapPage.layerWindow.mapScaleChanged);this._map.events.register('zoomend',null,CUR.MapPage.mapScaleChanged);this._map.div.oncontextmenu=function noContextMenu(e){return false;};this._map.addLayers(CUR.OlMapLayersFactory.prototype.getLayers(this._baseLayerIds,this._labelLayerIds,this._lotLayerIds,this._mainLayerIds));CUR.MapControls.prototype.addControls(this._map,this._overviewIds);if(!this._map.getCenter())
{this._map.setCenter();}},updateMapSize:function(){if(typeof this._map!='undefined'){this._map.updateSize();}},toggleLotLayer:function(checked){var lotLayer=this._map.getLayersByName('lotLayer')[0];lotLayer.setVisibility(checked);},togglePopLayer:function(checked){var lotLayer=this._map.getLayersByName('populationLayer')[0];lotLayer.setVisibility(checked);},toggleSatellite:function(button,state){if(state){this._map.getLayersByName('aerialLayer')[0].setVisibility(true);}else{this._map.getLayersByName('aerialLayer')[0].setVisibility(false);}},setOpacity:function(layerName,opacity){this._map.getLayersByName(layerName)[0].setOpacity(opacity);},setPopOpacity:function(opacity){this._map.getLayersByName('populationLayer')[0].setOpacity(opacity);},changeWmsLayers:function(layerName,wmsId){this._map.getLayersByName(layerName)[0].mergeNewParams({LAYERS:wmsId});},getScale:function(){return this._map.getScale();},getMainLayer:function(){return this._map.getLayersByName('mainLayer')[0];},getLabelLayer:function(){return this._map.getLayersByName('labelLayer')[0];},changeWmsLayers2:function(layerName,wmsIds,makeVisible){var layer=this._map.getLayersByName(layerName)[0];var layers=layer.params.LAYERS.split(',');var i;if(makeVisible){var arrWmsIds=wmsIds.split(',');for(i=0;i<arrWmsIds.length;i++){layers.push(arrWmsIds[i]);}
layers.sortNum();}else{for(i=layers.length;i>=0;i--){if(wmsIds.indexOf(layers[i])>-1){layers.splice(i,1);}}}
layer.mergeNewParams({LAYERS:layers.join()});},selectFeature:function(layer,param,value){this._map.getLayersByName('highlightLayer')[0].mergeNewParams({VILLAGE:value});this._map.getLayersByName('highlightLayer')[0].setVisibility(true);},selectSchoolDistrict:function(value){this._map.getLayersByName('highlightLayer')[0].mergeNewParams({SCHOOLDISTRICT:value});this._map.getLayersByName('highlightLayer')[0].setVisibility(true);},clearSelection:function(){if(typeof this._map!='undefined'){this._map.getLayersByName('highlightLayer')[0].setVisibility(false);this._map.getLayersByName('highlightLayer')[0].mergeNewParams({VILLAGE:'',SCHOOLDISTRICT:''});}},zoomToExtent:function(minx,miny,maxx,maxy){this._map.zoomToExtent(new OpenLayers.Bounds(minx,miny,maxx,maxy));},changeOlLayerWmsIds:function(wmsIds,layerName,show){var layer=null;if(layerName=='Main'){layer=this._map.getLayersByName('mainLayer')[0];}else if(layerName=='Label'){layer=this._map.getLayersByName('labelLayer')[0];}else if(layerName=='Population'){layer=this._map.getLayersByName('populationLayer')[0];}
if(layer!==null){if(show){this.show(wmsIds,layer);}else{this.hide(wmsIds,layer);}}},show:function(wmsIds,layer){var newWmsIds;if(layer.params.LAYERS.length==0){newWmsIds=wmsIds;}else{newWmsIds=layer.params.LAYERS.split(',').concat(wmsIds);}
newWmsIds=newWmsIds.unique(false);newWmsIds.sortNum();layer.setVisibility(true);layer.mergeNewParams({LAYERS:newWmsIds.join()});},hide:function(wmsIds,layer){var olLayerWmsIds=layer.params.LAYERS.split(',');var i,j;for(i=olLayerWmsIds.length;i>=0;i--){for(j=0;j<wmsIds.length;j++){if(olLayerWmsIds[i]==wmsIds[j]){olLayerWmsIds.splice(i,1);}}}
if(olLayerWmsIds.length===0){layer.setVisibility(false);}
layer.mergeNewParams({LAYERS:olLayerWmsIds.join()});},getLayerWmsIds:function(layerName){}};CUR.OlMapLayersFactory=function(){}
CUR.OlMapLayersFactory.prototype.getLayers=function(baseLayerIds,labelLayerIds,lotLayerIds,mainLayerIds){var baseLayer;var aerialLayer;var lotLayer;var populationLayer;var mainLayer;var labelLayer;var highlightLayer;var markerLayer;var layers=[];baseLayer=new OpenLayers.Layer.WMS('baseLayer',CUR.Urls.longIslandIndex[0],{layers:baseLayerIds,format:'image/png',transparent:false,BGCOLOR:'0XC9F2FF'},{singleTile:true,buffer:0,gutter:0,isBaseLayer:true});layers.push(baseLayer);var baseWideZoomLayer=new OpenLayers.Layer.AgsCache('baseWideZoomLayer',CUR.Urls.baseWideZoom,{layername:'_allLayers',type:'png',tileOrigin:new OpenLayers.LonLat(-120039300,145506800),maxExtent:new OpenLayers.Bounds(849588.888888950784,-48754.55555563008,1738476.777777840128,617910.111111036928),transparent:true,maxResolution:868.055555555556,minResolution:434.027777777778});baseWideZoomLayer.isBaseLayer=false;baseWideZoomLayer.buffer=0;layers.push(baseWideZoomLayer);aerialLayer=new OpenLayers.Layer.WMS('aerialLayer',CUR.Urls.largeScaleAerial,{layers:'NY_LONG_2008_2FT_NC,NY_LONG_2007_6IN_NC_5,NY_LONG_2007_6IN_NC_4,NY_LONG_2007_6IN_NC_3,NY_LONG_2007_6IN_NC_2,NY_LONG_2007_6IN_NC_1',format:'image/jpeg',transparent:false},{singleTile:false,buffer:0,gutter:0,isBaseLayer:false,visibility:false,maxResolution:27.1267361111111,minResolution:0});layers.push(aerialLayer);var smallScaleAerial=new OpenLayers.Layer.WMS('smallScaleAerial',CUR.Urls.smallScaleAerial,{layers:'0',format:'image/jpeg',transparent:false},{singleTile:false,buffer:0,gutter:0,isBaseLayer:false,visibility:false,maxResolution:868.055555555556,minResolution:54.2534722222222});layers.push(smallScaleAerial);lotLayer=new OpenLayers.Layer.AgsCache('lotLayer',CUR.Urls.parcels,{layername:'_allLayers',type:'png',tileOrigin:new OpenLayers.LonLat(-120039300,145506800),maxExtent:new OpenLayers.Bounds(849588.888888950784,-48754.55555563008,1738476.777777840128,617910.111111036928),transparent:true});lotLayer.isBaseLayer=false;lotLayer.buffer=0;layers.push(lotLayer);populationLayer=new OpenLayers.Layer.WMS('populationLayer',CUR.Urls.demographics,{layers:'',format:'image/gif',transparent:true},{singleTile:false,buffer:0,gutter:0,visibility:false},{isBaseLayer:false});layers.push(populationLayer);mainLayer=new OpenLayers.Layer.WMS('mainLayer',CUR.Urls.longIslandIndex,{layers:mainLayerIds,format:'image/gif',transparent:true},{singleTile:false,buffer:0,gutter:0},{isBaseLayer:false});layers.push(mainLayer);mainLayer.setOpacity(0.9);labelLayer=new OpenLayers.Layer.WMS('labelLayer',CUR.Urls.longIslandIndex,{layers:labelLayerIds,format:'image/gif',transparent:true},{singleTile:true,buffer:0,gutter:0,visibility:true},{isBaseLayer:false});layers.push(labelLayer);highlightLayer=new OpenLayers.Layer.WMS('highlightLayer',CUR.Urls.highlight,{layers:'0',format:'image/gif',transparent:true},{singleTile:true,buffer:0,gutter:0,ratio:1.5},{isBaseLayer:false});highlightLayer.setOpacity(0.8);highlightLayer.setVisibility(false);layers.push(highlightLayer);markerLayer=new OpenLayers.Layer.Markers('markerLayer');layers.push(markerLayer);return layers;};CUR.MapControls=function(map){this.addControls(map);};CUR.MapControls.prototype.addControls=function(map,overviewIds){map.addControl(new OpenLayers.Control.Navigation());map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true}));map.addControl(new OpenLayers.Control.ScaleLine());map.addControl(new OpenLayers.Control.LoadingStatus());map.addControl(new OpenLayers.Control.ArgParserLiIndex());var nav=new OpenLayers.Control.NavigationHistory({limit:5});map.addControl(nav);var panel=new OpenLayers.Control.Panel();panel.addControls([nav.previous,nav.next]);map.addControl(panel);var ovLayer=new OpenLayers.Layer.WMS("ovLayer",CUR.Urls.longIslandIndex[0],{layers:overviewIds,format:"image/png",BGColor:"0XC9F2FF",projection:map.projection},{singleTile:true},{isBaseLayer:false});var ovControl=new OpenLayers.Control.OverviewMap({layers:[ovLayer]});var ovOptions={maxExtent:new OpenLayers.Bounds(1036584.3909905,45345.264399406,1585251.73386016,472555.92886673),projection:map.projection,numZoomLevels:2};ovControl.mapOptions=ovOptions;map.addControl(ovControl);ovControl.maximizeControl();var click=new OpenLayers.Control.Click();map.addControl(click);click.activate();};﻿
var CUR=window.CUR||{};Array.prototype.sortNum=function(){return this.sort(function(a,b){return a-b;});}
Array.prototype.unique=function(b){var a=[],i,l=this.length;for(i=0;i<l;i++){if(a.indexOf(this[i],0,b)<0){a.push(this[i]);}}
return a;};Array.prototype.indexOf=function(o){for(var i=0,len=this.length;i<len;i++){if(this[i]==o)return i;}
return-1;};Number.prototype.addCommas=function(){if(this!=null){var nStr=this+'';x=nStr.split('.');x1=x[0];x2=x.length>1?'.'+x[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(x1)){x1=x1.replace(rgx,'$1'+','+'$2');}
return x1+x2;}};CUR.MapPage=(function(){var _map;var _viewport;var _selectedVillage=null;var _selectedSchoolDistrict=null;var _compareWindow;var _regionalWindow=null;var _btnSatellite;Ext.WindowMgr.zseed=10000;Ext.QuickTips.init();return{populationItems:null,panelLegend:null,layerWindow:null,printWindow:null,toolBar:null,init:function(mapDiv,baseLayerIds,labelLayerIds,lotLayerIds,mainLayerIds,overviewIds){Ext.BLANK_IMAGE_URL='http://extjs.cachefly.net/ext-2.2/resources/images/default/s.gif';_viewport=Ext.ux.Viewport();this.layerWindow=new Ext.ux.LayerWindow();this.toolBar=new Ext.StatusBar({renderTo:'toolbar',statusAlign:'right',busyIconCls:'map-busy',style:'background:#e7e7e7;border-color:#d0d0d0;',items:[new Ext.Toolbar.Item(Ext.get('villageSelect')),' ','-',{text:'Map Options',menu:{items:[{text:'Transportation & Reference',handler:function(button,event){CUR.MapPage.layerWindow.showWin({scale:_map.getScale()});}},{text:'Regional Views',handler:function(button,event){CUR.MapPage.showRegionalWindow();}}]}},'-',{id:'btnSatellite',text:'Satellite',enableToggle:true,tooltip:'Zoom in to see satellite images',disabled:true,toggleHandler:CUR.MapPage.toggleSatellite},'-',{text:'Link to this map',handler:function(button,e){var linkWindow=Ext.getCmp('linkWindow');if(!linkWindow){linkWindow=Ext.ux.LinkWindow({width:Ext.getBody().getWidth()-button.getEl().getX()-8,x:button.getEl().getX(),y:button.getEl().getY()+27,map:_map});}
linkWindow.show();}},{text:'Print',handler:function(button,e){if(CUR.MapPage.printWindow===null){CUR.MapPage.printWindow=Ext.ux.PrintWindow({x:button.getEl().getX(),y:button.getEl().getY()+27,map:_map._map});}
CUR.MapPage.printWindow.show();}},'-',{text:'About',handler:function(button,event){if(Ext.getCmp('aboutWindow')==null){var aboutWindow=Ext.ux.AboutWindow();aboutWindow.show();}}}]});_btnSatellite=Ext.getCmp('btnSatellite');_map=new CUR.Map(mapDiv,baseLayerIds,labelLayerIds,lotLayerIds,mainLayerIds,overviewIds);Ext.get('ddlVillages').on('change',this.ddlVillageChanged);this.setLandUseTab(null);Ext.DomHelper.append(Ext.get('north'),{tag:'div',style:'position:absolute;right:6px;top:4px;',html:'Problems? Feedback? Please <a href="mailto:info@longislandindex.org?subject=Feedback for the Long Island Index mapping site">email us!</a>'});new Ext.form.TextField({applyTo:'ea',emptyText:'your email address'});},checkLayerList:function(event){},showRegionalWindow:function(regionalView){if(_regionalWindow===null){_regionalWindow=Ext.ux.RegionalViewsWindow({regionalView:regionalView});}
_regionalWindow.show();},showAboutWindow:function(){if(Ext.getCmp('aboutWindow')==null){var aboutWindow=Ext.ux.AboutWindow();aboutWindow.show();}},setToolbarBusy:function(isBusy){if(isBusy){this.toolBar.showBusy();}else{this.toolBar.clearStatus();}},toggleSatellite:function(button,state){if(_map!=null){_map.toggleSatellite(button,state);}},isSatelliteVisible:function(){return _map._map.getLayersByName('aerialLayer')[0].getVisibility();},toggleLotLayer:function(checked){_map.toggleLotLayer(checked);},mapScaleChanged:function(event){if(event.object.zoom<=4){_btnSatellite.disable();}else{_btnSatellite.enable();}},togglePopLayer:function(checked){_map.togglePopLayer(checked);},updateMapSize:function(){if(typeof _map!='undefined'){_map.updateMapSize();}},mergeNewMainLayerParams:function(layerList){},changeOlLayerWmsIds:function(olGroups,show){var i;for(i=0;i<olGroups.length;i++){_map.changeOlLayerWmsIds(olGroups[i].WmsIds,olGroups[i].Name,show);}},getLayer:function(layerName){return _map._map.getLayersByName(layerName)[0];},toggleMainLayer:function(wmsIds,visibility){_map.changeWmsLayers2('mainLayer',wmsIds,visibility);},toggleLabelLayer:function(wmsIds,visibility){_map.changeWmsLayers2('labelLayer',wmsIds,visibility);},changeVisiblePopulationLayer:function(wmsIds){_map.changeWmsLayers('populationLayer',wmsIds);},setOpacity:function(layerName,opacity){_map.setOpacity(layerName,opacity);},setPopOpacity:function(opacity){_map.setPopOpacity(opacity);},getSelectedVillage:function(){return _selectedVillage;},setSelectedVillage:function(village){_selectedVillage=village;_map._map.getLayersByName('highlightLayer')[0].setVisibility(false);_map.zoomToExtent(village.FeatureExtent.MinX,village.FeatureExtent.MinY,village.FeatureExtent.MaxX,village.FeatureExtent.MaxY);_map.selectFeature('1','PLACE',village.Code);this.setLandUseTab(village);this.setPopulationTab(village);this.setRpaDowntownTab(village);if(_regionalWindow!==null){_regionalWindow.selectVillage(village.Code);}},setSelectedVillageNoZoom:function(village){_selectedVillage=village;this.setLandUseTab(village);this.setPopulationTab(village);this.setRpaDowntownTab(village);if(_regionalWindow!=null){_regionalWindow.selectVillage(village.Code);}},getSelectedSchoolDistrict:function(){return _selectedSchoolDistrict;},setSelectedSchoolDistrict:function(district,zoom){_selectedSchoolDistrict=district;_map._map.getLayersByName('highlightLayer')[0].setVisibility(false);_map.zoomToExtent(district.FeatureExtent.MinX,district.FeatureExtent.MinY,district.FeatureExtent.MaxX,district.FeatureExtent.MaxY);_map.selectSchoolDistrict(district.Code);this.setEducationTab(district);},setSelectedSchoolDistrictNoZoom:function(district){_selectedSchoolDistrict=district;this.setEducationTab(district);},getScale:function(){_map.getScale();},clearVillageSelection:function(){_selectedVillage=null;Ext.get('ddlVillages').dom[0].selected=true;CUR.MapPage.updateHighlightImage(false);this.setLandUseTab(null);this.setPopulationTab(null);this.setRpaDowntownTab(null);},clearSchoolDistrictSelection:function(){_selectedSchoolDistrict=null;var ddlSchoolDistricts=Ext.get('ddlSchoolDistricts');if(ddlSchoolDistricts!==null){ddlSchoolDistricts.dom[0].selected=true;}
CUR.MapPage.updateHighlightImage(false);CUR.MapPage.setEducationTab(null);},setLandUseTab:function(village){var panel=Ext.getCmp('tabLandUse');if(typeof panel.items!=='undefined'){panel.items.items[0].setExplanation('Select from the "Zoom To Village" list to see detailed information about a specific community.');panel.items.items[3].setVillage(village);panel.items.items[4].setVillage(village);if(village!=null){panel.items.items[0].setTitle(village.Label+'\'s land use profile');if(_compareWindow){if(!_compareWindow.windowIsClosed()){var compareStrategy=_compareWindow.getCompareStrategy();compareStrategy.village=_selectedVillage;_compareWindow.showWin(compareStrategy);}}}else{panel.items.items[0].setTitle('Long Island\'s land use profile');panel.items.items[0].setExplanation('Select from the "Zoom To Village" list to see detailed information about a specific community.');}}},setPopulationTab:function(village){if(village!=null){var panel=Ext.getCmp('tabPopulation');if(typeof panel.items!=='undefined'){panel.items.items[0].setSelectedFeature(village);for(var i=1,len=panel.items.items.length;i<len;i++){panel.items.items[i].setSelectedFeature(village);}}
var panel2=Ext.getCmp('tabHousing');if(typeof panel2.items!=='undefined'){panel2.items.items[0].setSelectedFeature(village);for(var i=1,len=panel2.items.items.length;i<len;i++){panel2.items.items[i].setSelectedFeature(village);}}}else{var panel=Ext.getCmp('tabPopulation');if(typeof panel.items!=='undefined'){panel.items.items[0].setSelectedFeature(null);for(var i=1,len=panel.items.items.length;i<len;i++){panel.items.items[i].setSelectedFeature(null);}}
var panel2=Ext.getCmp('tabHousing');if(typeof panel2.items!=='undefined'){panel2.items.items[0].setSelectedFeature(null);for(var i=1,len=panel2.items.items.length;i<len;i++){panel2.items.items[i].setSelectedFeature(null);}}}},setRpaDowntownTab:function(village){var panel=Ext.getCmp('tabRpaDowntown');if(typeof panel.items!=='undefined'){panel.setSelectedFeature(village);}},setEducationTab:function(district){if(district!=null){var panel3=Ext.getCmp('tabEducation');if(typeof panel3.items!=='undefined'){panel3.items.items[0].setSelectedFeature(district);for(var i=1,len=panel3.items.items.length;i<len;i++){panel3.items.items[i].setSelectedFeature(district);}}}else{var panel3=Ext.getCmp('tabEducation');if(typeof panel3.items!=='undefined'){panel3.items.items[0].setSelectedFeature(null);for(var i=1,len=panel3.items.items.length;i<len;i++){panel3.items.items[i].setSelectedFeature(null);}}}},villageResponse:function(response){var village=Ext.decode(response.responseText);CUR.MapPage.setSelectedVillage(village);},villageResponseNoZoom:function(response){var village=Ext.decode(response.responseText);CUR.MapPage.setSelectedVillageNoZoom(village);},updateHighlightImage:function(isFromClick,villageCode,districtCode){if(!isFromClick){(CUR.MapPage.getSelectedVillage()!==null)?villageCode=CUR.MapPage.getSelectedVillage().Code:villageCode=null;if(Ext.getCmp('tabsWest').getActiveTab().id==='tabEducation'&&CUR.MapPage.getSelectedSchoolDistrict()!==null){districtCode=CUR.MapPage.getSelectedSchoolDistrict().Code;}else{districtCode=null;}}
if(typeof _map!='undefined'){var layer=_map._map.getLayersByName('highlightLayer')[0];if(layer.params.VILLAGE!==villageCode||layer.params.SCHOOLDISTRICT!==districtCode){layer.setVisibility(false);layer.mergeNewParams({VILLAGE:villageCode,SCHOOLDISTRICT:districtCode});if(villageCode!==null||districtCode!==null){layer.setVisibility(true);}}}},schoolDistrictResponse:function(response){var district=Ext.decode(response.responseText);CUR.MapPage.setSelectedSchoolDistrict(district);},schoolDistrictResponseNoZoom:function(response){var district=Ext.decode(response.responseText);CUR.MapPage.setSelectedSchoolDistrictNoZoom(district);},responseError:function(response){alert(response.responseTest);},ddlVillageChanged:function(e,ddl,options){var fips=ddl.value;if(fips!=''){CUR.WebServiceAccess.prototype.getVillage(fips,CUR.MapPage.villageResponse,CUR.MapPage.responseError);}else{CUR.MapPage.clearVillageSelection();}},onCompareClick:function(btn,type,compareText){var compareStrategy=new CUR.LandUseCompare(_selectedVillage,type,compareText);CUR.MapPage.openCompareWindow(compareStrategy,btn.id);},openCompareWindow:function(compareStrategy,btn){if(!_compareWindow){_compareWindow=new Ext.ux.CompareWindow();}
_compareWindow.showWin(compareStrategy,btn);},isZoomedMaxExtent:function(){return(_map._map.getZoom()===0);},zoomToMaxExtent:function(){_map._map.zoomToMaxExtent();},getRestIdsToIdentify:function(){return CUR.MapPage.layerWindow.getRestIdsToIdentify();},getActiveRegionalView:function(){if(_regionalWindow!==null){if(_regionalWindow.isVisible()){return _regionalWindow.getActiveRegionalView();}}
return'';},checkIfUiLayerVisibleBasedOnWmsVis:function(olGroups,visibleServiceLayers){for(var i=0,len=olGroups.length;i<len;i++){for(var j=0,len1=olGroups[i].WmsIds.length;j<len1;j++){if(visibleServiceLayers.indexOf(olGroups[i].WmsIds[j])>-1){return true;}}}
return false;}}})();Ext.ux.LandUsePie=Ext.extend(Ext.Container,{autoEl:'div',title:null,imgPie:null,btnCompare:null,landUseType:null,initComponent:function(){this.items=[{xtype:'component',autoEl:{tag:'div',html:'<span class="landuse-header-text">'+this.headerText+'</span>','class':'landuse-header'}},{xtype:'component',id:this.id+'Title',autoEl:{tag:'h4',html:this.buildTitleText(null),'class':'landuse-subtitle'}},{xtype:'component',id:this.id+'Img',autoEl:{tag:'img',src:CUR.LandUse.prototype.getLiLandUseChartUrl(this.landUseType)}},{xtype:'button',id:this.id+'Compare',text:'Compare',disabled:true,style:(Ext.isIE6?'margin-left:14px;':(Ext.isIE7?'margin-left:28px;':'margin-left:19px;')),listeners:{click:{fn:this.onCompareClick,scope:this},render:{fn:function(obj,layout){obj.el.applyStyles((Ext.isIE?'styleFloat':'cssFloat')+':left;');}}}},{xtype:'component',autoEl:{tag:'img',src:'images/Nassau-residential-overlay.gif',style:'width:125px;margin-left:30px;float:left;margin-top:'+((Ext.isIE6||Ext.isIE7)?'-8px;':'0px;')}}];this.cls='landuse-type';Ext.ux.LandUsePie.superclass.initComponent.call(this);},onCompareClick:function(btn,e){CUR.MapPage.onCompareClick(btn,this.landUseType,this.ownerCt.compareText)},setVillage:function(village){if(village!==null){this.getComponent(this.id+'Title').el.dom.innerHTML=this.buildTitleText(village);this.getComponent(this.id+'Img').el.dom.src=CUR.LandUse.prototype.getChartUrl(village,this.landUseType);this.getComponent(this.id+'Compare').enable();}else{this.getComponent(this.id+'Title').el.dom.innerHTML=this.buildTitleText(null);this.getComponent(this.id+'Img').el.dom.src=CUR.LandUse.prototype.getLiLandUseChartUrl(this.landUseType);this.getComponent(this.id+'Compare').disable();}},buildTitleText:function(village){var text;if(village!==null){text='% of each land use type in '+village.Label;}else{text='% of each land use type in Long Island';}
if(this.landUseType==='lots'){text+='<br />(by number of parcels)';}else if(this.landUseType==='area'){text+='<br />(by acres)';}
return text;}});Ext.reg('landusepie',Ext.ux.LandUsePie);﻿
OpenLayers.Control.PanZoomBar.prototype.zoomStopWidth=23;OpenLayers.Control.PanZoomBar.prototype.draw=function(px){OpenLayers.Control.prototype.draw.apply(this,arguments);px=this.position.clone();this.buttons=[];var sz=new OpenLayers.Size(23,28);var szWorld=new OpenLayers.Size(21,21)
var szNS=new OpenLayers.Size(21,28);var szEW=new OpenLayers.Size(28,21);var centered=new OpenLayers.Pixel(px.x+szEW.w/2,px.y);var wposition=szEW.w;if(this.zoomWorldIcon){centered=new OpenLayers.Pixel(px.x+szEW.w,px.y);}
this._addButton("panup","north-mini.png",centered,szNS);px.y=centered.y+szNS.h;this._addButton("panleft","west-mini.png",px,szEW);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",px.add(szEW.w,0),szWorld);wposition+=szWorld.w;}
this._addButton("panright","east-mini.png",px.add(wposition,0),szEW);this._addButton("pandown","south-mini.png",centered.add(0,szNS.h+szWorld.h),szNS);this._addButton("zoomin","zoom-plus-mini.png",centered.add(-1,sz.h*3+5),sz);centered=this._addZoomBar(centered.add(-1,sz.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",centered,sz);return this.div;};OpenLayers.Control.PanZoomBar.prototype._addZoomBar=function(centered){var imgLocation=OpenLayers.Util.getImagesLocation();var id="OpenLayers_Control_PanZoomBar_Slider"+this.map.id;var zoomsToEnd=this.map.getNumZoomLevels()-1-this.map.getZoom();var slider=OpenLayers.Util.createAlphaImageDiv(id,centered.add(-1,zoomsToEnd*this.zoomStopHeight),new OpenLayers.Size(25,9),imgLocation+"slider.png","absolute");this.slider=slider;this.sliderEvents=new OpenLayers.Events(this,slider,null,true);this.sliderEvents.on({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});var sz=new OpenLayers.Size();sz.h=this.zoomStopHeight*this.map.getNumZoomLevels();sz.w=this.zoomStopWidth;var div=null;if(OpenLayers.Util.alphaHack()){var id="OpenLayers_Control_PanZoomBar"+this.map.id;div=OpenLayers.Util.createAlphaImageDiv(id,centered,new OpenLayers.Size(sz.w,this.zoomStopHeight),imgLocation+"zoombar.png","absolute",null,"crop");div.style.height=sz.h;}else{div=OpenLayers.Util.createDiv('OpenLayers_Control_PanZoomBar_Zoombar'+this.map.id,centered,sz,imgLocation+"zoombar.png");}
this.zoombarDiv=div;this.divEvents=new OpenLayers.Events(this,div,null,true);this.divEvents.on({"mousedown":this.divClick,"mousemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick});this.div.appendChild(div);this.startTop=parseInt(div.style.top);this.div.appendChild(slider);this.map.events.register("zoomend",this,this.moveZoomBar);centered=centered.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return centered;};OpenLayers.Control.OverviewMap.prototype.draw=function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var layer=this.map.baseLayer.clone();this.layers=[layer];}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div;}}
this.element=document.createElement('div');this.element.className=this.displayClass+'Element';this.element.style.display='none';this.mapDiv=document.createElement('div');this.mapDiv.style.width=this.size.w+'px';this.mapDiv.style.height=this.size.h+'px';this.mapDiv.style.position='relative';this.mapDiv.style.overflow='hidden';this.mapDiv.id=OpenLayers.Util.createUniqueID('overviewMap');this.extentRectangle=document.createElement('div');this.extentRectangle.style.position='absolute';this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+'ExtentRectangle';this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+'Container';var imgLocation=OpenLayers.Util.getImagesLocation();var img=imgLocation+'overview-maximize.png';this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+'MaximizeButton',null,new OpenLayers.Size(80,20),img,'absolute');this.maximizeDiv.style.display='none';this.maximizeDiv.className=this.displayClass+'MaximizeButton';OpenLayers.Event.observe(this.maximizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var img=imgLocation+'overview-minimize.png';this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv('OpenLayers_Control_minimizeDiv',null,new OpenLayers.Size(39,20),img,'absolute');this.minimizeDiv.style.display='none';this.minimizeDiv.className=this.displayClass+'MinimizeButton';OpenLayers.Event.observe(this.minimizeDiv,'click',OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var eventsToStop=['dblclick','mousedown'];for(var i=0;i<eventsToStop.length;i++){OpenLayers.Event.observe(this.maximizeDiv,eventsToStop[i],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,eventsToStop[i],OpenLayers.Event.stop);}
this.minimizeControl();}else{this.element.style.display='';}
if(this.map.getExtent()){this.update();}
this.map.events.register('moveend',this,this.update);return this.div;};﻿
Ext.ux.PrintWindow=function(config){var buildParameters=function(){var map=config.map;var params=[];var printWindow;params['title']=textbox.getValue();params['bbox']=map.getExtent().toBBOX();var resolution=map.getResolution();var largeScaleAerial=CUR.MapPage.getLayer('aerialLayer');params['smallscaleaerial']=false;params['largescaleaerial']=false;if(largeScaleAerial.visibility){if((resolution>=largeScaleAerial.minResolution)&&(resolution<=largeScaleAerial.maxResolution)){params['largescaleaerial']=true;}else{}}
params['landuse']=CUR.MapPage.getLayer('lotLayer').visibility;params['landuseopacity']=CUR.MapPage.getLayer('lotLayer').opacity;params['baselayers']=CUR.MapPage.getLayer('baseLayer').params.LAYERS;params['mainlayers']=CUR.MapPage.getLayer('mainLayer').params.LAYERS;params['mainlayers']+=','+CUR.MapPage.getLayer('labelLayer').params.LAYERS;params['demographicslayers']=CUR.MapPage.getLayer('populationLayer').params.LAYERS;params['demographicsopacity']=CUR.MapPage.getLayer('populationLayer').opacity;if(CUR.MapPage.getSelectedVillage()!==null){params['village']=CUR.MapPage.getSelectedVillage().Code;}
if(CUR.MapPage.getSelectedSchoolDistrict()!==null){params['schooldistrict']=CUR.MapPage.getSelectedSchoolDistrict().Code;}
var markerLayer=map.getLayersByName("markerLayer")[0];if(markerLayer.markers.length>0&&map.getExtent().containsLonLat(markerLayer.markers[0].lonlat)){params['marker']=markerLayer.markers[0].lonlat.lon+","+markerLayer.markers[0].lonlat.lat;}
return OpenLayers.Util.getParameterString(params);};var createPdf=function(){if(textbox.isValid()){var mask=new Ext.LoadMask(Ext.get('printWindow'),{msg:"Creating PDF..."});labelInfo.setText('');mask.show();Ext.Ajax.request({url:'PdfMap.ashx?'+buildParameters(),success:function(response,options){mask.hide();openPdf(Ext.decode(response.responseText).url);},failure:function(response,options){mask.hide();labelInfo.setText('There was an error generating your pdf map. Please try again later.');},disableCaching:false});}};var openPdf=function(url){var popupText='<br />The PDF was successfully created, but your web browser\'s pop-up blocker prevented it from opening in a new window.<br /><a href="'+url+'" target="blank" >Click here to open your PDF map.</a>';var errorText='There was an error generating your pdf map. Please try again later.';if(url!=''){var popup=window.open(url,'_blank');if(popup){if(Ext.isIE7){function checkWindowStillOpen(){if(!popup.closed){}else{Ext.get(labelInfo.id).update(popupText);}}
window.setTimeout(checkWindowStillOpen,500);}else{}}else{Ext.get(labelInfo.id).update(popupText);}}else{labelInfo.setText(errorText);}
printWindow.doLayout();};var textbox=new Ext.form.TextField({width:380,maxLength:100});var submit=new Ext.Button({text:'Create PDF',handler:createPdf,style:'padding-top:16px;'});var labelInfo=new Ext.form.Label({text:' -',style:'font-size:1.0em;font-weight:bold;'});printWindow=new Ext.Window({id:'printWindow',width:405,title:'Print/Save as PDF',resizable:false,closeAction:'hide',baseCls:'ext-wincompare',x:config.x,y:config.y,bodyStyle:'padding:6px 4px 18px 8px',constrain:true,buttonAlign:'center',buttons:[submit],items:[new Ext.Component({autoEl:{tag:'div',html:'Enter a title for your map layout, then click "Create PDF" to see your map in PDF format.  You\'ll be able to print it directly or save it to your computer.'}}),new Ext.Component({autoEl:{tag:'div',html:'Title',style:'margin-top:8px;font-size:1.1em;'}}),textbox,labelInfo],listeners:{beforeShow:{fn:function(win){textbox.setValue('');labelInfo.setText('');win.setSize(win.getSize());}}}});return printWindow;};﻿
var CUR=window.CUR||{};CUR.convertSP=function(uX,uY){a=20925604.48;ec=0.08181905782;angRad=0.01745329252;pi4=3.141592653582/4;p0=40.166667*angRad;p1=40.666667*angRad;p2=41.033333*angRad;m0=-74.0000*angRad;x0=984250.00;with(Math){m1=cos(p1)/sqrt(1-(pow(ec,2))*pow(sin(p1),2));m2=cos(p2)/sqrt(1-(pow(ec,2))*pow(sin(p2),2));t0=tan(pi4-(p0/2));t1=tan(pi4-(p1/2));t2=tan(pi4-(p2/2));t0=t0/pow(((1-(ec*(sin(p0))))/(1+(ec*(sin(p0))))),ec/2);t1=t1/pow(((1-(ec*(sin(p1))))/(1+(ec*(sin(p1))))),ec/2);t2=t2/pow(((1-(ec*(sin(p2))))/(1+(ec*(sin(p2))))),ec/2);n=log(m1/m2)/log(t1/t2);f=m1/(n*pow(t1,n));rho0=a*f*pow(t0,n);uX=uX-x0;pi2=pi4*2;rho=sqrt(pow(uX,2)+pow((rho0-uY),2));theta=atan(uX/(rho0-uY));txy=pow((rho/(a*f)),(1/n));lon=(theta/n)+m0;uX=uX+x0;lat0=pi2-(2*atan(txy));part1=(1-(ec*sin(lat0)))/(1+(ec*sin(lat0)));lat1=pi2-(2*atan(txy*pow(part1,(ec/2))));while((abs(lat1-lat0))>0.000000002){lat0=lat1;part1=(1-(ec*sin(lat0)))/(1+(ec*sin(lat0)));lat1=pi2-(2*atan(txy*pow(part1,(ec/2))));}
Lat=lat1/angRad;Lon=lon/angRad;return Lon+"|"+Lat;}};CUR.convertSPToLL=function(uX,uY){a=20925604.48;ec=0.08181905782;angRad=0.01745329252;pi4=3.141592653582/4;p0=40.166667*angRad;p1=40.666667*angRad;p2=41.033333*angRad;m0=-74.0000*angRad;x0=984250.00;with(Math){m1=cos(p1)/sqrt(1-(pow(ec,2))*pow(sin(p1),2));m2=cos(p2)/sqrt(1-(pow(ec,2))*pow(sin(p2),2));t0=tan(pi4-(p0/2));t1=tan(pi4-(p1/2));t2=tan(pi4-(p2/2));t0=t0/pow(((1-(ec*(sin(p0))))/(1+(ec*(sin(p0))))),ec/2);t1=t1/pow(((1-(ec*(sin(p1))))/(1+(ec*(sin(p1))))),ec/2);t2=t2/pow(((1-(ec*(sin(p2))))/(1+(ec*(sin(p2))))),ec/2);n=log(m1/m2)/log(t1/t2);f=m1/(n*pow(t1,n));rho0=a*f*pow(t0,n);uX=uX-x0;pi2=pi4*2;rho=sqrt(pow(uX,2)+pow((rho0-uY),2));theta=atan(uX/(rho0-uY));txy=pow((rho/(a*f)),(1/n));lon=(theta/n)+m0;uX=uX+x0;lat0=pi2-(2*atan(txy));part1=(1-(ec*sin(lat0)))/(1+(ec*sin(lat0)));lat1=pi2-(2*atan(txy*pow(part1,(ec/2))));while((abs(lat1-lat0))>0.000000002){lat0=lat1;part1=(1-(ec*sin(lat0)))/(1+(ec*sin(lat0)));lat1=pi2-(2*atan(txy*pow(part1,(ec/2))));}
Lat=lat1/angRad;Lon=lon/angRad;return{lon:Lon,lat:Lat};}};﻿
Ext.ux.RegionalViewsWindow=function(config){var layerToDataItem=[];layerToDataItem['DensityGE2400pplsqmi']='PopulationDensity';layerToDataItem['DensityGE4700pplsqmi']='PopulationDensity';layerToDataItem['DensityGE10000pplsqmi']='PopulationDensity';layerToDataItem['PopGrowthGE5pct']='TotalPercentChange';layerToDataItem['PopGrowthGE10pct']='TotalPercentChange';layerToDataItem['PopDeclineGE10pct']='TotalPercentChange';layerToDataItem['PctHHIncLE40KGE33pct']='PercentLowIncomeHouseholds';layerToDataItem['PctHHIncGE100KGE33pct']='PercentHighIncomeHouseholds';layerToDataItem['MedYrBuiltBefore1960']='MedianYearBuilt';layerToDataItem['MedYrBuilt1960to80']='MedianYearBuilt';layerToDataItem['MedYrBuiltPost1980']='MedianYearBuilt';layerToDataItem['Multi5plusGE25pct']='PercentMultiFamily';layerToDataItem['Downtown_highpotential']='DowntownType';layerToDataItem['Downtown_medpotential']='DowntownType';layerToDataItem['Downtown_stationarea']='DowntownType';layerToDataItem['Downtown_unknown']='DowntownType';layerToDataItem['Downtown_allpotential']='DowntownType';var allWmsIds=[];var olGroups=[];var legendImages=[];var store=new Ext.data.JsonStore({fields:[{name:'Code'},{name:'Label'},{name:'PopulationDensity'},{name:'TotalPercentChange'},{name:'PercentLowIncomeHouseholds'},{name:'PercentHighIncomeHouseholds'},{name:'MedianYearBuilt'},{name:'PercentMultiFamily'},{name:'DowntownType'}],proxy:new Ext.data.HttpProxy({url:'service.svc/Village',method:'GET',disableCaching:false}),listeners:{load:{fn:function(store,records,options){if(CUR.MapPage.getSelectedVillage()!==null){var selectedFips=CUR.MapPage.getSelectedVillage().Code;for(var i=0,len=records.length;i<len;i++){if(records[i].data.Code===selectedFips){grid.getSelectionModel().selectRow(i);}}}}}}});var grid=new Ext.grid.GridPanel({region:'center',layout:'fit',store:store,columns:[{header:'Village',sortable:true,dataIndex:'Label',width:100},{header:' ',sortable:true,dataIndex:'TotalPercentChange',width:100}],stripeRows:true,enableColumnHide:false,enableColumnMove:false,enableHdMenu:false,loadMask:true,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),frame:true,viewConfig:{forceFit:true},cls:'li-table'});var createPanelItems=function(el,response,updater,callback){var category=Ext.decode(response.responseText);var layers=category.Layers;el.update();foot.body.update('<div class="datasource">'+category.Source+'</div>');var radio;var subcategory;var text;var itemContainer;var optgroups=[];optgroups.push({tag:'option',value:'',html:'Select view...'});for(var i=0,len=layers.length;i<len;i++){if(layers[i].Subcategory!==subcategory){subcategory=layers[i].Subcategory;optgroups.push({tag:'optgroup',label:subcategory});optgroups[optgroups.length-1].children=[];}
optgroups[optgroups.length-1].children.push({tag:'option',value:layers[i].Name,html:layers[i].Label});olGroups[layers[i].Name]=layers[i].OpenLayersGroups[0];allWmsIds=allWmsIds.concat(layers[i].OpenLayersGroups[0].WmsIds);if(layers[i].Legend.length>0){legendImages[layers[i].Name]=layers[i].Legend[0].Symbol;}}
var explanation=Ext.DomHelper.append(head.body,{tag:'div','class':'regviews-explanation'},true);Ext.DomHelper.append(explanation,{tag:'span',html:'Use the pull-down below for a list of villages on Long Island that meet each criteria.'});var ul=Ext.DomHelper.append(explanation,{tag:'ul',children:[{tag:'li',html:'Double-click on a village name to zoom to that village.'},{tag:'li',html:''}]},true);var zoomOut=Ext.DomHelper.append(ul.dom.childNodes[1],{tag:'a',href:'',html:'Zoom out'},true);zoomOut.on('click',function(e,link,options){CUR.MapPage.zoomToMaxExtent();e.stopEvent();});Ext.DomHelper.append(ul.dom.childNodes[1],{tag:'span',html:'&nbsp;to see regional trends across Long Island.</li></ul>'});var select=Ext.DomHelper.append(head.body,{tag:'select',id:'ddlRegView',style:'font-size:1em',children:optgroups},true);select.on('change',selectChanged,this,{'zoomOut':zoomOut});if(config.regionalView){for(var i=0;i<select.dom.length;i++){if(select.dom[i].value==config.regionalView){select.dom[i].selected=true;}}
grid.getColumnModel().setDataIndex(1,layerToDataItem[config.regionalView]);grid.getColumnModel().setColumnHeader(0,'Village<img src='+legendImages[config.regionalView]+' style="position:absolute; right:0;"/>');grid.getColumnModel().setColumnHeader(1,layerToDataItem[config.regionalView]);grid.setTitle(layerToDataItem[config.regionalView]);store.sortInfo=null;store.removeAll();grid.getView().refresh(true);if(config.regionalView.indexOf('Downtown')>-1){store.proxy.conn.url='service.svc/RpaDowntown';}else{store.proxy.conn.url='service.svc/Village';}
store.load({params:{query:config.regionalView}});grid.addListener('rowclick',rowClicked);grid.addListener('rowdblclick',rowDblClicked);}
head.doLayout();};var selectChanged=function(e,ddl,options){var layer=CUR.MapPage.getLayer('mainLayer');var olLayerWmsIds;if(layer.params.LAYERS.length==0){olLayerWmsIds=[];}else{olLayerWmsIds=layer.params.LAYERS.split(',');}
var i,j;var layerName=ddl.value;if(layerName!=''){for(i=olLayerWmsIds.length-1;i>=0;i--){for(j=0;j<allWmsIds.length;j++){if(olLayerWmsIds[i]==allWmsIds[j]){olLayerWmsIds.splice(i,1);}}}
var newWmsIds=olLayerWmsIds.concat(olGroups[layerName].WmsIds);newWmsIds=newWmsIds.unique(true);newWmsIds.sortNum();layer.setVisibility(true);layer.mergeNewParams({LAYERS:newWmsIds.join()});grid.getColumnModel().setDataIndex(1,layerToDataItem[layerName]);grid.getColumnModel().setColumnHeader(0,'Village<img src='+legendImages[layerName]+' style="position:absolute; right:0;"/>');grid.getColumnModel().setColumnHeader(1,layerToDataItem[layerName]);grid.setTitle(layerToDataItem[layerName]);store.sortInfo=null;store.removeAll();grid.getView().refresh(true);if(layerName.indexOf('Downtown')>-1){store.proxy.conn.url='service.svc/RpaDowntown';}else{store.proxy.conn.url='service.svc/Village';}
store.load({params:{query:layerName}});grid.addListener('rowclick',rowClicked);grid.addListener('rowdblclick',rowDblClicked);if(!CUR.MapPage.isZoomedMaxExtent()){var flashCount=5;for(var i=0;i<=flashCount;i++){options.zoomOut.highlight('ff0000',{attr:'color',duration:.5});}}}else{for(i=olLayerWmsIds.length-1;i>=0;i--){for(j=0;j<allWmsIds.length;j++){if(olLayerWmsIds[i]==allWmsIds[j]){olLayerWmsIds.splice(i,1);}}}
if(olLayerWmsIds.length==0){layer.setVisibility(false);}
layer.mergeNewParams({LAYERS:olLayerWmsIds.join()});grid.getColumnModel().setColumnHeader(0,'Village');store.removeAll();}};var rowClickDelayedTask=new Ext.util.DelayedTask();var rowClickedTask=function(theGrid,rowIndex,e){var fips=store.getAt(rowIndex).get('Code');CUR.WebServiceAccess.prototype.getVillage(fips,CUR.MapPage.villageResponseNoZoom,CUR.MapPage.responseError);CUR.MapPage.updateHighlightImage(true,fips);var ddlVillages=document.getElementById('ddlVillages');for(var i=0;i<ddlVillages.length;i++){if(ddlVillages[i].value==fips){ddlVillages[i].selected=true;}}};var rowClicked=function(theGrid,rowIndex,e){rowClickDelayedTask.delay(200,rowClickedTask,this,[grid,rowIndex]);};var rowDblClicked=function(theGrid,rowIndex,e){rowClickDelayedTask.cancel();var fips=store.getAt(rowIndex).get('Code');CUR.WebServiceAccess.prototype.getVillage(fips,CUR.MapPage.villageResponse,CUR.MapPage.responseError);var ddlVillages=document.getElementById('ddlVillages');for(var i=0;i<ddlVillages.length;i++){if(ddlVillages[i].value==fips){ddlVillages[i].selected=true;}}};var onClose=function(window){var layer=CUR.MapPage.getLayer('mainLayer');var olLayerWmsIds;if(layer.params.LAYERS.length==0){olLayerWmsIds=[];}else{olLayerWmsIds=layer.params.LAYERS.split(',');}
for(i=olLayerWmsIds.length-1;i>=0;i--){for(j=0;j<allWmsIds.length;j++){if(olLayerWmsIds[i]==allWmsIds[j]){olLayerWmsIds.splice(i,1);}}}
if(olLayerWmsIds.length==0){layer.setVisibility(false);}
layer.mergeNewParams({LAYERS:olLayerWmsIds.join()});};var onShow=function(window){var ddl=Ext.get('ddlRegView');if(ddl!=null){var layerName=ddl.dom.value;;if(layerName!=''){var layer=CUR.MapPage.getLayer('mainLayer');var olLayerWmsIds;if(layer.params.LAYERS.length==0){olLayerWmsIds=[];}else{olLayerWmsIds=layer.params.LAYERS.split(',');}
var i,j;for(i=olLayerWmsIds.length-1;i>=0;i--){for(j=0;j<allWmsIds.length;j++){if(olLayerWmsIds[i]==allWmsIds[j]){olLayerWmsIds.splice(i,1);}}}
var newWmsIds=olLayerWmsIds.concat(olGroups[layerName].WmsIds);newWmsIds=newWmsIds.unique(true);newWmsIds.sortNum();layer.setVisibility(true);layer.mergeNewParams({LAYERS:newWmsIds.join()});}}};var head=new Ext.Panel({region:'north',height:95,autoLoad:{url:'service.svc/Layer/RegionalViews',scripts:false},renderer:{render:createPanelItems},bodyStyle:'padding:4px 4px 0 6px;'});var foot=new Ext.Panel({region:'south',height:50,bodyStyle:'padding:0px 4px 0 10px;'});return new Ext.Window({title:'Regional Views',layout:'border',width:370,height:400,collapsible:true,resizable:false,closeAction:'hide',x:Ext.getBody().getWidth()-377,y:4,baseCls:'ext-wincompare',items:[head,grid,foot],listeners:{beforeclose:{fn:onClose},beforehide:{fn:onClose},show:{fn:onShow}},selectVillage:function(fips){var records=store.query('Code',fips);grid.getSelectionModel().selectRecords(records.items);},getActiveRegionalView:function(){var ddlRegView=Ext.get('ddlRegView');return ddlRegView.dom.options[ddlRegView.dom.selectedIndex].value;}});};﻿
Ext.ux.RegistrationWindow=function(){var submitResponse=function(form,action){var sdfsdfsd='asdas';if(typeof action.response!='undefined'){var response=Ext.decode(action.response.responseText);if(response.added===1){var cp=new Ext.state.CookieProvider({expires:new Date(new Date().getTime()+(1000*60*60*24*365))});cp.set("registered",true);regWindow.close();}}};var formPanel=new Ext.form.FormPanel({id:'registrationForm',title:'We’d like to know who’s using the site during this beta phase so we can follow up about any feedback you might have.  We won’t use your information below for any other purpose.  Thanks for helping us test the site!',width:435,defaults:{width:250,msgTarget:'side'},defaultType:'textfield',labelWidth:120,labelAlign:'right',cls:'registration-form',items:[{fieldLabel:'Your Name',name:'name',allowBlank:false,listeners:{render:{fn:function(tField){tField.focus();}}}},{fieldLabel:'Your Organization',name:'organization',allowBlank:false},{fieldLabel:'Your Email',name:'email',vtype:'email',allowBlank:false}],buttons:[{text:'Submit',handler:function(btn,e){Ext.getCmp('registrationForm').getForm().submit({url:'User.ashx',method:'POST',success:submitResponse,failure:submitResponse});}}]});var regWindow=new Ext.Window({renderTo:document.body,layout:'form',title:'Long Island Index Maps: beta version',resizable:false,closable:false,width:450,modal:true,baseCls:'ext-wincompare',items:[formPanel]});return regWindow;};﻿var CUR=window.CUR||{};CUR.tabsPopup=function(config){var tabPanel;var downtownTemplate='<h3>For 2009 data, click the Downtown tab to the left of the map.</h3><p>The <b>{0}</b> downtown was surveyed by the Rauch Foundation in fall 2006, 2007, and 2008'+' as part of a field survey of selected communities (selected based on a cross-section of age, income, diversity, and daytime population characteristics,'+' as well as representative locations across both counties.  See the <a href="http://www.longislandindex.org/2008_report_key_findings.html" target=_blank>LI Index website</a> [<i>opens in new window</i>] for more information.)'+'<b> According to the survey, {1}\'s downtown size is {2}</b>'+'</p>'+'The survey also noted the following characteristics:'+'<h4>Cultural & Night Life</h4>'+'Cultural places: {3} in 2007; {4} in 2008'+'<br />Night spots: {5} in 2007; not surveyed in 2008'+'<h4>Commerce</h4>'+'Retail/Service orientation:<ul>'+'<li>2007: {6}</li>'+'<li>2008: {7}</li>'+'</ul>'+'Total storefronts: {8} in 2007; {9} in 2008'+'<br />Percent eateries: {10} in 2007; {11} in 2008'+'<h4>Vacancies (% of downtown business storefronts not occupied at time of survey)</h4>'+'Vacancy rate:<ul>'+'<li>2006: {12}%</li>'+'<li>2007: {13}%</li>'+'<li>2008: {14}%</li>'+'</ul>'+'Vacancy rate change 2006 to 2008: {15}%'+'<h4>Surrounding area</h4>'+'Multi-family housing: {16} in 2007; {17} in 2008'+'<br />Tallest building (# of stories): {18} in 2007; {19} in 2008'+'<br />Open space?: {20}'+'<br /><br /><div class="notes">Notes:'+'<ul><li>Cultural places include museums, theaters, libraries and other arts-associated storefronts.</li>'+'<li>Night spots include clubs, theatres, and bars.</li>'+'<li>Multi-family housing includes apartments, townhouses, and other multi-family options.</li>'+'<li>Open space includes parks, open areas, and playgrounds.</li></ul></div>';var setVELocation=function(xy){if(typeof tabPanel.items.get(0).items.get(0).el.dom.contentWindow.setLocation!='undefined'){var lonlat=CUR.convertSPToLL(xy.lon,xy.lat);tabPanel.items.get(0).items.get(0).el.dom.contentWindow.setLocation(lonlat);}else{var afunc=function(xy){this.setVELocation(xy);};afunc.defer(500,tabPanel,[xy]);}};var tabChanged=function(tabs,tab){if(tab.id==='tabDetail'){if(!tab.items.items[0].rendered){tab.doLayout();}
setVELocation(tabPanel.splonlat);}else if(tab.id==='tabDowntown'){tab.getUpdater().update('service.svc/Downtown/'+tabPanel.fips);}else if(tab.id==='tabLocation'){var mapBbox=this.map.getExtent().toBBOX();var mapSize=this.map.size;tab.getUpdater().update('service.svc/Identify?layers='+CUR.MapPage.getRestIdsToIdentify()+'&x='+tabPanel.splonlat.lon+'&y='+tabPanel.splonlat.lat+'&bbox='+mapBbox+'&width='+mapSize.w+'&height='+mapSize.h);}};var updateLocation=function(){var tab=tabPanel.getActiveTab();if(tab===null){tabPanel.setActiveTab('tabDetail');return;}
if(tab.id==='tabDetail'){setVELocation(tabPanel.splonlat);}else if(tab.id==='tabDowntown'){tab.getUpdater().update('service.svc/Downtown/'+tabPanel.fips);}else if(tab.id==='tabLocation'){var mapBbox=this.map.getExtent().toBBOX();var mapSize=this.map.size;tab.getUpdater().update('service.svc/Identify?layers='+CUR.MapPage.getRestIdsToIdentify()+'&x='+tabPanel.splonlat.lon+'&y='+tabPanel.splonlat.lat+'&bbox='+mapBbox+'&width='+mapSize.w+'&height='+mapSize.h);}};var renderDowntown=function(el,response,updater,callback){var downtown=null;var info;if(response.responseText!==''){downtown=Ext.decode(response.responseText);}
el.update();if(downtown!==null){info=String.format(downtownTemplate,downtown.Name,downtown.Name,downtown.Survey2007.Size,downtown.Survey2007.CulturalPlaces,downtown.Survey2008.CulturalPlaces,downtown.Survey2007.NightSpots,downtown.Survey2007.Orientation,downtown.Survey2008.Orientation,downtown.Survey2007.TotalStorefronts,downtown.Survey2008.TotalStorefronts,downtown.Survey2007.PercentEateries,downtown.Survey2008.PercentEateries,downtown.VacancyRate2006,downtown.Survey2007.VacancyRate,downtown.Survey2008.VacancyRate,Math.round((downtown.Survey2008.VacancyRate-downtown.VacancyRate2006)*10)/10,downtown.Survey2007.Residential,downtown.Survey2008.Residential,downtown.Survey2007.TallestBuilding,downtown.Survey2008.TallestBuilding,downtown.Survey2008.OpenSpace);Ext.DomHelper.append(el,{tag:'div',html:info,'id':'downtown-info'});}else{Ext.DomHelper.append(el,{tag:'div',html:'<h3>For 2009 data, click the Downtown tab to the left of the map.</h3>No surveyed downtown for selected Village'});}};var renderLocation=function(el,response,updater,callback){var featureLists;if(response.responseText!==''){featureLists=Ext.decode(response.responseText);}
el.update();if(featureLists.length>0){Ext.DomHelper.append(el,{tag:'p',html:'You clicked on:','class':'header'});var panels=Ext.getCmp('tabLocation').identifyTemplates;for(var i=0,len=panels.length;i<len;i++){panels[i].updateData(featureLists,el);}}else{Ext.DomHelper.append(el,{tag:'div',html:'Please try again – you’ll need to click on a school, pre-K location, or brownfield or other environmental site to display information about these sites.  Remember, you can ‘right-click’ on the marker to remove it from the map if you want to try again.'});}};tabPanel=new Ext.TabPanel({id:'tabsPopup',title:'',collapsible:false,width:300,height:150,renderTo:config.renderTo,deferredRender:false,floating:true,shadow:false,border:false,plain:true,x:10,y:12,style:'overflow: auto; position: absolute;',items:[{id:'tabDetail',title:'2008-09 Aerial View',items:[new Ext.BoxComponent({autoEl:{tag:'iframe',id:'ifrDetailed',src:'birdseyeview.aspx',width:'100%',height:'100%',frameborder:'0px',style:'border:solid 0px #ffffff; width:100%; height 100%;'}})]},{id:'tabDowntown',title:'Downtown',iconCls:'downtown-tab',autoScroll:true,autoLoad:true,renderer:{render:renderDowntown}},{id:'tabLocation',title:'Location Info',autoScroll:true,autoLoad:true,cls:'location-info',renderer:{render:renderLocation},identifyTemplates:[CUR.SchoolTemplate(),CUR.PreKTemplate(),CUR.BrownfieldTemplate()]}],listeners:{tabchange:{fn:tabChanged},render:{fn:function(tabpanel){tabpanel.doLayout();tabpanel.items.get(0).body.mask();tabpanel.items.get(0).body.on('dblclick',function(e,el,o){this.items.get(0).items.get(0).el.dom.contentWindow.toggleZoom();},this);}}},fips:null,splonlat:null,mapXY:null,map:config.map,updateLocation:updateLocation,setVELocation:setVELocation});return tabPanel;};Ext.ux.IdentifyTemplate=function(config){this.featureType=null;Ext.ux.IdentifyTemplate.superclass.constructor.apply(this,arguments);};Ext.extend(Ext.ux.IdentifyTemplate,Ext.Template,{updateData:function(featureLists,el){},extractMyFeaturesByType:function(featuresLists){for(var i=0,len=featuresLists.length;i<len;i++){if(featuresLists[i][0].__type.indexOf(this.featureType)>-1){return featuresLists[i];}}
return null;}});CUR.SchoolTemplate=function(){var template;template=new Ext.ux.IdentifyTemplate('<div class="location-icon icon-singleline {IconClass}"><span class="item-header">{Name}</span> (<a href="{ReportCard}" target="reportcardWin">download NYS report card</a>)</div>');template.featureType='School';template.updateData=function(featuresl,el){var features=this.extractMyFeaturesByType(featuresl);if(features!==null){for(var i=0,len=features.length;i<len;i++){this.append(el,{Name:features[i].Name,ReportCard:features[i].ReportCard,IconClass:features[i].IconClass});}}};return template;};CUR.PreKTemplate=function(){var template;template=new Ext.ux.IdentifyTemplate('<div class="location-icon icon-multiline {IconClass}"><span class="item-header">{Name}</span>'+'<ul><li>{Address}, {City} {ZipCode}</li>'+'<li>(In {SchoolDistrict} School District. Pre-K enrollment: {Enrollment}. Data current for 2008.)</li></ul></div>');template.featureType='PreK';template.updateData=function(featuresl,el){var features=this.extractMyFeaturesByType(featuresl);if(features!==null){for(var i=0,len=features.length;i<len;i++){this.append(el,{Name:features[i].Name,Address:features[i].Address,City:features[i].City,ZipCode:features[i].ZipCode,SchoolDistrict:features[i].SchoolDistrict,Enrollment:features[i].Enrollment,IconClass:features[i].IconClass});}}};return template;};CUR.BrownfieldTemplate=function(){var template;template=new Ext.ux.IdentifyTemplate('<div class="location-icon icon-multiline {IconClass}"><span class="item-header">{Name}</span>'+'<ul><li>{Program} Site, ID# {SiteId}</li>'+'<li>{Address}, {Community} {ZipCode}</li>'+'<li>Funding available for cleanup: ${Funding}</li>'+'<li><a href="http://www.longislandindex.org/brownfields.0.html" target="_blank">Click here</a> for more info.</li></ul></div>');template.featureType='Brownfield';template.updateData=function(featuresl,el){var features=this.extractMyFeaturesByType(featuresl);if(features!==null){for(var i=0,len=features.length;i<len;i++){this.append(el,{Name:features[i].Name,Program:features[i].Program,SiteId:features[i].SiteId,Address:features[i].Address,Community:features[i].Community,ZipCode:features[i].ZipCode,Funding:features[i].Funding.addCommas(),IconClass:features[i].IconClass});}}};return template;};﻿
Ext.ux.TabsWest=function(config){var _selectedInfoFactory=new CUR.SelectedInfoFactory();var renderLandUseTab=function(el,response,updater,callback){var category=Ext.decode(response.responseText);var layers=category.Layers;var panel=Ext.getCmp('tabLandUse');el.update();panel.compareText=category.CompareText;var ov=new Ext.ux.LayerCategoryOverview({style:'padding-bottom:5px;'});panel.add(ov);var checked=CUR.MapPage.getLayer('lotLayer').getVisibility();panel.add(new Ext.form.Checkbox({id:'chkLandUse',boxLabel:'Land use map','checked':checked,listeners:{check:{fn:function(chkBox,checked){CUR.MapPage.toggleLotLayer(checked);}},render:{fn:function(obj,layout){obj.wrap.applyStyles((Ext.isIE?'styleFloat':'cssFloat')+':left;padding:0 15px 2px 8px;');}}}}));panel.add(new Ext.ux.TransparencySlider({active:true,olLayer:CUR.MapPage.getLayer('lotLayer')}));panel.add({xtype:'landusepie',landUseType:'lots',headerText:'Number of Parcels'});panel.add({xtype:'landusepie',landUseType:'area',headerText:'Area of Parcels'});Ext.DomHelper.append(el,{tag:'div','class':'datasource',html:category.Source,style:'clear:both;padding-top:20px;'});panel.doLayout();ov.setSelectedFeature(null);CUR.MapPage.setLandUseTab(CUR.MapPage.getSelectedVillage());};var renderDemographicTab=function(panel,response,compareable,categoryOverview){var category=Ext.decode(response.responseText);var layers=category.Layers;panel.compareText=category.CompareText;panel.add(categoryOverview);panel.allWmsIds=[];for(var i=0;i<layers.length;i++){panel.allWmsIds=panel.allWmsIds.concat(layers[i].OpenLayersGroups[0].WmsIds);panel.add(new Ext.ux.DemographicLayer({layer:layers[i],isCompareable:compareable,featureInfo:_selectedInfoFactory.info[layers[i].Name]}));}
Ext.DomHelper.append(panel.body,{tag:'div','class':'datasource',html:category.Source,style:'margin-top:30px;'});panel.doLayout();if(typeof panel.activePanel!=='undefined'){for(var i=1,len=panel.items.items.length;i<len;i++){if(panel.items.items[i].layer.Name==panel.activePanel){panel.items.items[i].expand();break;}}}else{panel.items.items[1].expand();}};var renderPop=function(el,response,updater,callback){var panel=Ext.getCmp('tabPopulation');el.update();renderDemographicTab(panel,response,true,new Ext.ux.LayerCategoryOverview({defaultTitle:'Long Island population (2000)',defaultExplanation:'Select from the "Zoom To Village" list to see detailed information about a specific community.',titleTemplate:_selectedInfoFactory.info['PopulationTitle'],infoTemplate:_selectedInfoFactory.info['Population'],explanationTemplate:_selectedInfoFactory.info['PopulationDescription'],explanationHelpText:'Census block groups generally contain between 600 and 3,000 people.  Block groups are smaller than Census tracts, and are the smallest unit of geography for which the Census Bureau provides detailed population data.',linkTemplate:_selectedInfoFactory.info['PopulationLink']}));CUR.MapPage.setPopulationTab(CUR.MapPage.getSelectedVillage());};var renderHousing=function(el,response,updater,callback){var panel=Ext.getCmp('tabHousing');el.update();renderDemographicTab(panel,response,true,new Ext.ux.LayerCategoryOverview({defaultTitle:'Long Island housing profile (2000)',defaultExplanation:'Select from the "Zoom To Village" list to see detailed information about a specific community.',titleTemplate:_selectedInfoFactory.info['HousingTitle'],infoTemplate:_selectedInfoFactory.info['Housing'],explanationTemplate:_selectedInfoFactory.info['HousingDescription'],explanationHelpText:'Census block groups generally contain between 600 and 3,000 people.  Block groups are smaller than Census tracts, and are the smallest unit of geography for which the Census Bureau provides detailed population data.',linkTemplate:_selectedInfoFactory.info['HousingLink']}));CUR.MapPage.setPopulationTab(CUR.MapPage.getSelectedVillage());};var renderEducation=function(el,response,updater,callback){var panel=Ext.getCmp('tabEducation');el.update();renderDemographicTab(panel,response,false,new Ext.ux.EducationCategoryOverview({defaultTitle:'Long Island education profile',defaultExplanation:'Select from the "Zoom to School District" list above to see detailed information about local school districts.',titleTemplate:_selectedInfoFactory.info['EducationTitle'],infoTemplate:_selectedInfoFactory.info['Education'],explanationTemplate:_selectedInfoFactory.info['EducationDescription'],explanationHelpText:'The maps display patterns by elementary school district. In Nassau County, there are three high school districts that overlay the elementary districts. For these 3 districts, you’ll need to view the underlying elementary school district data.',linkTemplate:_selectedInfoFactory.info['EducationLink']}));CUR.MapPage.setEducationTab(CUR.MapPage.getSelectedSchoolDistrict());};var renderDowntown=function(el,response,updater,callback){el.update();var panel=Ext.getCmp('tabRpaDowntown');var category=Ext.decode(response.responseText);var layers=category.Layers;var checked;var isQueryString=(typeof OpenLayers.Util.getParameters()['mainlayers']!=='undefined');for(var i=0,len=layers.length;i<len;i++){if(isQueryString){checked=CUR.MapPage.checkIfUiLayerVisibleBasedOnWmsVis(layers[i].OpenLayersGroups,CUR.MapPage.getLayer('mainLayer').params.LAYERS.split(','));}else{checked=true;CUR.MapPage.changeOlLayerWmsIds(layers[i].OpenLayersGroups,checked);}
if(layers[i].Legend[0].Symbol==""){label=layers[i].Legend[0].Label;}else{label=layers[i].Legend[0].Label+'<br/><img src="'+layers[i].Legend[0].Symbol+'" style="vertical-align:text-bottom;padding-left:15px;" /> ';}
panel.add(new Ext.form.Checkbox({boxLabel:label,'checked':checked,uiLayer:layers[i],listeners:{check:{fn:function(chkBox,checked){CUR.MapPage.changeOlLayerWmsIds(this.uiLayer.OpenLayersGroups,checked);}}}}));}
Ext.DomHelper.append(panel.body,{tag:'div','class':'line-separator'});var selectedInfo=Ext.DomHelper.append(panel.body,{tag:'div'},true);panel.setSelectedFeature=function(feature){selectedInfo.update();if(feature!==null&&feature['RpaDowntown']){CUR.Templates.getTemplate('identifytemplates/rpadowntown.htm',function(tpl){tpl.overwrite(selectedInfo,{VillageName:feature.Name,DowntownName:feature.RpaDowntown.Name,LandUseChart:CUR.LandUse.prototype.getChartUrl(feature.RpaDowntown,'area'),Population:feature.RpaDowntown.Population.addCommas(),Pct25to34:feature.RpaDowntown.Pct25to34,PctOver55:feature.RpaDowntown.PctOver55,HousingUnits:feature.RpaDowntown.HousingUnits.addCommas(),PctRenterUnits:feature.RpaDowntown.PctRenterUnits,SingleFamilyUnits:feature.RpaDowntown.SingleFamilyUnits.addCommas(),MultiFamilyUnits:feature.RpaDowntown.MultiFamilyUnits.addCommas(),Stores:feature.RpaDowntown.Stores.addCommas(),PctStoresVacant:feature.RpaDowntown.PctStoresVacant,Category:feature.RpaDowntown.Category,DevelopmentPotential:feature.RpaDowntown.DevelopmentPotential,SoftLand:feature.RpaDowntown.SoftLand,LirrStationName:feature.RpaDowntown.LirrStationName,LirrStationDistance:feature.RpaDowntown.LirrStationDistance,LirrCategory:feature.RpaDowntown.LirrCategory,LirrRiders:feature.RpaDowntown.LirrRiders.addCommas(),LandUseMix:feature.RpaDowntown.LandUseMix,StoreDisplay:(function(s){if(s==0){return'none';}})(feature.RpaDowntown.Stores),HasStationDisplay:(function(s){if(s==0){return'none';}})(feature.RpaDowntown.LirrStationDistance),NoStationDisplay:(function(s){if(s>0){return'none';}})(feature.RpaDowntown.LirrStationDistance)});});}};Ext.DomHelper.append(el,{tag:'div','class':'datasource',html:category.Source,style:'clear:both;padding-top:20px;'});panel.doLayout();Ext.DomHelper.insertFirst(panel.body,{tag:'p',style:'color:#555555;',html:'The Long Island Index 2010 report documents the potential for revitalizing key downtowns and station areas to address the region’s need for new jobs, housing, public spaces, and recreational facilities. Information for the more than 100 downtowns and station areas included in the report can be accessed by selecting a specific village on the map or from the drop down list.'+'<p>To see the potential development opportunities for all downtowns, see the Regional Views link in the Map Options menu above the map.<br/><img src="images/legend/downtown_all.png" /></p>'});CUR.MapPage.setRpaDowntownTab(CUR.MapPage.getSelectedVillage());};return new Ext.TabPanel({id:'tabsWest',title:'',border:false,plain:true,renderTo:'tabsWest',activeTab:0,enableTabScroll:true,items:[{id:'tabLandUse',title:'Land Use',style:'padding: 0px 2px 0px 6px;',autoScroll:true,autoLoad:{url:'service.svc/Layer/LandUse',scripts:false},renderer:{render:renderLandUseTab}},{id:'tabRpaDowntown',title:'Downtown',style:'padding: 0px 2px 0px 6px;',autoScroll:true,autoLoad:{url:'service.svc/Layer/Downtown',scripts:false},renderer:{render:renderDowntown}},{id:'tabPopulation',title:'Population',style:'padding: 0px 2px 0px 6px;',autoScroll:true,autoLoad:{url:'service.svc/Layer/Population',scripts:false},renderer:{render:renderPop}},{id:'tabHousing',title:'Housing',style:'padding: 0px 2px 0px 6px;',autoScroll:true,autoLoad:{url:'service.svc/Layer/Housing',scripts:false},renderer:{render:renderHousing}},{id:'tabEducation',title:'Education',style:'padding: 0px 2px 0px 6px;',autoScroll:true,autoLoad:{url:'service.svc/Layer/Education',scripts:false},renderer:{render:renderEducation}}],listeners:{beforetabchange:{fn:function(tabPanel,newTab,currentTab){if(currentTab!==null){if(currentTab.id=='tabPopulation'||currentTab.id=='tabHousing'||currentTab.id=='tabEducation'){if(typeof currentTab.allWmsIds!=='undefined'){var layer=CUR.MapPage.getLayer('populationLayer');var olLayerWmsIds;if(layer.params.LAYERS!==''){olLayerWmsIds=layer.params.LAYERS.split(',');}else{olLayerWmsIds=[];}
var i,j;for(i=olLayerWmsIds.length-1;i>=0;i--){for(j=0;j<currentTab.allWmsIds.length;j++){if(olLayerWmsIds[i]==currentTab.allWmsIds[j]){olLayerWmsIds.splice(i,1);}}}
if(olLayerWmsIds.length==0){layer.setVisibility(false);}
layer.mergeNewParams({LAYERS:olLayerWmsIds.join()});}}}}},tabChange:{fn:function(tabPanel,tab){CUR.MapPage.updateHighlightImage(false);var i;if(tab.id=='tabLandUse'){}else if(tab.id=='tabPopulation'){if(typeof tab.items!=='undefined'){for(i=0;i<tab.items.items.length;i++){if(tab.items.items[i].baseCls==='form-group'&&!tab.items.items[i].collapsed){tab.items.items[i].setVisible();return false;}}}}else if(tab.id=='tabHousing'){if(typeof tab.items!=='undefined'){for(i=0;i<tab.items.items.length;i++){if(tab.items.items[i].baseCls==='form-group'&&!tab.items.items[i].collapsed){tab.items.items[i].setVisible();return false;}}}}else if(tab.id=='tabEducation'){if(typeof tab.items!=='undefined'){for(i=0;i<tab.items.items.length;i++){if(tab.items.items[i].baseCls==='form-group'&&!tab.items.items[i].collapsed){tab.items.items[i].setVisible();return false;}}}}}}}});};Ext.ux.DemographicLayer=Ext.extend(Ext.Panel,{layer:null,isCompareable:false,slider:null,featureInfo:null,initComponent:function(){Ext.apply(this,{title:this.layer.Label,collapsed:true,collapsible:true,animCollapse:false,titleCollapse:true,hideCollapseTool:true,baseCls:'form-group',items:this.createItems()});Ext.ux.DemographicLayer.superclass.initComponent.apply(this,arguments);this.addListener({beforeexpand:{fn:this.handleExpand,scope:this}});},createItems:function(){var items=[];items.push(this.createSelectedInfo());items.push(this.createLegend());items.push(this.createLayerSlider());items.push(this.createCompareButton());return items;},createSelectedInfo:function(){this.selectedInfo=new Ext.form.Label({id:this.id+'Selected',text:'',cls:'selectedinfo'});return this.selectedInfo;},createLegend:function(){var legend='<div class="legend-title">'+this.layer.LegendHeader+'</div>';legend+='<ul class="legend">';for(j=0;j<this.layer.Legend.length;j++){legend+='<li><div style="background-color:'+this.layer.Legend[j].Color+';"></div><span>'+this.layer.Legend[j].Label+'</span></li>';}
legend+='</ul>'
var legendComp=new Ext.BoxComponent({id:this.id+'Legend',autoEl:{html:legend}});return legendComp;},createLayerSlider:function(){this.slider=new Ext.ux.TransparencySlider({olLayer:CUR.MapPage.getLayer('populationLayer')});return this.slider;},createCompareButton:function(){if(this.isCompareable){return new Ext.Button({id:this.id+'Compare',text:'Compare',style:'clear:both;margin-top:10px;',cls:'button-small',disabled:false,listeners:{click:this.onCompareClick,scope:this}});}else{return new Ext.Button({id:this.id+'Compare',text:'Compare',style:'clear:both;margin-top:-10px;visibility:hidden;'});}},onCompareClick:function(scope,btn,options){var compareStrategy=new CUR.PopulationCompare(CUR.MapPage.getSelectedVillage(),this.layer.Category,this.layer.Name,this.title,this.ownerCt.compareText);CUR.MapPage.openCompareWindow(compareStrategy,scope.id);},handleExpand:function(panel){var items=panel.ownerCt.items.items;for(var i=0,len=items.length;i<len;i++){if(items[i].baseCls=='form-group'){if(items[i]===panel){this.setVisible();panel.ownerCt.activePanel=this.layer.Name;}else{items[i].collapse();items[i].slider.active=false;}}}},setVisible:function(){var olLayer=CUR.MapPage.getLayer('populationLayer');this.cleanOlLayerLayerIds(olLayer,this.ownerCt.allWmsIds,this.layer.OpenLayersGroups[0].WmsIds);olLayer.setVisibility(true);olLayer.setOpacity(this.getOpacity());this.slider.active=true;},cleanOlLayerLayerIds:function(olLayer,idsToRemove,idsToAdd){var olLayerWmsIds;if(olLayer.params.LAYERS!==''){olLayerWmsIds=olLayer.params.LAYERS.split(',');}else{olLayerWmsIds=[];}
this.removeLayerIds(olLayerWmsIds,idsToRemove);this.addLayerIds(olLayerWmsIds,idsToAdd);olLayer.mergeNewParams({LAYERS:olLayerWmsIds.join()});},removeLayerIds:function(wmsIds,idsToRemove){var j,k;for(j=wmsIds.length-1;j>=0;j--){for(k=0;k<idsToRemove.length;k++){if(wmsIds[j]==idsToRemove[k]){wmsIds.splice(j,1);}}}},addLayerIds:function(wmsIds,idsToAdd){for(var i=0,len=idsToAdd.length;i<len;i++){wmsIds.push(idsToAdd[i]);}
wmsIds=wmsIds.unique(true);wmsIds.sortNum();},getOpacity:function(){return 1-(this.slider.slider.getValue()/100);},setSelectedInfo:function(text){},setSelectedFeature:function(feature){if(this.featureInfo!==null){if(feature!==null){this.featureInfo.updateTemplate(feature,this.selectedInfo.el);this.getComponent(this.id+'Compare').enable();}else{this.selectedInfo.text='';this.selectedInfo.el.update('');this.getComponent(this.id+'Compare').disable();}}}});Ext.reg('demographiclayer',Ext.ux.DemographicLayer);Ext.ux.LayerCategoryOverview=Ext.extend(Ext.BoxComponent,{autoEl:'div',cls:'population-overview',title:null,content:null,link:null,explanation:null,explanationText:null,explanationHelp:null,titleTemplate:null,infoTemplate:null,explanationTemplate:null,linkTemplate:null,defaultTitle:'',defaultExplanation:'',onRender:function(ct,position){Ext.ux.LayerCategoryOverview.superclass.onRender.call(this,ct,position);if(this.title==null){this.title=Ext.DomHelper.append(this.el,{tag:'h3','class':'title'});}
if(this.content==null){this.content=Ext.DomHelper.append(this.el,{tag:'span','class':'content'});}
if(this.link==null){this.link=Ext.DomHelper.append(this.el,{tag:'span','class':'content'});}
if(this.explanation==null){this.explanation=Ext.DomHelper.append(this.el,{tag:'span','class':'explanation'});}
if(this.explanationText==null){this.explanationText=Ext.DomHelper.append(this.explanation,{tag:'span'});}
if(this.explanationHelp==null){this.explanationHelp=Ext.DomHelper.append(this.explanation,{tag:'img',src:'images/help.gif',style:'margin-left:2px;vertical-align:top;'});Ext.QuickTips.register({target:this.explanationHelp,text:this.explanationHelpText});}},setTitle:function(text){this.title.innerHTML=text;},setExplanation:function(text){this.explanationText.innerHTML=text;if(text.indexOf('Select from')>-1){this.explanationHelp.style.display='none';}else{this.explanationHelp.style.display='inline';}},setSelectedFeature:function(feature){if(feature!==null){this.titleTemplate.updateTemplate(feature,this.title);this.infoTemplate.updateTemplate(feature,this.content);this.explanationTemplate.updateTemplate(feature,this.explanationText);this.explanationHelp.style.display='inline';this.linkTemplate.updateTemplate(feature,this.link);this.content.style.display='block';this.link.style.display='block';}else{this.title.innerHTML=this.defaultTitle;this.explanationText.innerHTML=this.defaultExplanation;this.explanationHelp.style.display='none';this.content.innerHTML=text='';this.content.style.display='none';this.link.innerHTML=text='';this.link.style.display='none';}}});Ext.reg('layercategoryoverview',Ext.ux.LayerCategoryOverview);Ext.ux.EducationCategoryOverview=Ext.extend(Ext.ux.LayerCategoryOverview,{schoolDistrictSelect:null,ddlSchoolDistricts:null,onRender:function(ct,position){Ext.ux.EducationCategoryOverview.superclass.onRender.call(this,ct,position);if(this.schoolDistrictSelect==null){Ext.DomHelper.insertFirst(this.el,{tag:'div','class':'line-separator'});this.schoolDistrictSelect=Ext.DomHelper.insertFirst(this.el,{tag:'div',id:'schoolDistrictSelect','class':'x-toolbar'},true);}
if(this.ddlSchoolDistricts==null){this.ddlSchoolDistricts=Ext.DomHelper.append(this.schoolDistrictSelect,{tag:'select',id:'ddlSchoolDistricts'},true);CUR.WebServiceAccess.prototype.getSchoolDistricts(this.populateDdlSchoolDistricts,null,this);this.ddlSchoolDistricts.on('change',this.districtSelectChanged,this);}},districtSelectChanged:function(e,ddl,options){if(ddl.value!==''){CUR.WebServiceAccess.prototype.getSchoolDistrict(ddl.value,CUR.MapPage.schoolDistrictResponse);}else{CUR.MapPage.clearSchoolDistrictSelection();}},populateDdlSchoolDistricts:function(response){var districts=Ext.decode(response.responseText);this.ddlSchoolDistricts.dom.options.add(new Option('Zoom to School District...',''));for(var i=0,len=districts.length;i<len;i++){this.ddlSchoolDistricts.dom.options.add(new Option(districts[i].Label,districts[i].Code));}}});Ext.reg('educationcategoryoverview',Ext.ux.EducationCategoryOverview);var CUR=window.CUR||{};CUR.Templates={map:{},getTemplate:function(url,callback){if(this.map[url]===undefined){Ext.Ajax.request({url:url,success:function(xhr){var text=xhr.responseText;var template=new Ext.Template(text.slice(text.indexOf('>',text.indexOf('<body'))+1,text.indexOf('</body>')));template.compile();this.map[url]=template;callback(template);},scope:this});}else{callback(this.map[url]);}}};CUR.SelectedInfo=function(template,templateMap,nullTemplate){this.template=new Ext.Template(template);this.templateMap=templateMap;this.nullTemplate;if(typeof nullTemplate!=='undefined'){this.nullTemplate=new Ext.Template(nullTemplate);}};CUR.SelectedInfo.prototype={updateTemplate:function(feature,element){if(this.useNullTemplate(feature)){this.nullTemplate.overwrite(element,this.templateMap(feature));}else{this.template.overwrite(element,this.templateMap(feature));}},getChange:function(change,year){var template='{0} {1}% since {2}';var nullValueTemplate='{0} data not available'
var changeDirection;if(change!==null){changeDirection=change>0?'increased':'decreased';return String.format(template,changeDirection,Math.abs(change),year);}else{return String.format(nullValueTemplate,year);}},useNullTemplate:function(feature){return false;},getEnrollmentChange:function(change,grade){if(change<0){return'lost '+Math.abs(change).addCommas()+' students in the '+grade+' grade level';}else if(change==0){return'had no change in '+grade+' grade enrollment';}else if(change>0){return'gained '+Math.abs(change).addCommas()+' students in the '+grade+' grade level';}}};CUR.SelectedInfoFactory=function(){this.info=[];this.info['PopulationTitle']=new CUR.SelectedInfo('{0} population (2000)',function(feature){return{0:feature.Label};});this.info['PopulationDescription']=new CUR.SelectedInfo('Click on the demographic characteristics below to map the population patterns in {0} and across Long Island. (Note that the maps display patterns by Census block group.)',function(feature){return{0:feature.Label};});this.info['Population']=new CUR.SelectedInfo('{0} people lived in {1} in 2000 ({2}).',function(feature){return{0:feature.Population.Population2000.Total.addCommas(),1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.TotalPercentChange,'1990')};});this.info['PopulationLink']=new CUR.SelectedInfo('See detailed <a href="http://factfinder.census.gov/servlet/QTTable?_bm=y&-context=qt&-qr_name=DEC_2000_SF1_U_DP1&-ds_name=DEC_2000_SF1_U&-CONTEXT=qt&-tree_id=4001&-all_geo_types=N&-redoLog=true&-_caller=geoselect&-geo_id=16000US36{0}&-search_results=16000US36{1}&-format=&-_lang=en" target="census">population</a>'+' statistics from the 2000 Census.&nbsp;&nbsp;<span class="explanation" style="display:inline;">[opens in new window]</span>',function(feature){return{0:feature.Code,1:feature.Code};});this.info['Density']=new CUR.SelectedInfo('{0} people per square mile ({1})',function(feature){return{0:feature.Population.Population2000.Density.addCommas(),1:this.getChange(feature.Population.Change1990To2000.DensityPercentChange,'1990')};});this.info['LowIncHH']=new CUR.SelectedInfo('{0}% of {1}\'s households ({2} of them) had incomes under $40,000 in 1999 ({3}). NOTE: Does not account for inflation.',function(feature){return{0:feature.Population.Population2000.PercentLowIncomeHouseholds,1:feature.Label,2:feature.Population.Population2000.LowIncomeHouseholds.addCommas(),3:this.getChange(feature.Population.Change1990To2000.LowIncomeHouseholdsPercentChange,'1989')};});this.info['HighIncHH']=new CUR.SelectedInfo('{0}% of {1}\'s households ({2} of them) had incomes above $100,000 in 1999 ({3}). NOTE: Does not account for inflation.',function(feature){return{0:feature.Population.Population2000.PercentHighIncomeHouseholds,1:feature.Label,2:feature.Population.Population2000.HighIncomeHouseholds.addCommas(),3:this.getChange(feature.Population.Change1990To2000.HighIncomeHouseholdsPercentChange,'1989')};});this.info['NonWhitePct']=new CUR.SelectedInfo('{0} is {1}% non-white (Black, Hispanic, Asian, or multiple races) ({2})',function(feature){return{0:feature.Label,1:feature.Population.Population2000.PercentNonWhite,2:this.getChange(feature.Population.Change1990To2000.NonWhitePercentChange,'1990')};});this.info['Age1834Pct']=new CUR.SelectedInfo('{0}% of {1}\'s residents were between 18 and 34 years old in 2000 ({2})',function(feature){return{0:feature.Population.Population2000.PercentAge18To34,1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.Age18To34PercentChange,'1990')};});this.info['Age617Pct']=new CUR.SelectedInfo('{0}% of {1}\'s residents were between 6 and 17 years old in 2000 ({2})',function(feature){return{0:feature.Population.Population2000.PercentAge6To17,1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.Age6To17PercentChange,'1990')};});this.info['Age05Pct']=new CUR.SelectedInfo('{0}% of {1}\'s residents were 5 years old or younger in 2000 ({2})',function(feature){return{0:feature.Population.Population2000.PercentAge0To5,1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.Age0To5PercentChange,'1990')};});this.info['Age3554Pct']=new CUR.SelectedInfo('{0}% of {1}\'s residents were between 35 and 54 years old in 2000 ({2})',function(feature){return{0:feature.Population.Population2000.PercentAge35To54,1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.Age35To54PercentChange,'1990')};});this.info['Age55PlusPct']=new CUR.SelectedInfo('{0}% of {1}\'s residents were 55 years or older in 2000 ({2})',function(feature){return{0:feature.Population.Population2000.PercentAge55Plus,1:feature.Label,2:this.getChange(feature.Population.Change1990To2000.Age55PlusPercentChange,'1990')};});this.info['HousingTitle']=new CUR.SelectedInfo('{0} housing profile (2000)',function(feature){return{0:feature.Label};});this.info['HousingDescription']=new CUR.SelectedInfo('Click on the links below to map the housing patterns in {0} and across Long Island. (Note that the maps display patterns by Census block group.)',function(feature){return{0:feature.Label};});this.info['Housing']=new CUR.SelectedInfo('{0} housing units were located in {1} in 2000 ({2}). Of these, {3}% were occupied ({4}).',function(feature){var occ1990Text;if(feature.Housing.Housing1990.Occupied===null){occ1990Text='1990 data not available';}else{occ1990Text='in 1990, '+feature.Housing.Housing1990.PercentOccupied+'% of the housing units were occupied'}
return{0:feature.Housing.Housing2000.Total.addCommas(),1:feature.Label,2:this.getChange(feature.Housing.Change1990To2000.TotalPercentChange,'1990'),3:feature.Housing.Housing2000.PercentOccupied,4:occ1990Text};});this.info['HousingLink']=new CUR.SelectedInfo('See detailed <a href="http://factfinder.census.gov/servlet/QTTable?_bm=y&-context=qt&-qr_name=DEC_2000_SF3_U_DP4&-ds_name=DEC_2000_SF3_U&-CONTEXT=qt&-tree_id=4001&-all_geo_types=N&-redoLog=true&-geo_id=16000US36{0}&-search_results=16000US36{1}&-format=&-_lang=en" target="census">housing</a>'+' statistics from the 2000 Census.&nbsp;&nbsp;<span class="explanation" style="display:inline;">[opens in new window]</span>',function(feature){return{0:feature.Code,1:feature.Code};});this.info['MultiFamily']=new CUR.SelectedInfo('{0}% of {1}\'s housing units ({2} of them) were in buildings with 5 units or more in 2000 ({3}).',function(feature){return{0:feature.Housing.Housing2000.PercentMultiFamily,1:feature.Label,2:feature.Housing.Housing2000.MultiFamily.addCommas(),3:this.getChange(feature.Housing.Change1990To2000.MultiFamilyPercentChange,'1990')};});this.info['BltSince80']=new CUR.SelectedInfo('{0}% of {1}\'s housing units ({2} of them) have been built since 1980.',function(feature){return{0:feature.Housing.Housing2000.PercentBuiltSince1980,1:feature.Label,2:feature.Housing.Housing2000.BuiltSince1980.addCommas()};});this.info['Affordability']=new CUR.SelectedInfo('{0}% of {1}\'s households ({2} of them) spent more than 35% of their income on housing costs in 2000 ({3}).',function(feature){return{0:feature.Housing.Housing2000.PercentLowAffordability,1:feature.Label,2:feature.Housing.Housing2000.LowAffordability.addCommas(),3:this.getChange(feature.Housing.Change1990To2000.LowAffordabilityPercentChange,'1990')};});this.info['Rentals']=new CUR.SelectedInfo('{0}% of {1}\'s households ({2} of them) are renter occupied ({3}).',function(feature){return{0:feature.Housing.Housing2000.PercentRenterOccupied,1:feature.Label,2:feature.Housing.Housing2000.RenterOccupied.addCommas(),3:this.getChange(feature.Housing.Change1990To2000.RenterOccupiedPercentChange,'1990')};});this.info['EducationTitle']=new CUR.SelectedInfo('{0} education profile',function(feature){return{0:feature.Label};});this.info['EducationDescription']=new CUR.SelectedInfo('Click on the links below to map school district patterns.',function(feature){return{};});this.info['Education']=new CUR.SelectedInfo('In 2006, this district served {0} students. It had ${1} of expenses per student. Local property taxes including commercial taxes represent {2}% of the district\'s total revenue. The balance comes from state and federal sources. Additional analyses of finances, local resources, and early childhood programs are highlighted below.',function(feature){if(this.useNullTemplate(feature)){return{0:feature.Students.addCommas()};}else{return{0:feature.Students.addCommas(),1:feature.ExpensesPerStudent.addCommas(),2:feature.PercentLocalRevenueOfTotalRevenue};}},'In 2006, this district served {0} students. District-specific income and expenditures are not available. Additional analysis of finances, local resources, and obstacles are highlighted below.');this.info['Education'].useNullTemplate=function(feature){if(feature.IncomePerStudent===null){return true;}else{return false}};this.info['EducationLink']=new CUR.SelectedInfo('See <a href="https://www.nystart.gov/publicweb/District.do?year=2007&county={0}&district={1}0000" target="_blank">detailed district statistics</a> from the 2006-2007 New York State report card. <span class="explanation" style="display:inline;">[opens in new window]</span>',function(feature){return{0:feature.County,1:feature.Code};});this.info['SizeStudents']=new CUR.SelectedInfo('{0} students attended schools in {1} in 2006. (NB: only includes pre_K - 12th grade.)',function(feature){return{0:feature.Students.addCommas(),1:feature.Label};});this.info['SizeArea']=new CUR.SelectedInfo('{0} covers {1} square miles.',function(feature){return{0:feature.Label,1:feature.Area.addCommas()};});this.info['Obstacle']=new CUR.SelectedInfo('{0} has an "obstacle level" of {1} (1 indicates the lowest obstacle level, 5 is the highest). "Obstacles" refer to challenges to local education such as high poverty, a concentration of students with Limited English Proficiency (LEP), and a high degree of racial segregation.'+'<br/>Districts with an obstacle level of {2} had an average of {3}% students receiving free lunch (an indicator of poverty), {4}% of students with Limited English Proficiency, and a {5}% black and Latino population.',function(feature){return{0:feature.Label,1:feature.ObstacleLevel.Level,2:feature.ObstacleLevel.Level,3:feature.ObstacleLevel.PercentFreeLunch,4:feature.ObstacleLevel.LearningEnglishProfficiency,5:feature.ObstacleLevel.SegregationRate};});this.info['Affluence']=new CUR.SelectedInfo('{0} has an "affluence level" of {1} (1 indicates the least affluent, 5 is the most). Affluence is based on state and local aid as well as district-wide income and wealth on a per student basis.'+'<br/><br/>Districts with an affluence level of {2} had an average of:'+'<ul style="list-style: disc; padding-left: 17px;"><li>{3}% of the district\'s total revenue from state aid;</li>'+'<li>{4}% of the district\'s total revenue from local revenue sources;</li>'+'<li>${5} in expenses per student;</li>'+'<li>${6} in revenue per student;</li>'+'<li>${7} in district-wide income per student; and</li>'+'<li>${8} in district-wide wealth per student.</li></ul>',function(feature){if(this.useNullTemplate(feature)){return{0:feature.Label};}else{return{0:feature.Label,1:feature.AffluenceLevel.Level,2:feature.AffluenceLevel.Level,3:feature.AffluenceLevel.PercentStateAidOfTotalRevenue,4:feature.AffluenceLevel.PercentLocalRevenueOfTotalRevenue,5:feature.AffluenceLevel.ExpensesPerStudent.addCommas(),6:feature.AffluenceLevel.RevenuePerStudent.addCommas(),7:feature.AffluenceLevel.IncomePerStudent.addCommas(),8:feature.AffluenceLevel.WealthPerStudent.addCommas()};}},'District-specific data is not available for {0}.');this.info['Affluence'].useNullTemplate=function(feature){if(feature.AffluenceLevel.PercentStateAidOfTotalRevenue===null){return true;}else{return false}};this.info['ObsAffCombo']=new CUR.SelectedInfo('{0} has a combined "obstacle + affluence level" of {1}(1 indicates the district has some of the greatest obstacles but is among the least affluent, 5 means it’s among the districts with the least obstacles but highest affluence) based on the 2009 Long Island Index report analyzing English and Math testing outcomes, advanced Regents diplomas, and college readiness.'+'<br/>Districts with a combined obstacle + affluence level of {2} had an average of:'+'<ul style="list-style: disc; padding-left: 17px;"><li>{3}% of the district\'s students passing 4th grade English;</li>'+'<li>{4}% of the district\'s students passing 4th grade Math;</li>'+'<li>{5}% of the district\'s students passing 8th grade English;</li>'+'<li>{6}% of the district\'s students passing 8th grade Math;</li>'+'<li>{7}% of the district\'s students passing the English Regents test;</li>'+'<li>{8}% of the district\'s students passing the Math Regents test;</li>'+'<li>{9}% of the district\'s students receiving an advanced Regents diploma; and</li>'+'<li>{10}% of the district\'s students achieving college readiness.</li></ul>',function(feature){return{0:feature.Label,1:feature.CombinedLevel.Level,2:feature.CombinedLevel.Level,3:feature.CombinedLevel.PercentPassStandEng4,4:feature.CombinedLevel.PercentPassStandMath4,5:feature.CombinedLevel.PercentPassStandEng8,6:feature.CombinedLevel.PercentPassStandMath8,7:feature.CombinedLevel.PercentPassRegentsEng,8:feature.CombinedLevel.PercentPassRegentsMath,9:feature.CombinedLevel.PercentAdvancedRegentsDiploma,10:feature.CombinedLevel.PercentCollegeReadiness};});this.info['CommTax']=new CUR.SelectedInfo('In {0}, the district\'s commercial and industrial tax revenue per student in 2005 was ${1}.',function(feature){return{0:feature.Label,1:feature.CommercialTaxesPerStudent.addCommas()};});this.info['TaxLevyIncrease']=new CUR.SelectedInfo('One measure of the disparity among Long Island\'s school districts is the capacity of the local tax base to support education. For example, in {0}, taxes on a $450,000 home would have to increase by ${1} in order to increase revenues by $250/Student.'+'<br />For more information see the <a href="http://www.longislandindex.org/fileadmin/pdf/2009_Index_Files/SpecialAnalysis.pdf" target="_blank" >Long Island Index 2009 Special Analysis</a>',function(feature){if(this.useNullTemplate(feature)){return{0:feature.Label};}else{return{0:feature.Label,1:feature.TaxLevyIncrease.addCommas()};}},'One measure of the disparity among Long Island\'s school districts is the capacity of the local tax base to support education. District-specific data is not available, however, for {0}.');this.info['TaxLevyIncrease'].useNullTemplate=function(feature){if(feature.TaxLevyIncrease===null){return true;}else{return false}};this.info['ChildCareCapacity']=new CUR.SelectedInfo('The following child care resources are located in the {0} (as of May 2008):'+'<ul style="list-style: disc; padding-left: 14px;"><li>{1} Family and Group Family Child Care programs with a total licensed capacity of {2}.</li>'+'<li>{3} Child Care Centers with a total licensed capacity of {4}.</li>'+'<li>{5} Pre-School programs with a total capacity of {6}.</li>'+'<li>{7} Informal and In-Home Exempt programs with a total licensed capacity of {8}.</li>'+'{9}'+'</ul>'+'For more info, contact the <a href="http://www.childcarenassau.org/" target="childCareWin">Nassau</a> or <a href="http://www.childcaresuffolk.org/" target="childCareWin">Suffolk</a> child care council.',function(feature){return{0:feature.Label,1:feature.FamilyPrograms.Count,2:feature.FamilyPrograms.LicensedCapacity.addCommas(),3:feature.ChildCareCenters.Count,4:feature.ChildCareCenters.LicensedCapacity.addCommas(),5:feature.PreSchoolPrograms.Count,6:feature.PreSchoolPrograms.LicensedCapacity.addCommas(),7:feature.ExemptPrograms.Count,8:feature.ExemptPrograms.LicensedCapacity,9:(function(){if(feature.PreKDescription){return'<li>'+feature.PreKDescription+'</li>';}})()};});this.info['EnrollChgK5']=new CUR.SelectedInfo('The {0} {1} between the 1996-97 and 2006-07 school years.',function(feature){return{0:feature.Label,1:this.getEnrollmentChange(feature.EnrollmentChange97To07.GradeKThru5,'Kindergarten-5th')};});this.info['EnrollChg68']=new CUR.SelectedInfo('The {0} {1} between the 1996-97 and 2006-07 school years.',function(feature){return{0:feature.Label,1:this.getEnrollmentChange(feature.EnrollmentChange97To07.Grade6Thru8,'6-8th')};});this.info['EnrollChg912']=new CUR.SelectedInfo('The {0} {1} between the 1996-97 and 2006-07 school years.',function(feature){return{0:feature.Label,1:this.getEnrollmentChange(feature.EnrollmentChange97To07.Grade9Thru12,'9-12th')};});};﻿Ext.ux.TransparencySlider=Ext.extend(Ext.BoxComponent,{label:null,slider:null,active:false,olLayer:null,initComponent:function(){Ext.ux.TransparencySlider.superclass.initComponent.call(this);},onRender:function(ct,position){if(!this.el){this.el=Ext.DomHelper.append(ct,{tag:'div','class':'transparencyslider',style:'width:125px;padding-bottom:15px;float:left;position:relative;'});this.el.id=this.getId();this.label=Ext.DomHelper.append(this.el,{tag:'div',id:this.el.id+'label',html:'0% Transparent',style:'color:#3e69a2;font-weight: normal; font-size: 1.0em;position: absolute;left: 0px;bottom:0px;'});this.slider=new Ext.Slider({renderTo:this.el,width:110,minValue:0,maxValue:100,increment:10,value:0,plugins:new Ext.ux.SliderTip(),style:'visibility:hidden;position: absolute;left:0px;top:-1px;',listeners:{change:this.setOpacity,scope:this}});var help=Ext.DomHelper.append(this.el,{tag:'img',src:'images/help.gif',style:'position: absolute;right:-14px;top:1px;'});Ext.QuickTips.register({target:help,text:'Drag the slider to the right or left to make this layer on the map more or less transparent.  As you slide it, the map features underneath will shine through.  Above the slider you\'ll see the level of transparency (from 0% to 100%).  Zero percent is completely opaque; 100% is completely transparent.',dismissDelay:0});Ext.get(this.el).on('mouseover',this.onMouseover,this);Ext.get(this.el).on('mouseout',this.onMouseout,this);}
Ext.ux.TransparencySlider.superclass.onRender.call(this,ct,position);},onMouseover:function(){this.slider.el.dom.style.visibility='visible';this.label.style.visibility='hidden';},onMouseout:function(e){if(!e.within(this.el,true)){this.slider.el.dom.style.visibility='hidden';this.label.style.visibility='visible';}},setOpacity:function(slider,newValue){this.label.innerHTML=newValue+'% Transparent';var opacity=1-(newValue/100);if(this.active){this.olLayer.setOpacity(opacity);}}});Ext.reg('transparencyslider',Ext.ux.TransparencySlider);Ext.ux.SliderTip=Ext.extend(Ext.Tip,{minWidth:10,offsets:[0,-10],init:function(slider){slider.on('dragstart',this.onSlide,this);slider.on('drag',this.onSlide,this);slider.on('dragend',this.hide,this);slider.on('destroy',this.destroy,this);},onSlide:function(slider){this.show();this.body.update(this.getText(slider));this.doAutoWidth();this.el.alignTo(slider.thumb,'b-t?',this.offsets);},getText:function(slider){return String.format('<b>{0}% transparent</b>',slider.getValue());}});﻿
Ext.ux.LayerWindow=function(){var _win;var _scale;var _scaleDependents=[];var _identifiable=[];var _olToggleAll=[];that=this;this.showWin=function(config){if(typeof(_win)=='undefined'){_scale=config.scale;this.buildCompareWindow(config);}
_win.show();}
this.buildCompareWindow=function(config){var defaultCfg={id:'layerList',title:'Transportation & Reference',bodyStyle:'padding: 8px;',constrainHeader:true,resizable:false,closeAction:'hide',baseCls:'ext-wincompare',width:345,height:500,autoScroll:true,autoLoad:{url:'service.svc/Layer/BaseMap'},renderer:{render:this.buildLayerList},items:[{}]}
_win=new Ext.Window(defaultCfg);}
this.buildLayerList=function(el,response,updater,callback){var category=Ext.decode(response.responseText);var layers=category.Layers;var subcategory;var subComponent;var label;var disabled;var visibleServiceLayers=CUR.MapPage.getLayer('mainLayer').params.LAYERS.split(',');var checked;el.update();for(var i=0,len=layers.length;i<len;i++){if(layers[i].Subcategory!==subcategory){subcategory=layers[i].Subcategory;if(Ext.isIE){subComponent=_win.add(new Ext.Component({autoEl:{tag:'div',html:'<span class="basemap-subcategorytext-ie6">'+subcategory+'</span>','class':'basemap-subcategory'}}));}else{subComponent=_win.add(new Ext.Component({autoEl:{tag:'div',html:'<span class="basemap-subcategorytext">'+subcategory+'</span>','class':'basemap-subcategory'}}));}}
if(layers[i].Legend[0].Symbol==""){label=layers[i].Legend[0].Label;}else{label='<img src="'+layers[i].Legend[0].Symbol+'" style="vertical-align:text-bottom" /> '+layers[i].Legend[0].Label;}
disabled=true;if(layers[i].Scale.Max>=_scale&&layers[i].Scale.Min<=_scale){disabled=false;}
checked=CUR.MapPage.checkIfUiLayerVisibleBasedOnWmsVis(layers[i].OpenLayersGroups,visibleServiceLayers);that.addTo_olToggleAll(layers[i].OpenLayersGroups);_scaleDependents.push(_win.add({xtype:'checkbox',boxLabel:label,'disabled':disabled,hideLabel:true,checked:checked,scale:{min:layers[i].Scale.Min,max:layers[i].Scale.Max},uiLayer:layers[i],listeners:{'check':{fn:function(i){return function(chkBox,checked){CUR.MapPage.changeOlLayerWmsIds(layers[i].OpenLayersGroups,checked);}}(i)}}}));if(layers[i].IsIdentifiable){_identifiable.push(_scaleDependents[_scaleDependents.length-1]);}}
_win.insert(0,{xtype:'checkbox',boxLabel:'Toggle all features',hideLabel:true,checked:true,listeners:{'check':{fn:function(chkBox,checked){CUR.MapPage.changeOlLayerWmsIds(_olToggleAll,checked);for(var i=0,len=_scaleDependents.length;i<len;i++){_scaleDependents[i].suspendEvents();_scaleDependents[i].setValue(checked);_scaleDependents[i].resumeEvents();}}}}});Ext.DomHelper.append(el,{tag:'div','class':'datasource',html:category.Source,style:'margin-top:30px;'});_win.doLayout();Ext.DomHelper.insertFirst(el,{tag:'div',html:'Check the boxes below to display the information on the map. If an item is grayed out, you need to zoom in closer on the map before you can check or uncheck the box.<br /><br />'});_win.center();}
this.addTo_olToggleAll=function(olGroup){var exists=false;for(var i=0,len=olGroup.length;i<len;i++){for(var j=0,len2=_olToggleAll.length;j<len2;j++){if(olGroup[i].Name===_olToggleAll[j].Name){exists=true;_olToggleAll[j].WmsIds=_olToggleAll[j].WmsIds.concat(olGroup[i].WmsIds);}}
if(!exists){_olToggleAll.push({'Name':olGroup[i].Name,'WmsIds':olGroup[i].WmsIds});}}}
this.mapScaleChanged=function(event){that.setEnabledAtScale(Math.round(event.object.getScale()));}
this.getRestIdsToIdentify=function(){var restIds=[];for(var i=0,len=_identifiable.length;i<len;i++){if(_identifiable[i].checked){restIds=restIds.concat(_identifiable[i].uiLayer.RestIdentifyIds);}}
return restIds.join(',');};this.setEnabledAtScale=function(scale){if(typeof(_win)!='undefined'){for(var i=0,len=_scaleDependents.length;i<len;i++){if(_scaleDependents[i].scale.max>scale&&_scaleDependents[i].scale.min<scale){_scaleDependents[i].setDisabled(false);}else{_scaleDependents[i].setDisabled(true);}}}}};Ext.ux.LandUseLegendPanel=function(config){this.buildLegend=function(el,response,updater,callback){var panel=Ext.getCmp('landUseLegend');panel.el.setZIndex(8001);var layer=Ext.decode(response.responseText).Layers[0];el.update();el.setStyle('font-size','0.8em');var legend='<ul class="legend" style="float:left;padding:0px 4px 4px 4px">';for(var i=0,len=5;i<=len;i++){legend+='<li><div style="background-color:'+layer.Legend[i].Color+';"></div><span>'+layer.Legend[i].Label+'</span></li>';}
legend+='</ul>'
el.createChild({html:legend});legend='<ul class="legend" style="float:left;padding:0px 4px 4px 4px">';for(var i=6,len=layer.Legend.length;i<len;i++){legend+='<li><div style="background-color:'+layer.Legend[i].Color+';"></div><span>'+layer.Legend[i].Label+'</span></li>';}
legend+='</ul>'
el.createChild({html:legend});var luLegend=Ext.getCmp('landUseLegend');luLegend.setSize(luLegend.getSize());};return new Ext.Panel({renderTo:Ext.get('center'),id:'landUseLegend',title:'Land Use Types',cls:'landusetypes',width:370,floating:true,autoLoad:{url:'service.svc/Layer/LandUse',scripts:false},x:config.x,y:27,renderer:{render:this.buildLegend},tools:[{id:'close',handler:function(event,toolEl,panel){config.toggleButton.toggle(false);panel.destroy();}}]});};﻿var CUR=window.CUR||{};CUR.Urls=function(){var mapServer1='www.urbanresearchmaps.org';var mapServer2='146.96.129.113';return{longIslandIndex:['http://'+mapServer1+'/ArcGIS_CUR/services/LongIslandIndex/LongIslandIndex2008/MapServer/WMSServer','http://'+mapServer2+'/ArcGIS_CUR/services/LongIslandIndex/LongIslandIndex2008/MapServer/WMSServer'],demographics:['http://'+mapServer1+'/ArcGIS_CUR/services/LongIslandIndex/Demographics/MapServer/WMSServer','http://'+mapServer2+'/ArcGIS_CUR/services/LongIslandIndex/Demographics/MapServer/WMSServer'],parcels:['http://'+mapServer1+'/arcgiscache/LongIslandIndex_Parcelcache/Layers'],highlight:['WmsHighlightFeatureImage.ashx'],smallScaleAerial:['http://'+mapServer1+'/ArcGIS_CUR/services/LongIslandIndex/SmallScaleAerial/MapServer/WMSServer','http://'+mapServer2+'/ArcGIS_CUR/services/LongIslandIndex/SmallScaleAerial/MapServer/WMSServer'],largeScaleAerial:'http://imsortho.cr.usgs.gov/servlet/com.esri.wms.Esrimap/USGS_EDC_Ortho_NYSDOP_Grid?',baseWideZoom:['http://'+mapServer1+'/arcgiscache/LongIslandIndex_BaseMap_WideZoom/Layers'],longIslandIndexQuery:'http://'+mapServer1+'/ArcGIS_CUR/services/LongIslandIndex/LongIslandIndex2008/MapServer/WMSServer'};}();﻿Ext.ux.Viewport=function(config){return new Ext.Viewport({layout:'border',items:[new Ext.BoxComponent({region:'north',el:'north',split:false,height:84,minSize:84,title:'',margins:'0 0 0 5'}),{region:'west',contentEl:'west',header:true,split:true,width:300,minSize:300,maxSize:500,collapsible:true,margins:'0 0 5 5',cmargins:'0 5 5 5',useSplitTips:true,layout:'fit',style:'border:solid 1px #BBBBBB;',items:[Ext.ux.TabsWest()]},{region:'center',contentEl:'center',header:false,margins:'0 5 5 0',style:'border:solid 1px #BBBBBB;',listeners:{resize:CUR.MapPage.updateMapSize}}]});};﻿var CUR=window.CUR||{};CUR.WebServiceAccess=function(){};CUR.WebServiceAccess.prototype={getVillage:function(fips,successFn,failureFn){Ext.Ajax.request({url:'service.svc/Village/'+fips,success:successFn,failure:failureFn,disableCaching:false});},getDowntown:function(fips,successFn,failureFn){Ext.Ajax.request({url:'service.svc/Downtown/'+fips,success:successFn,failure:failureFn,disableCaching:false});},getLayers:function(category,successFn,failureFn){Ext.Ajax.request({url:'service.svc/Layer/'+category,success:successFn,failure:failureFn,disableCaching:false});},getLongIsland:function(successFn,failureFn,scope){Ext.Ajax.request({url:'service.svc/LongIsland',success:successFn,failure:failureFn,'scope':scope,disableCaching:false});},getSchoolDistricts:function(successFn,failureFn,scope){Ext.Ajax.request({url:'service.svc/SchoolDistrict',success:successFn,failure:failureFn,'scope':scope,disableCaching:false});},getSchoolDistrict:function(code,successFn,failureFn){Ext.Ajax.request({url:'service.svc/SchoolDistrict/'+code,success:successFn,failure:failureFn,disableCaching:false});},getWmsIdEquiv:function(successFn,failureFn,scope){Ext.Ajax.request({url:'service.svc/Layer/WmsIds',success:successFn,failure:failureFn,'scope':scope,disableCaching:false});}};