
function MarkerGroup(googlemap,icon){try
{var _googleMap=null;var _markerIcon=null;var _markersVisible=false;var _markers=new Array();function getGoogleMap(){return _googleMap;}
function setGoogleMap(parameter){_googleMap=parameter;GEvent.addListener(_googleMap,'moveend',displayOrHideMrks);}
function getMrkIcon(){return _markerIcon;}
function setMrkIcon(parameter){_markerIcon=parameter;}
function getMrksVisible(){return _markersVisible;}
function setMrksVisible(parameter){_markersVisible=parameter;displayOrHideMrks();}
function tgMrksVisible(){_markersVisible=!_markersVisible;displayOrHideMrks();}
function Dispose(boolDispose){if(boolDispose){try{for(i=0;i<_markers.length;i++){_markers[i]=null;}
_markers=null;_markerIcon=null;_googleMap=null;this.getGoogleMap=null;this.getMrkIcon=null;this.getMrksVisible=null;this.setMrksVisible=null;this.tgMrksVisible=null;this.createMrk=null;this.Dispose=null;}catch(e){}}}
function createMrk(type,longitude,latitude,html1,html2,html3,html4,title,id,direction,url,theZoomLevelThreshold,html5){try
{gpt=new GPoint(longitude,latitude);gpt.infoLongitude=longitude
gpt.infolatitude=latitude
mkr=new GMarker(gpt,_markerIcon,false);mkr.attached=false;mkr.infoLongitude=longitude
mkr.infoLatitude=latitude
mkr.infoHtml1=html1;mkr.infoHtml2=html2;mkr.infoHtml3=html3;mkr.infoHtml4=html4;mkr.infoHtml5=html5;mkr.streaming=false;mkr.title=title;mkr.type=type;mkr.id=id;mkr.direction=direction;mkr.url=url;mkr.theHandler1=null;mkr.theHandler2=null;mkr.theHandler3=null;mkr.zoomLevelDisplayThreshold=theZoomLevelThreshold;_markers.push(mkr);mkr=null;}
catch(e)
{alert(e.message+" - createMrk");}}
function displayOrHideMrks(){try
{var bounds=getViewBoundary();var NE=bounds.getNorthEast();var SW=bounds.getSouthWest();var maxX=NE.lng();var maxY=NE.lat();var minX=SW.lng();var minY=SW.lat();var markersList=[];var mapZoomLevel=_googleMap.getZoom();for(i=0;i<_markers.length;i++){var markerZoomLevelDisplayThreshold=_markers[i].zoomLevelDisplayThreshold;if(_markersVisible){var pt=_markers[i].getPoint();var ptX=pt.lng();var ptY=pt.lat();if(ptX>=minX&&ptX<=maxX&&ptY>=minY&&ptY<=maxY&&markerZoomLevelDisplayThreshold<=mapZoomLevel&&_markers[i].attached==false){_markers[i].theHandler1=GEvent.addListener(_markers[i],"mouseover",openInfoWindow);if(_markers[i].type=="Camera")
_markers[i].theHandler2=GEvent.addListener(_markers[i],"click",DisplayCamera);if(_markers[i].type=="Sign")
_markers[i].theHandler2=GEvent.addListener(_markers[i],"click",DisplaySign);if(_markers[i].type=="Rwis")
_markers[i].theHandler2=GEvent.addListener(_markers[i],"click",DisplayRwis);_markers[i].theHandler3=GEvent.addListener(_markers[i],"mouseout",closeInfoWindow);_markers[i].attached=true;_googleMap.addOverlay(_markers[i]);}
else if((ptX<minX||ptX>maxX||ptY<minY||ptY>maxY||markerZoomLevelDisplayThreshold>mapZoomLevel)&&_markers[i].attached==true){detachMarker(_markers[i]);_markers.clicked=false;}}
else{if(_markers[i].attached){detachMarker(_markers[i]);_markers.clicked=false;}}}}
catch(e)
{var sErr=e.message;}}
function detachMarker(theMarker){if(theMarker.theHandler1!=null){GEvent.removeListener(theMarker.theHandler1);_markers[i].theHandler1=null;}
if(theMarker.theHandler2!=null){GEvent.removeListener(theMarker.theHandler2);theMarker.theHandler2=null;}
if(theMarker.theHandler3!=null){GEvent.removeListener(theMarker.theHandler3);theMarker.theHandler3=null;}
_googleMap.removeOverlay(theMarker);theMarker.attached=false;}
function getViewBoundary(){var retVal=null;var marginAroundMap=0.125;var mapBounds=_googleMap.getBounds();var southWest=mapBounds.getSouthWest();var northEast=mapBounds.getNorthEast();var deltaX=northEast.lng()-southWest.lng();var deltaY=northEast.lat()-southWest.lat();deltaX*=marginAroundMap;deltaY*=marginAroundMap;var southWestLat=southWest.lat()-deltaY;var southWestLng=southWest.lng()-deltaX;var northEastLat=northEast.lat()+deltaY;var northEastLng=northEast.lng()+deltaX;var adjustedSouthWest=new GLatLng(southWestLat,southWestLng,true);var adjustedNorthEast=new GLatLng(northEastLat,northEastLng,true);retVal=new GLatLngBounds(adjustedSouthWest,adjustedNorthEast);return retVal;}
function DisplayCamera()
{if(!_upDating)
{try
{DisplayCameraOnDashBoard(this.id,this.dir,this.title,-1,-1,this.url);}
catch(e)
{alert(e.message+" - openCmWin");}}}
function DisplaySign()
{if(!_upDating)
{try
{DisplaySignOnDashBoard(this.id,this.dir,this.title,-1,-1);}
catch(e)
{alert(e.message+" - DisplaySign()");}}}
function DisplayRwis(){if(!_upDating){try{DisplayRwisOnDashBoard(this.infoHtml5,this.dir,this.title,this.infoLongitude,this.infoLatitude,this.infoHtml1,this.infoHtml2,this.infoHtml3,this.infoHtml4,-1,-1,this.url);}
catch(e){alert(e.message+" - DisplayRwis()");}}}
function openInfoWindow()
{try
{if(!_upDating){if(this.type=="Rwis"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,this.infoHtml4==''?"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Current Temp: "+this.infoHtml1+" °F </td></tr><tr><td>Wind Direction: "+this.direction+" </td></tr><tr><td> Wind Speed : "+this.infoHtml2+" mph </td></tr><tr><td>Wind Gust : "+this.infoHtml3+" mph </td></tr></table>":"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Current Temp: "+this.infoHtml1+" °F </td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td> Wind Speed : "+this.infoHtml2+" mph </td></tr><tr><td>Wind Gust : "+this.infoHtml3+" mph </td></tr><tr><td> Road Temperature: "+this.id+" °F </td></tr><tr><td>Road Status: "+this.infoHtml4+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip(this.infoHtml4==''?"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Current Temp: "+this.infoHtml1+" °F </td></tr><tr><td>Wind Direction: "+this.direction+" </td></tr><tr><td> Wind Speed : "+this.infoHtml2+" mph </td></tr><tr><td>Wind Gust : "+this.infoHtml3+" mph </td></tr></table>":"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Current Temp: "+this.infoHtml1+" °F </td></tr><tr><td>Wind Direction: "+this.direction+" </td></tr><tr><td> Wind Speed : "+this.infoHtml2+" mph </td></tr><tr><td>Wind Gust : "+this.infoHtml3+" mph </td></tr><tr><td> Road Temperature: "+this.id+" °F </td></tr><tr><td>Road Status: "+this.infoHtml4+"</td></tr></table>");}}
if(this.type=="Camera"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=150><tr><td class=cellsigndescription>"+this.title+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=150><tr><td class=cellsigndescription>"+this.title+"</td></tr></table>");}}
if(this.type=="Sign"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=180><tr><td class=cellsigndescription>"+this.title+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=180><tr><td class=cellsigndescription>"+this.title+"</td></tr></table>");}}
if(this.type=="Event"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr align=center ><td> "+this.infoHtml3+" </td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td> Anticipated Impact: "+this.url+" </td></tr><tr><td>Lanes Impacted: "+this.infoHtml1+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr align=center ><td> "+this.infoHtml3+" </td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td> Anticipated Impact: "+this.url+" </td></tr><tr><td>Lanes Impacted: "+this.infoHtml1+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>");}}
if(this.type=="PlannedEvent"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr align=center ><td> "+this.infoHtml3+" </td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td>Lanes Impacted: "+this.infoHtml1+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr align=center ><td> "+this.infoHtml3+" </td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td>Lanes Impacted: "+this.infoHtml1+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>");}}
if(this.type=="Construction"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.infoHtml1+" </font></td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td>Lanes Impacted: "+this.title+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.infoHtml1+" </font></td></tr><tr><td>Direction: "+this.direction+" </td></tr><tr><td>Lanes Impacted: "+this.title+" </td></tr><tr><td> End Date: "+this.infoHtml4+" </td></tr><tr><td>Last Updated: "+this.infoHtml2+"</td></tr></table>");}}
if(this.type=="RoadCondition"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td>"+this.infoHtml1+" </td></tr><tr><td> Last Updated:"+this.infoHtml2+" </td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td>"+this.infoHtml1+" </td></tr><tr><td> Last Updated:"+this.infoHtml2+" </td></tr></table>");}}
if(this.type=="GrayNoReading"){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> No Report </td></tr><tr><td>Last Updated: "+this.infoHtml4+" </td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> No Report </td></tr><tr><td>Last Updated: "+this.infoHtml4+" </td></tr></table>");}}
if(this.type.indexOf("tats")!=-1){if(BrowserDetect.browser=="Safari"){var tooltip=new Tooltip(this,"<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Road Surface: "+this.id+" </td></tr><tr><td>Weather: "+this.direction+" </td></tr><tr><td>Restrictions: "+this.infoHtml1+" </td></tr><tr><td>Last Updated: "+this.infoHtml4+" </td></tr></table>",4);this.tooltip=tooltip;_googleMap.addOverlay(tooltip);this.tooltip.show();}else{showtip("<table cellpadding=0 cellspacing=0 width=250 style=background-color:#FFFBD0 ><tr><td class=cellsigndescription><font size=2>"+this.title+" </font></td></tr><tr><td> Road Surface: "+this.id+" </td></tr><tr><td>Weather: "+this.direction+" </td></tr><tr><td>Restrictions: "+this.infoHtml1+" </td></tr><tr><td>Last Updated: "+this.infoHtml4+" </td></tr></table>");}}}}
catch(e)
{alert(e.message+e.source+" - openInfoWindow");}}
function closeInfoWindow(){if(BrowserDetect.browser=="Safari"){_googleMap.removeOverlay(this.tooltip);this.tooltip.hide();}else{hidetip();}}}
catch(e)
{alert(e.message);}
setGoogleMap(googlemap);setMrkIcon(icon);this.getGoogleMap=getGoogleMap;this.getMrkIcon=getMrkIcon;this.getMrksVisible=getMrksVisible;this.setMrksVisible=setMrksVisible;this.tgMrksVisible=tgMrksVisible;this.createMrk=createMrk;this.Dispose=Dispose;}