function panophotos(json) {
	for (var i = 0; i < json.photos.length; i++) {
		var photo = json.photos[i];
		$("pano_photo_"+i).update(
			'<a href="'+photo.photo_url+'"><img alt="'+photo.photo_title+'" src="'+photo.photo_file_url+'"/></a>' );
		$("pano_author_"+i).update( 'Author: <a href="'+photo.owner_url+'">'+photo.owner_name+'</a>');
	}
	for (var i = json.photos.length; i < 8; i++) { $("pano_photo_"+i).ancestors().first().hide(); }
}
loadpanophotos_bbox = function(minlat,minlon,maxlat,maxlon) {
  minx = minlon;
  maxx = maxlon;
  miny = minlat;
  maxy = maxlat;
  var url = "http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=8&minx="+minx+"&miny="+miny+
    "&maxx="+maxx+"&maxy="+maxy+"&size=thumbnail&callback=panophotos";
  var script = document.createElement('script');
  script.setAttribute('src', url);
  script.setAttribute('id', 'jsonScript');
  script.setAttribute('type', 'text/javascript');
  document.documentElement.firstChild.appendChild(script);
}
