//
//
//

function init() {

}

function submitForm()
	{
	  var parm = document.pageTools.pageTools2.value;
	  if( parm == "mapAdd"){
		  Mapify();
	  }
	}

function Mapify() {
   document.body.innerHTML=document.body.innerHTML.replace(
      /\b((\d+|one|two|three|four|five|six|seven|eight|nine|ten)([^\n]{1,30}?)\b(street|st|road|rd|avenue|av|ave|court|ct|circle|cir|lane|ln|boulevard|blvd|bl|place|pl|drive|dr|square|sq|trail|tr|way|plaza|parkway|pkwy|route (\d+|one|two|three|four|five|six|seven|eight|nine|ten))\b([\s\S]{3,50})\b(maine|me|vermont|vt|new hampshire|nh|massachusetts|ma|connecticut|ct)\b([\s\S]{1,20}\d{5}(-\d{4})?)?)/ig,
      function (addr) {
         url=addr.replace(/<[^>]+>/g,'');
         url=url.replace(/po box \d+/i,'');
         url=encodeURIComponent(url.replace(/\n/g,' '));
         // alert(addr);
         return addr+' <a href="http://www.maine.gov/cgi-bin/gmaps/map.pl?show=query&address='+url+'">[Map It]</a>';
         // return '<a href="http://www.maine.gov/cgi-bin/gmaps/map.pl?show=query&address='+url+'">'+addr+'</a>';
      });
}
