/**
 * Added Google Maps
 * @name googlemaps-anywhere.min.js
 * @author wokamoto - http://dogmap.jp
 * @version 1.1.7
 * @date January 21, 2010
 * @copyright (c) 2008 - 2010 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,m,c=false;var p=jQuery(this).children("a:first");var j=p.attr("href");var o=G_NORMAL_MAP;var f,h,e,n,l="n";var g=false;switch(j.replace(/^.*(\?|\&|\&amp;)maptype=([^\&]+)[\&]?.*$/i,"$2").toUpperCase()){case"NORMAL":case"G_NORMAL_MAP":o=G_NORMAL_MAP;l="n";break;case"SATELLITE":case"G_SATELLITE_MAP":o=G_SATELLITE_MAP;l="h";break;case"HYBRID":case"G_HYBRID_MAP":o=G_HYBRID_MAP;l="h";break;case"PHYSICAL":case"G_PHYSICAL_MAP":o=G_PHYSICAL_MAP;l="p";break;case"STREETVIEW":g=true;break}if(!g){f=j.replace(/^.*(\?|\&|\&amp;)ll=([^\&]+)[\&]?.*$/i,"$2").split(",");n=Number(j.replace(/^.*(\?|\&|\&amp;)z=([\d]+)[\&]?.*$/i,"$2"));n=((n==NaN?0:n)>0?n: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);n=(k.length>=4?Number(k[3]):5);e=(k.length>=5?Number(k[4]):0)}if(f.length>=2){m=new google.maps.LatLng(Number(f[0]),Number(f[1]));if(m){j=b.mapsURL+"?f=q&hl="+b.language+"&geocode=&q="+m.toUrlValue()+"&ie=UTF8&ll="+m.toUrlValue()+"&t="+l+"&z="+n;p.attr("href",j);if(!g){d=new google.maps.Map2(this);d.addControl(new google.maps.SmallZoomControl());d.setCenter(m,n,o);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()}p.remove();d=new google.maps.StreetviewPanorama(this);google.maps.Event.addListener(d,"error",function(q){switch(q){case NO_NEARBY_PANO:alert(b.errMsgNoData);break;case FLASH_UNAVAILABLE:alert(b.errMsgNoFlash);break;default:alert(b.errMsgUnknown);break}return});c.getNearestPanorama(m,function(q){d.setLocationAndPOV(q.location.latlng,{yaw:h,pitch:e,zoom:n})})}}}})});
