/**
 * Added Google Maps
 * @name googlemaps-anywhere.min.js
 * @author wokamoto - http://dogmap.jp
 * @version 1.1.0
 * @date March 24, 2009
 * @copyright (c) 2008 - 2009 wokamoto (dogmap.jp)
 * @license  Released under the GPL license (http://www.gnu.org/copyleft/gpl.html)
 * @requires jQuery v1.2.3 or later
 */
if(typeof google.maps==="undefined"){google.load("maps","2",{language:(typeof googlemapsAnywhereL10n!=="undefined"?googlemapsAnywhereL10n.language:"ja")})}google.setOnLoadCallback(function(){var b=jQuery.extend({markerTitle:"Move to the Google map.",cssPath:"div.googlemap",language:"ja",errMsgNoData:"Error: No panorama data was found.",errMsgNoFlash:"Error: Flash doesn't appear to be supported by your browser.",errMsgUnknown:"Error: Unknown Error.",mapsURL:"http://maps.google.com/maps"},googlemapsAnywhereL10n);var a={title:b.markerTitle};jQuery(b.cssPath).each(function(){var d,i,l,c=false;var o=jQuery(this).children("a:first");var j=o.attr("href");var n=G_NORMAL_MAP;var f,h,e,m;var g=false;switch(j.replace(/^.*(\?|\&|\&amp;)maptype=([^\&]+)[\&]?.*$/i,"$2").toUpperCase()){case"NORMAL":case"G_NORMAL_MAP":n=G_NORMAL_MAP;break;case"SATELLITE":case"G_SATELLITE_MAP":n=G_SATELLITE_MAP;break;case"HYBRID":case"G_HYBRID_MAP":n=G_HYBRID_MAP;break;case"PHYSICAL":case"G_PHYSICAL_MAP":n=G_PHYSICAL_MAP;break;case"STREETVIEW":g=true;break}if(!g){f=j.replace(/^.*(\?|\&|\&amp;)ll=([^\&]+)[\&]?.*$/i,"$2").split(",");m=Number(j.replace(/^.*(\?|\&|\&amp;)z=([\d]+)[\&]?.*$/i,"$2"));m=((m==NaN?0:m)>0?m:14)}else{f=j.replace(/^.*(\?|\&|\&amp;)cbll=([^\&]+)[\&]?.*$/i,"$2").split(",");var k=j.replace(/^.*(\?|\&|\&amp;)cbp=([^\&]+)[\&]?.*$/i,"$2").split(",");h=(k.length>=2?Number(k[1]):0);m=(k.length>=4?Number(k[3]):5);e=(k.length>=5?Number(k[4]):0)}if(f.length>=2){l=new google.maps.LatLng(Number(f[0]),Number(f[1]));if(l){j=b.mapsURL+"?f=q&hl="+b.language+"&geocode=&q="+l.toUrlValue()+"&ie=UTF8&ll="+l.toUrlValue()+"&t=h&z="+m;o.attr("href",j);if(!g){d=new google.maps.Map2(this);d.addControl(new google.maps.SmallZoomControl());d.setCenter(l,m,n);i=new google.maps.Marker(d.getCenter(),a);d.addOverlay(i);google.maps.Event.addListener(i,"click",function(){location.href=j})}else{if(c==false){c=new google.maps.StreetviewClient()}d=new google.maps.StreetviewPanorama(this);google.maps.Event.addListener(d,"error",function(p){switch(p){case NO_NEARBY_PANO:alert(b.errMsgNoData);break;case FLASH_UNAVAILABLE:alert(b.errMsgNoFlash);break;default:alert(b.errMsgUnknown);break}return});c.getNearestPanorama(l,function(p){d.setLocationAndPOV(p.location.latlng,{yaw:h,pitch:e,zoom:m})})}}}})});