/* 
	This script, website, and all map data is Copyright© 2008 WCG:ITX, Inc. All Rights Reserved 
	William Walseth - bill@wcg-itx.com http://www.wcg-itx.com
*/













































function WCGColor(){}WCGColor.prototype=new GControl();WCGColor.prototype.initialize=function(map){var container=document.createElement("div");container.innerHTML="<table class='chart'><tr><td class='text' nowrap='1'>Wind&#160;(Knots)</td><td class='a'>&#160;2</td> <td class='b'>&#160;4</td> <td class='c'>&#160;6</td> <td class='d'>&#160;8</td> <td class='e'>10</td> <td class='f'>12</td> <td class='g'>14</td> <td class='h'>16</td> <td class='i'>18</td> <td class='j'>20</td> <td class='k'>22</td> <td class='l'>24</td> <td class='m'>26</td> <td class='n'>28</td> <td class='o'>30</td> <td class='p'>32+</td> </tr> </table>";map.getContainer().appendChild(container);return container;}WCGColor.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(5, 5));}WCGColor.prototype.setButtonStyle_=function(button){button.style.color="#999999";button.style.backgroundColor="white";button.style.border="1px solid black";button.style.padding="2px";button.style.marginBottom="3px";button.style.textAlign="left";button.style.cursor="pointer";}function ruler(){this.measure=ruler_measure;this.toggle=ruler_toggle;this.clear=ruler_clear;this.show=ruler_show;this.marker1=null;this.marker2=null;this.line=null;this.poly=null;}function ruler_measure(){if(this.marker1&&this.marker2)line=[this.marker1.getPoint(),this.marker2.getPoint()];dist=this.marker1.getPoint().distanceFrom(this.marker2.getPoint());dist=dist.toFixed(0)+"m";if(parseInt(dist)>1000){dist=(parseInt(dist)/1000).toFixed(2)+"km";}document.getElementById("distance").innerHTML=dist;if(this.poly)map.removeOverlay(this.poly);this.poly=new GPolyline(line,'#00CC33', 4, 1)map.addOverlay(this.poly);}function ruler_toggle(){if(this.marker1&&this.marker2){this.clear();document.getElementById("distance").innerHTML="Add Ruler";}else{this.show();document.getElementById("distance").innerHTML="Drag to measure";}}function ruler_show(){var b=map.getBounds();var sw=b.getSouthWest();var ne=b.getNorthEast();var nLng=ne.lng()-sw.lng();var nLat=ne.lat()-sw.lat();var p=0.35;var lat1=ne.lat()-(nLat*p);var lng1=ne.lng()-(nLng*p);var lat2=sw.lat()+(nLat*p);var lng2=sw.lng()+(nLng*p);var pnt1=new GLatLng(lat1, lng1);var pnt2=new GLatLng(lat2, lng2);var b4=new GIcon();b4.image="http://labs.google.com/ridefinder/images/mm_20_green.png";b4.shadow="http://labs.google.com/ridefinder/images/mm_20_shadow.png";b4.iconSize=new GSize(12, 20);b4.shadowSize=new GSize(22, 20);b4.iconAnchor=new GPoint(6, 20);b4.infoWindowAnchor=new GPoint(5, 1);markerOptions={draggable: true, icon:b4};this.marker1=new GMarker(pnt1, markerOptions);map.addOverlay(this.marker1);this.marker1.enableDragging();GEvent.addListener(this.marker1,"drag",function(){ruler.measure();});GEvent.addListener(this.marker1,"dblclick",function(){ruler.clear();});this.marker2=new GMarker(pnt2, markerOptions);map.addOverlay(this.marker2);this.marker2.enableDragging();GEvent.addListener(this.marker2,"drag",function(){ruler.measure();});GEvent.addListener(this.marker2,"dblclick",function(){ruler.clear();});this.measure();}function ruler_clear(){map.removeOverlay(this.poly);map.removeOverlay(this.marker1);map.removeOverlay(this.marker2);this.marker1=null;this.marker2=null;}