/* 
 * jQuery - Static Gmap Zoom - Plugin v1.0
 * www.phpgeek.dk www.twitter.com/phpgeek
 * Copyright 2010, Johan Holst Nielsen
 * Released under the MIT License.
 */
(function(c){c.fn.staticgmapzoom=function(d,e){var a=c.extend({},c.fn.staticgmapzoom.defaults,e);return this.each(function(){$this=c(this);$this.css({width:a.mapWidth,height:a.mapHeight,position:"relative"});var b="",f=false,g=$this.offset();b+=c.fn.staticgmapzoom.getStaticMap(d,1,a);b+=c.fn.staticgmapzoom.getStaticMap(d,2,a);b+=c.fn.staticgmapzoom.getStaticMap(d,3,a);$this.html(b);var h=$this.find("div").eq(0),i=$this.find("div").eq(1);$this.hover(function(){h.stop(true,true).fadeOut("slow")},function(){h.stop(true, true).fadeIn("slow")});$this.bind("mousemove",function(j){var k=j.pageY-g.top;if(Math.abs(a.mapWidth/2-(j.pageX-g.left))<=a.mapWidth*a.zoomInDistance&&Math.abs(a.mapHeight/2-k)<=a.mapHeight*a.zoomInDistance){if(!f){i.stop(true,true).fadeOut("slow");f=true}}else if(f){i.stop(true,true).fadeIn("slow");f=false}})})};c.fn.staticgmapzoom.getStaticMap=function(d,e,a){var b='<div style="position:absolute;left:0;top:0;z-index:'+(11-e)+';" class="gmaplayer'+e+'">';b=b+'<img src="http://maps.google.com/maps/api/staticmap?size='+ a.mapWidth+"x"+a.mapHeight;b=b+"&maptype="+a.mapType;return b=b+"&zoom="+eval("a.mapZoom"+e)+"&markers=color:red|size:small|"+d+'&sensor=false"></div>'};c.fn.staticgmapzoom.defaults={mapType:"roadmap",mapWidth:400,mapHeight:200,mapZoom1:3,mapZoom2:6,mapZoom3:12,zoomInDistance:0.25}})(jQuery);

