if(typeof(nccms)==="undefined"){var nccms={}}nccms.google={map:null,init:function(b,c){nccms.google.initCallback.push(function(){nccms.google.createMap(document.getElementById(b))});if(c){if(typeof(c)==="function"){nccms.google.initCallback.push(c)}else{if(c instanceof Array){nccms.google.initCallback=nccms.google.initCallback.concat(c)}}}var a=document.createElement("script");a.type="text/javascript";a.src="http://maps.googleapis.com/maps/api/js?sensor=false&callback=nccms.google.bootstrap";document.body.appendChild(a)},createMap:function(a,b){if(!a){return false}if(!b){b={zoom:6,center:new google.maps.LatLng(52.121583954177716,19.06591796875),mapTypeId:google.maps.MapTypeId.ROADMAP}}nccms.google.map=new google.maps.Map(a,b);return nccms.google.map},addMarker:function(d,c){var b={position:d,map:nccms.google.map,clickable:false,draggable:false,raiseOnDrag:false,visible:true};if(typeof(c)==="object"){for(var a in c){b[a]=c[a]}}return new google.maps.Marker(b)},focusMapOnLocation:function(b){try{if(b.bounds&&b.location_type===google.maps.GeocoderLocationType.APPROXIMATE){nccms.google.map.fitBounds(new google.maps.LatLngBounds(new google.maps.LatLng(b.bounds.southwest.lat,b.bounds.southwest.lng),new google.maps.LatLng(b.bounds.northeast.lat,b.bounds.northeast.lng)))}else{nccms.google.map.setCenter(new google.maps.LatLng(b.location.lat,b.location.lng))}}catch(a){nccms.deb.log(a)}},findLocation:function(a,b){$.getJSON(nccms.google.proxyHref,{format:"json",q:a},function(d,e,c){if(d&&d.status==="OK"){nccms.google.focusMapOnLocation(d.results[0].geometry);if(b){b.call(nccms.google.map,d.results)}}else{if(b){b.call(nccms.google.map,null)}}})},getProxy:function(){return nccms.google.proxyHref},setProxy:function(a){nccms.google.proxyHref=a},proxyHref:window.location.href,initCallback:[],bootstrap:function(){for(var a=0;a<nccms.google.initCallback.length;a++){nccms.google.initCallback[a].apply()}}};
