var tz_offset=Math.round((new Date).getTimezoneOffset()/60);function Photo(a,d,c,b){this.map=a;this.exifdata=d;this.trackpoints=c;this.tracktimes=b;this.pmarker=null}
Photo.prototype.locate=function(){var a=this.locateTimeInTracklog(this.exifdata.date+tz_offset*3600);if(a!==null){this.exifdata.lon=a.lng();this.exifdata.lat=a.lat();this.showPhotoMarker();document.getElementById("locateresult").innerHTML=TEXT.comp_coord+": "+TEXT.lat+": "+a.lat().toFixed(5)+" "+TEXT.lon+" : "+a.lng().toFixed(5)+"<br />Flickr Tags: geotagged geo:lat="+a.lat().toFixed(5)+" geo:lon="+a.lng().toFixed(5)+"<br />";document.getElementById("locatedownload").innerHTML='<a href="downloadphoto.php?fileid='+
encodeURIComponent(this.exifdata.fileid)+"&amp;original_name="+encodeURIComponent(this.exifdata.original_name)+"&amp;lat="+a.lat().toFixed(5)+"&amp;lon="+a.lng().toFixed(5)+'">Download</a> '+TEXT.photo_with_tags}else{document.getElementById("locateresult").innerHTML=TEXT.not_within_track+"<br />";document.getElementById("locatedownload").innerHTML=""}};
Photo.prototype.locateTimeInTracklog=function(a){for(var d,c,b=0;b<this.tracktimes.length-1;b++){d=this.tracktimes[b];c=this.tracktimes[b+1];if(a>=d&&a<c)return this.trackpoints[b]}return null};Photo.prototype.changeOffset=function(a){if(tz_offset!==a){tz_offset=a;this.removeMarker();this.locate()}};Photo.prototype.showPhotoMarker=function(){this.pmarker=this.createLocatedPhotoMarker();this.pmarker.setMap(map);this.map.setCenter(this.pmarker.getPosition());overlayManager.add(this.pmarker)};
Photo.prototype.createLocatedPhotoMarker=function(){var a=new google.maps.Marker({position:new google.maps.LatLng(this.exifdata.lat,this.exifdata.lon),icon:photoimage[0],shadow:photoimage[1]}),d=this.exifdata.fileid,c='<div class="markerinfo">geo:lat='+this.exifdata.lat.toFixed(5)+" geo:lon="+this.exifdata.lon.toFixed(5)+"<br />",b;if(this.exifdata.time>0){b=new Date(this.exifdata.time*1E3);c+="time created: "+b.toGMTString()}c+="</div>";var e=new google.maps.InfoWindow({content:c});google.maps.event.addListener(a,
"click",function(){displayThumbnail(d);e.open(map,a)});return a};Photo.prototype.removeMarker=function(){this.pmarker&&this.pmarker.setMap(null)};

